-
Notifications
You must be signed in to change notification settings - Fork 99
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
Fixed velocity controller #450
Conversation
Signed-off-by: Alejandro Hernández Cordero <[email protected]>
@azeey do you know why the this is not happening with position and effort |
gz_ros2_control/src/gz_system.cpp
Outdated
@@ -654,7 +654,7 @@ hardware_interface::return_type GazeboSimSystem::write( | |||
{ | |||
this->dataPtr->ecm->CreateComponent( | |||
this->dataPtr->joints_[i].sim_joint, | |||
sim::components::JointVelocityCmd({0})); | |||
sim::components::JointVelocityCmd({this->dataPtr->joints_[i].joint_velocity_cmd})); |
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 can be simplified by using the SetComponentData
function, so it would just look like:
this->dataPtr->ecm->SetComponentData(this->dataPtr->joints_[i].sim_joint, {this->dataPtr->joints_[i].sim_joint})
replacing the entire if/else block starting with if (!this->dataPtr->ecm->Component<sim::components::JointVelocityCmd>( this->dataPtr->joints_[i].sim_joint))
Signed-off-by: Alejandro Hernández Cordero <[email protected]>
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.
Just testing a PR I noticed that velocity controllers were not working. I made this quick fix but I'm not sure if this will break other users
@christophfroehlich any thoughts?