-
Notifications
You must be signed in to change notification settings - Fork 405
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
[WIP] Enforce joint limits #223
base: master
Are you sure you want to change the base?
Conversation
ur_robot_driver/include/ur_robot_driver/ros/hardware_interface.h
Outdated
Show resolved
Hide resolved
I'll let @fmauch do the detailed review, but two high-level comments:
Edit: looks like the |
Yes from the boilerplate. There are very few examples out there :) |
Then we should mention that somewhere. It might even be a good idea to put that code in a separate |
Will you do that @ipa-hsd ? (just making sure) |
Yes working on it. |
All checks passed, but not tested yet and updating as per @gavanderhoorn's comments. |
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.
This roughly looks quite good.
Because of the missing vector initialization I cannot test this currently, but I'll be happy to test this once that's done.
std::size_t joint_id) | ||
{ | ||
// Default values | ||
joint_position_lower_limits_[joint_id] = -std::numeric_limits<double>::max(); |
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 far as I can see, this vector doesn't get resized anywhere, which would making this call illegal.
bool has_soft_limits = false; | ||
|
||
// Get limits from URDF | ||
if (urdf_model_ == NULL) |
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.
if (urdf_model_ == NULL) | |
if (urdf_model_ == nullptr) |
urdf::JointConstSharedPtr urdf_joint = urdf_model_->getJoint(joint_names_[joint_id]); | ||
|
||
// Get main joint limits | ||
if (urdf_joint == NULL) |
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.
if (urdf_joint == NULL) | |
if (urdf_joint == nullptr) |
if (urdf_joint->type != urdf::Joint::CONTINUOUS) | ||
ROS_WARN_STREAM("Joint " << joint_names_[joint_id] | ||
<< " does not have a URDF " | ||
"position limit"); |
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.
This isn't only referring to position limits, right? We could change the output that no limits are configured for that joint in the URDF.
{ | ||
ROS_INFO_STREAM("Waiting for model URDF on the ROS param server at location: " << nh.getNamespace() | ||
<< param_name); | ||
nh.getParam(param_name, urdf_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.
This block doesn't make sense to me. In which situation should searchParam
fail but getParam
work? Am I missing anything?
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.
You are right. Removed it for the next commit.
@ipa-hsd Any plans / resources to continue this? |
@fmauch sorry for the delay. Was occupied last week. I have separated the code from the boilerplate example in a separate file. Please take a look if that make sense because I have not made it as a separate class, but just a separate @gavanderhoorn I have also added the original license from the example. |
* \brief Applies joint limits & soft joint limits on position, velocity & effort defined in URDF / parameter server | ||
* | ||
*/ | ||
void registerJointLimits(ros::NodeHandle& robot_hw_nh, const hardware_interface::JointHandle& joint_handle_position, |
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.
Does this function apply the limits or register the limits? I guess, the docstring needs to be adapted.
@@ -72,6 +75,9 @@ bool HardwareInterface::init(ros::NodeHandle& root_nh, ros::NodeHandle& robot_hw | |||
std::string output_recipe_filename; | |||
std::string input_recipe_filename; | |||
|
|||
// Load URDF file from parameter server | |||
loadURDF(robot_hw_nh, "robot_description"); |
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.
This should probably be the root_nh
*********************************************************************/ | ||
|
||
/* Author: Dave Coleman | ||
Desc: Helper ros_control hardware interface that loads configurations |
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 a note where this file comes from and that you added modifications to it (if you did) might be nice to add here.
@ipa-hsd: would you see a chance to finish this? |
Any idea about:
|
@ipa-hsd: could be ros-infrastructure/answers.ros.org#209. |
The checks look good now. |
What's the status on this? |
This PR hasn't made any progress for quite some time and will be closed soon. Please comment if it is still relevant. |
though not being updated in a while, this topic is still important. |
This PR hasn't made any progress for quite some time and will be closed soon. Please comment if it is still relevant. |
Related to #198
[WIP] since have not tested.