remove getHandle in UnitreeHW::read#71
Open
zitongbai wants to merge 1 commit into
Open
Conversation
qiayuanl
requested changes
Aug 24, 2024
| handle.setFeedforward(0.); | ||
| handle.setVelocityDesired(0.); | ||
| handle.setKd(3.); | ||
| for(size_t i=0; i<12; ++i){ |
| jointData_[i].velDes_ = jointData_[i].vel_; | ||
| jointData_[i].ff_ = 0.0; | ||
| jointData_[i].kp_ = 0.0; | ||
| jointData_[i].kd_ = 0.0; |
Owner
There was a problem hiding this comment.
Better to have some damping
jointData_[i].kd_ = 3.0;
Comment on lines
+87
to
+88
| jointData_[i].posDes_ = jointData_[i].pos_; | ||
| jointData_[i].velDes_ = jointData_[i].vel_; |
Owner
|
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? |
This was referenced Oct 6, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 ofHybridJointInterfacewould 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
getHandlefunction is called inUnitreeHW::read, which causes all the joints resources are claimed each timeUnitreeHW::readis 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 :)