-
Notifications
You must be signed in to change notification settings - Fork 0
Pikpaksw 583 fix pilz linear planner violating joint limits #1
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
base: jazzy
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -142,7 +142,7 @@ bool pilz_industrial_motion_planner::computeLinkFK(moveit::core::RobotState& rob | |||||
| return true; | ||||||
| } | ||||||
|
|
||||||
| bool pilz_industrial_motion_planner::verifySampleJointLimits( | ||||||
| double pilz_industrial_motion_planner::verifySampleJointLimits( | ||||||
| const std::map<std::string, double>& position_last, const std::map<std::string, double>& velocity_last, | ||||||
| const std::map<std::string, double>& position_current, double duration_last, double duration_current, | ||||||
| const pilz_industrial_motion_planner::JointLimitsContainer& joint_limits) | ||||||
|
|
@@ -151,55 +151,57 @@ bool pilz_industrial_motion_planner::verifySampleJointLimits( | |||||
| if (duration_current <= epsilon) | ||||||
| { | ||||||
| RCLCPP_ERROR(getLogger(), "Sample duration too small, cannot compute the velocity"); | ||||||
| return false; | ||||||
| return -1.0; | ||||||
| } | ||||||
|
|
||||||
| double velocity_current, acceleration_current; | ||||||
|
|
||||||
| double max_scaling_factor = 0.0; | ||||||
|
||||||
| double max_scaling_factor = 0.0; | |
| double max_scaling_factor = 1.0; |
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.
Minor - Would returning an optional rather than a negative value be more explicit about what can be used or not?
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.
[minor]: not actionable, but "max_scaling_factor" may be a bit misleading for people used to ros/moveit terminologies, because typically "vel_scaling_factor" and "acc_scaling_factor" is used to "speed up" the trajectory, while here it is a measure of how much "slow down" the trajectory.
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.
Any suggestions for a different name?
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.
Maybe required_vel_slowdown_factor? I'm assuming it's specifically a scaling on the velocity to bring both vel and acc into compliance given we sqrt the acc above and square it when reapplying below?
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.
Why 1.5?
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.
The number is just my guess. During the test, in most cases violation is small (less than 1.2), if cartesian limits are reasonable. If it is too high, I think it would make sense to adjust limits rather than re-scale.
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.
Minor - Maybe best to throw this in a constexpr at the top of the file to make it easy to spot as a "tuneable" value instead of having to dig in?
Uh oh!
There was an error while loading. Please reload this page.