-
Notifications
You must be signed in to change notification settings - Fork 427
Check robot description validity on AdmittanceController and test for it #2009
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
base: master
Are you sure you want to change the base?
Conversation
christophfroehlich
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.
Thank you for taking this. I have some doubts if this is tested properly, see the comments
|
|
||
| #include "admittance_controller/admittance_controller.hpp" | ||
|
|
||
| #include <tinyxml2.h> |
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.
we'll need to add this as dependency (do we need to link against in the Cmake file?)
https://github.com/ros/urdfdom/blob/973baf479512b0b34951b3d5ebb616c22990d781/package.xml#L20
| reference_admittance_ = last_reference_; | ||
| joint_state_ = last_reference_; | ||
|
|
||
| std::string robot_description = get_node()->get_parameter("robot_description").as_string(); |
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'm not sure about this. The admittance controller doesn't use the robot_description parameter, but uses this->get_robot_description() from controller_interface_base since #1247. We should use this here as well obviously.
For the tests, you have to set controller_->robot_description_ to override this.
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.
worst case we may have some work left to refactor on this controller to use the URDF we pass to the controller, we shouldn't fetch a param: https://github.com/ros-controls/ros2_control/pull/1088/files
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.
as i've seen we don't parse it as a parameter any more, that's only a remnant in the tests
| get_node()->declare_parameter("robot_description", rclcpp::ParameterType::PARAMETER_STRING); | ||
| get_node()->set_parameter({"robot_description", robot_description_}); | ||
| } | ||
| if (!get_node()->has_parameter("robot_description_semantic")) |
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 think this can be deleted, I don't find any usage of robot_description_semantic?
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.
L393-394 has commented code regarding robot_description, this should also be deleted.
|
Thinking again, is there really a need to check this inside the controller? The controller manager will not start with a broken urdf, right @saikishor ? |
saikishor
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.
I agree with @christophfroehlich that this is not needed as CM provides a valid one.
Can you explain to us, why did you have a need to do this?
|
see the linked issue, but this was before we passed the robot description from the cm to the controllers. sorry for not checking that earlier. @caio-freitas would you mind in reverting this and cleanup the tests as by my comments instead? |
Fix #713
test_admittance_controller.cpp.on_initontest_admittance_controller.hppto only override the robot description with the one defined in theros2_control_test_assetsif not already defined.ros2_control/hardware_interface/src/component_parser.cpp(here)