-
Notifications
You must be signed in to change notification settings - Fork 327
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
[JTC] Process tolerances sent with action goal #716
[JTC] Process tolerances sent with action goal #716
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #716 +/- ##
===========================================
- Coverage 71.86% 47.05% -24.81%
===========================================
Files 41 41
Lines 3650 3925 +275
Branches 1794 1863 +69
===========================================
- Hits 2623 1847 -776
- Misses 707 780 +73
- Partials 320 1298 +978
Flags with carried forward coverage won't be shown. Click here to find out more.
|
This pull request is in conflict. Could you fix it @christophfroehlich? |
This pull request is in conflict. Could you fix it @christophfroehlich? |
This pull request is in conflict. Could you fix it @christophfroehlich? |
This pull request is in conflict. Could you fix it @christophfroehlich? |
This pull request is in conflict. Could you fix it @christophfroehlich? |
This pull request is in conflict. Could you fix it @christophfroehlich? |
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.
Few minor comments. Rest looks good to me.
Thank you for the changes!
joint_trajectory_controller/include/joint_trajectory_controller/tolerances.hpp
Outdated
Show resolved
Hide resolved
joint_trajectory_controller/include/joint_trajectory_controller/tolerances.hpp
Outdated
Show resolved
Hide resolved
joint_trajectory_controller/include/joint_trajectory_controller/tolerances.hpp
Outdated
Show resolved
Hide resolved
joint_trajectory_controller/include/joint_trajectory_controller/tolerances.hpp
Outdated
Show resolved
Hide resolved
joint_trajectory_controller/include/joint_trajectory_controller/tolerances.hpp
Outdated
Show resolved
Hide resolved
joint_trajectory_controller/include/joint_trajectory_controller/tolerances.hpp
Outdated
Show resolved
Hide resolved
joint_trajectory_controller/include/joint_trajectory_controller/tolerances.hpp
Outdated
Show resolved
Hide resolved
joint_trajectory_controller/include/joint_trajectory_controller/tolerances.hpp
Outdated
Show resolved
Hide resolved
joint_trajectory_controller/src/joint_trajectory_controller.cpp
Outdated
Show resolved
Hide resolved
joint_trajectory_controller/src/joint_trajectory_controller.cpp
Outdated
Show resolved
Hide resolved
Co-authored-by: Sai Kishor Kothakota <saisastra3@gmail.com>
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.
Very good PR! Thanks. I have a few minor comments, but we can also merge without resolving them. They are mostly cosmetic nature.
From the node parameter we cannot set velocity or acceleration tolerances (except for a single
stopped_velocity_tolerance
for the goal tolerances of all joints). Should we add them as parameters as well, to have the same structure like the action message?
This would be nice to have in the follow-up PR.
This new feature could break some existing projects, because the tolerances were just ignored and might now be breaking behaviors. Should we introduce a temporary parameter to opt-in?
No. Just to add a note to migration notes.
@@ -95,6 +97,8 @@ SegmentTolerances get_segment_tolerances(Params const & params) | |||
|
|||
SegmentTolerances tolerances; | |||
tolerances.goal_time_tolerance = constraints.goal_time; | |||
auto logger = rclcpp::get_logger("tolerance"); |
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 might be better to have a logger object and initialize child tolerances here of the JTC node.
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.
I haven't had a better idea as passing the JTC logger as argument to the get_segment_tolerances
methods. There is no persistent class with a configuration/constructor method to pass the logger only once.
* | ||
* \param default_tolerances The default tolerances to use if the action goal does not specify any. | ||
* \param goal The new action goal | ||
* \param params The ROS Parameters |
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.
I am not sure why do we need ROS parameters because the default tolerances should be added through parameters, isn't it?
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 only field we need is the params.joints actually, I can change it to have a std::vector as argument instead?
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.
done
SegmentTolerances active_tolerances(default_tolerances); | ||
|
||
active_tolerances.goal_time_tolerance = rclcpp::Duration(goal.goal_time_tolerance).seconds(); | ||
auto logger = rclcpp::get_logger("tolerance"); |
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.
It would be great to have a static object for this, as mentioned above because we are creating objects all the time.
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.
see above
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.
Not sure that we need a header file here. Maybe just add this on top of the .cpp
file. Those are not too big.
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.
I use it in test_tolerances.cpp and test_trajectory_actions.cpp, that's why I created this header file.
I can add it to test_trajectory_controller_utils.hpp if you prefer
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.
I moved it into the other utils header file, but had to mark it as [[maybe_unused]]
.
I opened a follow-up issue.
Done. @destogl I addressed all your comments, please have a look once again. Test still are fine.
|
(cherry picked from commit 07061f9) # Conflicts: # doc/migration/Jazzy.rst # doc/release_notes/Jazzy.rst
(cherry picked from commit 07061f9) # Conflicts: # doc/migration/Jazzy.rst # doc/release_notes/Jazzy.rst
@bmagyar do we want to backport this to humble/iron? Then I'd update the release notes accordingly |
From here:
This PR proposes a way how to process the tolerances: The tolerances from one action goal are not saved for the next one, but the default ones will be used if no tolerances are set with the following action goals.
(Temporary) deactivation is also implemented like documented in the msg definition.
From the node parameter we cannot set velocity or acceleration tolerances (except for a single
stopped_velocity_tolerance
for the goal tolerances of all joints). Should we add them as parameters as well, to have the same structure like the action message?This new feature could break some existing projects, because the tolerances were just ignored and might now be breaking behaviors. Should we introduce a temporary parameter to opt-in?
Fixes #249