-
Notifications
You must be signed in to change notification settings - Fork 305
Start executing passthrough trajectories earlier than all points are transferred. #1313
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
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1313 +/- ##
========================================
+ Coverage 3.59% 5.58% +1.99%
========================================
Files 13 31 +18
Lines 947 3113 +2166
Branches 152 379 +227
========================================
+ Hits 34 174 +140
- Misses 843 2937 +2094
+ Partials 70 2 -68
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
1f84b1d to
7ac040d
Compare
urmahp
left a comment
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.
Overall looks good, added some comments.
urmahp
left a comment
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.
Overall it looks good. Have small suggestions which is not really related to this PR, but is part of the touched code, so I stumbled across them.
| } else if (!has_velocities(trajectory_joint_velocities_) && has_accelerations(trajectory_joint_accelerations_)) { | ||
| ur_driver_->writeTrajectorySplinePoint(trajectory_joint_positions_[i], trajectory_joint_accelerations_[i], | ||
| trajectory_times_[i]); | ||
| } else if (has_velocities(trajectory_joint_velocities_) && has_accelerations(trajectory_joint_accelerations_)) { |
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.
Are we sure that it is not possible to create a trajectory with points, that has no velocity specified, but has accelerations? As it is now, then we will just skip those points.
Would it make sense to do something along the lines of:
ur_driver_->writeTrajectorySplinePoint(trajectory_joint_positions_[i], urcl::vector6d_t{ 0, 0, 0, 0, 0, 0 }, trajectory_joint_accelerations_[i], trajectory_times_[i]);
| if (!has_velocities(trajectory_joint_velocities_) && !has_accelerations(trajectory_joint_accelerations_)) { | ||
| for (size_t i = 0; i < trajectory_joint_positions_.size(); i++) { | ||
| for (size_t i = point_index_sent; i < point_index_received; i++) { | ||
| if (!has_velocities(trajectory_joint_velocities_) && !has_accelerations(trajectory_joint_accelerations_)) { |
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.
Are we sure that positions is always going to be part of the points received from the forward controller?
If we can end up in a situation where positions is not part of the received points, then I think we should handle it more cleanly with a separate if statement and Logging an error.
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.
In the current implementation that we have with the passthrough trajectory controller, that is given. But I do see the point that a better handling would be to catch that here. I would actually advocate for the same thing regarding the acceleration but no velocity. If the user wants to specify accelerations combined with 0 velocities that should be done explicitly.
I'll add catching and raising an error.
…ransferred. When transferring trajectories with many waypoints it can take quite a while until all points are transferred from the controller to the hardware interface, especially on lower hardware_interface update rates. With this change, execution starts as soon as enough trajectory points are transferred to fill 5 control cycles. This PR effectively allows reducing the hardware_interface update_rate when using the passthrough_trajectory_controller significantly. This will reduce the networking requirements improving the overall user experience.
If we miss the new trajectory, wen cannot resize the vectors appropriately.
Co-authored-by: Mads Holm Peters <[email protected]>
…transferred. (#1313) * Start executing passthrough trajectories earlier than all points are transferred. When transferring trajectories with many waypoints it can take quite a while until all points are transferred from the controller to the hardware interface, especially on lower hardware_interface update rates. With this change, execution starts as soon as enough trajectory points are transferred to fill 5 control cycles. This PR effectively allows reducing the hardware_interface update_rate when using the passthrough_trajectory_controller significantly. This will reduce the networking requirements improving the overall user experience. * Make sure we acknowledge a new trajectory before sending points If we miss the new trajectory, wen cannot resize the vectors appropriately. (cherry picked from commit 14f80ac) # Conflicts: # ur_controllers/src/passthrough_trajectory_controller.cpp # ur_robot_driver/urdf/ur.ros2_control.xacro
…transferred. (#1313) * Start executing passthrough trajectories earlier than all points are transferred. When transferring trajectories with many waypoints it can take quite a while until all points are transferred from the controller to the hardware interface, especially on lower hardware_interface update rates. With this change, execution starts as soon as enough trajectory points are transferred to fill 5 control cycles. This PR effectively allows reducing the hardware_interface update_rate when using the passthrough_trajectory_controller significantly. This will reduce the networking requirements improving the overall user experience. * Make sure we acknowledge a new trajectory before sending points If we miss the new trajectory, wen cannot resize the vectors appropriately.
…transferred. (backport of #1313) (#1335) * Start executing passthrough trajectories earlier than all points are transferred. When transferring trajectories with many waypoints it can take quite a while until all points are transferred from the controller to the hardware interface, especially on lower hardware_interface update rates. With this change, execution starts as soon as enough trajectory points are transferred to fill 5 control cycles. This PR effectively allows reducing the hardware_interface update_rate when using the passthrough_trajectory_controller significantly. This will reduce the networking requirements improving the overall user experience. * Make sure we acknowledge a new trajectory before sending points If we miss the new trajectory, wen cannot resize the vectors appropriately. Co-authored-by: Felix Exner <[email protected]>
When transferring trajectories with many waypoints it can take quite a
while until all points are transferred from the controller to the
hardware interface, especially on lower hardware_interface update rates.
With this change, execution starts as soon as enough trajectory points
are transferred to fill 5 control cycles.
This PR effectively allows reducing the hardware_interface update_rate
when using the passthrough_trajectory_controller significantly. This
will reduce the networking requirements improving the overall user
experience.