Repository navigation
Add time-optimal trajectory parameterization plugin - #809
mikeferguson wants to merge 3 commits into
Conversation
|
A note on the commit history: it should be preserved, the first commit is the code AS IMPORTED, and so it is easy to see what has been changed in the second commit |
davetcoleman
left a comment
There was a problem hiding this comment.
whew that's a lot of code!
|
|
||
| virtual ~PathSegment() | ||
| { | ||
| } |
There was a problem hiding this comment.
remove this empty function?
| { | ||
| public: | ||
| /// @brief Generates a time-optimal trajectory | ||
| Trajectory(const Path& path, const Eigen::VectorXd& maxVelocity, const Eigen::VectorXd& maxAcceleration, |
There was a problem hiding this comment.
One thing to consider: how far do we want to diverge from the upstream codebase? It makes merging new upstream stuff tougher. I'd suggest not changing variable names of the code that is imported from Tobias
There was a problem hiding this comment.
I'm curious - where is the upstream codebase?
There was a problem hiding this comment.
Tobias hasn't updated that repository in 4 years, and he can't really do OSS anymore due to Waymo employment. Do we really think we'll be merging any new upstream stuff into here? The odds of that seem very low to me.
If you want to keep the original formatting just to save effort, however, I guess I can see that.
|
|
||
| // Outputs the phase trajectory and the velocity limit curve in 2 files for | ||
| // debugging purposes. | ||
| // void outputPhasePlaneTrajectory() const; |
| } | ||
| double pathPos; | ||
| double pathVel; | ||
| double time; |
|
|
||
| #include <limits> | ||
| //#include <fstream> | ||
| //#include <iostream> |
| if (maxVelocity == std::numeric_limits<double>::infinity()) | ||
| maxVelocity = 10.0; | ||
| file1 << s << " " << maxVelocity << " " << getVelocityMaxPathVelocity(s) | ||
| << endl; |
| return false; | ||
| } | ||
|
|
||
| // Returns true if end of path is reached |
There was a problem hiding this comment.
comments like this belong in header file
| else if (pathVel < 0.0) | ||
| { | ||
| valid = false; | ||
| logError("error"); |
| const double max_acceleration_scaling_factor) | ||
| { | ||
| double tolerance = 0.01; // TODO | ||
| double resample = 0.1; // TODO |
There was a problem hiding this comment.
Did you have a preference of the question I mentioned, regarding computeTimeStamps signature?
| @@ -0,0 +1,1012 @@ | |||
| /* | |||
There was a problem hiding this comment.
would be ideal to split out some of these classes into separate files
|
@davetcoleman while it looks like a lot of code, most of it comes from the upstream repo. I've added some tests while cleaning up formatting/cmake in the 2nd commit, but the 3rd commit is the majority of the "new" code. |
I do not feel they need to be the same. Or, perhaps we can add the two additional parameters to the function signature with good default values in the header? |
|
This leads to much better time parametrization for me than the TOPP Pull Request. But I get a segmentation fault if I plan with target state = current state. I tested it with kinetic but I don't think that's the issue. |
|
Very keen to trial TOPP and TOTG, looks promising! @mikeferguson you mentioned TOPP has been implemented in Kinetic, which repo are you referring to? Cheers 😀 |
|
@hartmanndennis -- thanks for the feedback and a heads up on the segfault -- that actually makes sense, I don't think we handle that case anywhere, I'll make sure to add a test and a fix for that before we merge. @RhysMcK -- I believe I misspoke above about TOPP -- I was referring to #441, but I now see that is something different from TOPP (I vaguely followed the comments, and TOPP was mentioned several times, leading me to think it was TOPP itself being added). @davetcoleman -- I haven't forgotten about this, just been away from my dev box. Will address changes sometime later this week. |
|
I have found another bug. Sometimes the last point of a trajectory has a significant non-zero velocity, causing extreme jerk and stopping the robot. |
|
Is there any progress on this? |
|
@mikeferguson can you address my feedback and re-target this PR for melodic? Note the melodic branch compiles on ROS Kinetic, if that's an issue for you. |
|
@mikeferguson @davetcoleman this can be closed since #1365 is merged |
|
Closed via #1365. |
Co-authored-by: Henning Kayser <[email protected]> Co-authored-by: Jafar Abdi <[email protected]>
Description
This is a long-overdue request, implementing #160. This wraps/modifies the TOTG code from https://github.com/tobiaskunz/trajectories to work within MoveIt. Compared to the current Iterative Time Parameterization, this one actually does a pretty job enforcing the velocity/acceleration limits (although, based on some plotting, in some cases it probably produces a larger jerk).
There are two remaining "magic numbers" (the "tolerance" and the "resample" time) that need to be parameterized somewhere, but I'm not sure where. Before I went and implemented something, I figured I would see if anyone has a strong opinion about how similar we want these parameterization things to be (for instance, do we want to insist that they all have same function signature in computeTimeStamps?).
I produced this PR to Indigo, once we've OK'd that, I'll create a Kinetic version as well (it will be slightly different since it looks like we have TOPP in Kinetic, so some of the CMake changes will likely conflict).
Checklist