Repository navigation
Servo: re-order velocity limit check & minor cleanup - #956
Conversation
0c361cb to
a38e4e8
Compare
- Re-order the checking of velocity limits. These limits should be checked after the other operations that affect velocity. Otherwise they aren't accurate. - Delete a block of code that was accidentally duplicated. - Clean up some comments. - Delete a couple unused things.
a38e4e8 to
109eb66
Compare
Codecov Report
@@ Coverage Diff @@
## main #956 +/- ##
==========================================
+ Coverage 57.90% 57.92% +0.02%
==========================================
Files 310 310
Lines 26113 26105 -8
==========================================
Hits 15118 15118
+ Misses 10995 10987 -8
Continue to review full report at Codecov.
|
| command_in_type: "unitless" # "unitless"> in the range [-1:1], as if from joystick. "speed_units"> cmds are in m/s and rad/s | ||
| scale: | ||
| # Scale parameters are only used if command_in_type=="unitless" | ||
| linear: 0.4 # Max linear velocity. Meters per publish_period. Unit is [m/s]. Only used for Cartesian commands. |
There was a problem hiding this comment.
this simply wasn't accurate. It's left from the initial implementation years ago
| Eigen::ArrayXd enforceVelocityLimits(const moveit::core::JointModelGroup* joint_model_group, double publish_period, | ||
| const Eigen::ArrayXd& delta_theta); | ||
| void enforceVelocityLimits(const moveit::core::JointModelGroup* joint_model_group, const double publish_period, | ||
| sensor_msgs::msg::JointState& joint_state); |
There was a problem hiding this comment.
I had to refactor this because the order of velocity limit application was modified. No change in functionality.
| std::bind(&ServoCalcs::collisionVelocityScaleCB, this, _1)); | ||
|
|
||
| // Publish to collision_check for worst stop time | ||
| worst_case_stop_time_pub_ = |
There was a problem hiding this comment.
This was unused. I think it's gone from MoveIt1 completely but somehow re-appeared in the port to MoveIt2
| std::exit(EXIT_FAILURE); | ||
| } | ||
|
|
||
| // Load the smoothing plugin |
There was a problem hiding this comment.
This was duplicated in the block above
henningkayser
left a comment
There was a problem hiding this comment.
I don't see anything wrong with these changes, will approve after my questions are answered. Could you give this PR a more meaningful name so that the current one doesn't end up as a commit message?
tylerjw
left a comment
There was a problem hiding this comment.
I read through these and they look like good changes. Thank you!
This is a simplified version of #886. It removes the latency compensation parameter that was controversial with reviewers for some reason (despite fixing some hardware issues and being backed as similar to what the robot manufacturers use :/ ). By splitting it out, I hope the review is faster.
The various fixes here are:
Re-order the checking of velocity limits. These limits should be checked after the other operations that affect velocity. Otherwise they aren't accurate.
Delete a block of code that was accidentally duplicated.
Clean up some comments.
Delete a couple unused things.
You can test this PR with the tutorial: https://moveit.picknik.ai/main/doc/realtime_servo/realtime_servo_tutorial.html
If you're familiar with the tutorial, you'll notice that motion is faster.