-
Notifications
You must be signed in to change notification settings - Fork 100
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
Rework PID class API #246
base: ros2-master
Are you sure you want to change the base?
Rework PID class API #246
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## ros2-master #246 +/- ##
===============================================
+ Coverage 72.75% 73.86% +1.11%
===============================================
Files 25 25
Lines 1101 1148 +47
Branches 89 89
===============================================
+ Hits 801 848 +47
Misses 252 252
Partials 48 48
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? |
0f5d6ed
to
d883ab3
Compare
double dt_s
argumentThere 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.
LGTM.
Thanks for the changes
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.
Rest looks good
Co-authored-by: Sai Kishor Kothakota <[email protected]>
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.
LGTM
@christophfroehlich Thank you for correcting things again and again. This is a great job. |
@saikishor one last question: do we care about adding |
If this is the case, we can remove it. It only affects the method from the rclcpp::Duration right?. If one has to use this class, they can only copy it, the rclcpp dependency is introduced from the package. If we want to leave it out, let's remove that function alone. What's your opinion on this? |
I think if someone wants to use it outside of a ROS project, then it has to be copied manually and this dependency then has to be manually removed. If it is used in a ROS project, then the rclcpp dependency is already there from the package.xml, like you said. |
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.
@christophfroehlich what do you think?
While fixing the clang errors I realized that lots of implicit casts to
computeCommand
were used, and the typical usage was to pass something likeperiod.nanoseconds()
and convert it internally to seconds. Because introducing an overload withdouble dt
as argument is ambiguous and might silently break user code, I decided to convert the class methods from camelCase to snake_case (the ros2_control standard), remove theuint64_t
version but introduce the following new overloads which converts dt to seconds in a consistent waydouble dt
rcl_duration_value_t dt_ns
rclcpp::Duration dt
std::chrono::nanoseconds dt_ns
I converted the method names of PidROS accordingly as well, but left the only
rclcpp::Duration
version there.The old methods remain deprecated, this should not break anything in downstream packages.
AFAIK adding non-virtual methods should not be a problem regarding ABI break?