-
Notifications
You must be signed in to change notification settings - Fork 355
Revived Joint Limits Interfaces with new State and Command Interfaces #271
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
…ad of Handles. Watch out for those command handles, no longer support copying so had to move those constructor command args to std::move semantics
The joint limit interfaces is just a single include file, not even a src implementation. I could move that file and the test file into the hardware_interface module, I agree it probably belongs in there. @Karsten1987 mentioned in PR #236 :
|
@bmagyar (As per WG meeting, regarding refactor into hardware_interface): |
Signed-off-by: Colin MacKenzie <colin@flyingeinstein.com>
@bmagyar |
Other than test dep issue above, migration of joint_limits_interface into hardware_interface is complete. No significant changes in the API. The joint_limits include files, though moved into hardware_interface, are still in "joint_limits_interface/" include directory so no code changes for users are required other than dump the joint_limits_interface package ref. As for tests, (1) they were converted to gmock instead of gtest to match other hardware_interface tests. (2) The rclcpp package dep had to be included for BUILD_TESTING for a unit tests that actually creates a rclcpp::Node for testing parameters. (3) The urdf package was added to main deps since joint_limits includes urdf parsing. |
@bmagyar we have to rethink this architecture since we do not have "joints" anymore. Probably is this something for ResourceManager |
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.
Good job @guru-florida
I added many comments because it is unclear to me how this would work with the new "component-base" architecture.
Before merging there should be test using test_single_joint_actuator
and test_two_joint_system
testing the integration and also an example in the ros2_control_demos
repository, where we test the whole framework.
Other suggestions/questions:
- Maybe to move
JointLimits-README.md
into corresponding include folder` - @bmagyar can we remove
author
tag from joint_limits.hpp since we don't have it in other files... - Why is there file
joint_limits_rosparam.hpp
, should we allow to set the limits using URDF and parameter server? I find this rather ambiguous...
hardware_interface/include/joint_limits_interface/joint_limits_interface.hpp
Outdated
Show resolved
Hide resolved
hardware_interface/include/joint_limits_interface/joint_limits_interface.hpp
Show resolved
Hide resolved
hardware_interface/include/joint_limits_interface/joint_limits_interface.hpp
Outdated
Show resolved
Hide resolved
hardware_interface/include/joint_limits_interface/joint_limits_interface.hpp
Outdated
Show resolved
Hide resolved
hardware_interface/include/joint_limits_interface/joint_limits_interface.hpp
Outdated
Show resolved
Hide resolved
hardware_interface/include/joint_limits_interface/joint_limits_interface.hpp
Outdated
Show resolved
Hide resolved
hardware_interface/test/joint_limits/joint_limits_interface_test.cpp
Outdated
Show resolved
Hide resolved
hardware_interface/test/joint_limits/joint_limits_interface_test.cpp
Outdated
Show resolved
Hide resolved
@@ -28,7 +28,8 @@ class JointLimitsRosParamTest : public ::testing::Test | |||
void SetUp() | |||
{ | |||
rclcpp::NodeOptions node_options; | |||
node_options.allow_undeclared_parameters(true) | |||
node_options | |||
.allow_undeclared_parameters(true) |
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 new line?
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 is using method chaining. Notice no semicolon on the end of line 32....there is another .method() call below it. Read better to me to have the multiple .method() chain calls indented to match and it passed clint/uncrustify.
Changes with interface names using constants. Use of quiet_NaN. Some find_package reordering. Co-authored-by: Denis Štogl <destogl@users.noreply.github.com>
@guru-florida did you have time to integrate this with hardware_interface instead? I think this could be closed at this point as we agreed not to have this package separately |
I am updating my own code to use RM/CM now. Let me revisit this again before closing. I am still catching up to the current way of things.
|
@guru-florida can you please enable "Allow edits and access to secrets by maintainers" box (on the bottom of the right-options of the PR). I would like to push changes directly to your branch. |
I have "Allow edits by maintainers" checked already. There is no "Allow edits and access to secrets...". Apparently that is only when there are GitHub Actions workflows. I'm not sure. It looks like you did get changed pushed here though, I see your HW interface constant changes.
|
#441 is the follow-up |
Using new hardware_interface::StateInterface and CommandInterface instead of the old JointHandle class. Mostly a search and replace process at first, but CommandInterface has one surprise where the copy constructor is deleted in favor of always moving. So for command arguments the "const CommandInterface&" becomes "CommandInterface &&" and std::move() is used in implementation.
The switch to move semantics also invalidates all the tests though since the tests would create a command handle in the test fixture which cannot become a && argument. So I switched the fixture to use inline command_handle() methods to retrieve a command handle which can then be directly passed as an argument to the limit constructors.