-
Notifications
You must be signed in to change notification settings - Fork 246
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
remove getHandle in UnitreeHW::read #71
base: master
Are you sure you want to change the base?
Conversation
handle.setFeedforward(0.); | ||
handle.setVelocityDesired(0.); | ||
handle.setKd(3.); | ||
for(size_t i=0; i<12; ++i){ |
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.
Should not be i<12
.
jointData_[i].velDes_ = jointData_[i].vel_; | ||
jointData_[i].ff_ = 0.0; | ||
jointData_[i].kp_ = 0.0; | ||
jointData_[i].kd_ = 0.0; |
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.
Better to have some damping
jointData_[i].kd_ = 3.0;
jointData_[i].posDes_ = jointData_[i].pos_; | ||
jointData_[i].velDes_ = jointData_[i].vel_; |
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 need for these two lines.
Hi, thanks for your contribution, I think you are right. I left some details comments for the code. In addition, can you use clang-format for your code with this configuration so I can merge it into the master repo? |
I would like to express my gratitude for the wonderful framework you have shared with the community. It has been instrumental in advancing my project.
I am currently working on implementing two distinct, self-defined ROS controllers to control separate groups of joints. But this would cause resource conflict in ros control manager, the error information would be like:
More details can be found in my forked version: zitongbai/bipedal_control#3
Upon further examination, I found that the calling of the
getHandle("handle_name")
function ofHybridJointInterface
would claim the "handle_name" resource, which can be referred here:https://github.com/ros-controls/ros_control/blob/6b9fd8b3605e047ae1b925857c92998074c803c4/hardware_interface/include/hardware_interface/internal/hardware_resource_manager.h#L65-L70
And I found that the
getHandle
function is called inUnitreeHW::read
, which causes all the joints resources are claimed each timeUnitreeHW::read
is invoked, no matter whether they are used in the controller:legged_control/legged_examples/legged_unitree/legged_unitree_hw/src/UnitreeHW.cpp
Lines 85 to 92 in 715cc53
Of course, it poses no issues in the context of a single controller implementation. But it will cause some trouble when attempting to operate multiple controllers concurrently, which may be essential for further development.
Furthermore, I have yet to conduct real-world experiments to validate this behavior. It would be highly beneficial to have this aspect confirmed through practical testing :)