-
Notifications
You must be signed in to change notification settings - Fork 493
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PlanningRequestAdapter helper method getParam #468
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good cleanup. We will at some point apply a repo-wide refactoring for declaring and loading all parameters. Wrapping the getters and checks in clean functions like this will help a lot with that.
@@ -993,6 +993,10 @@ bool TimeOptimalTrajectoryGeneration::computeTimeStamps(robot_trajectory::RobotT | |||
|
|||
// Compute sample count | |||
size_t sample_count = std::ceil(parameterized.getDuration() / resample_dt_); | |||
if (sample_count < num_points) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By increasing sample_count
to num_points
the trajectory is filled with duplicate trajectory points with the same time stamps at the end which breaks CI (ros2_control isn't happy about that). The reason is that the computed timestamps in the loop below exceed the trajectory duration (see https://github.com/ros-planning/moveit2/pull/468/files#diff-227cef8a99e7eaf48f74355541c0f673279e65839065e5f29646319063377cdeR1008). Is it necessary for you to have at least num_points
waypoints? If so, you would have to recompute resample_dt_
as parameterized.getDuration() / num_points
to match the trajectory duration. But I think the better option would be to just specify a resampling step that works in general and remove this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I think the better option would be to just specify a resampling step that works in general and remove this change.
Do you mean an entirely separate PlanningRequestAdapter that does the resampling? Because I agree, but don't know how to move forward with that in a way that doesn't break everyone's existing configurations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I meant setting the resampling_dt parameter small enough so that you don't have to worry about trajectory waypoint count at all.
Codecov Report
@@ Coverage Diff @@
## main #468 +/- ##
==========================================
- Coverage 48.86% 48.84% -0.01%
==========================================
Files 218 218
Lines 22987 22969 -18
==========================================
- Hits 11230 11217 -13
+ Misses 11757 11752 -5
Continue to review full report at Codecov.
|
@DLu Awesome, you broke the curse! |
Description
The same logic for resolving parameter names, checking for the existence of the parameter and printing the results was invoked several times in the different
PlanningRequestAdapter
s. This PR modularizes that logic and adds it for TOTG.I admit that the
getParam
method parameters are not the cleanest. There's an argument that instead,node
andparameter_namespace
are made class members and there's a base implementation ofinitialize
that sets them. However, you'd still have to pass the LOGGER around (or create another instance).Checklist