Skip to content

Commit

Permalink
Forced zero vel in position mode to avoid sagging (#213) (#214)
Browse files Browse the repository at this point in the history
(cherry picked from commit 3e95061)

Co-authored-by: gwalck <[email protected]>
  • Loading branch information
mergify[bot] and gwalck authored Jun 23, 2023
1 parent cbaa8ae commit 0147844
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions gazebo_ros2_control/src/gazebo_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,7 @@ hardware_interface::return_type GazeboSystem::write(
if (this->dataPtr->sim_joints_[j]) {
if (this->dataPtr->joint_control_methods_[j] & POSITION) {
this->dataPtr->sim_joints_[j]->SetPosition(0, this->dataPtr->joint_position_cmd_[j], true);
this->dataPtr->sim_joints_[j]->SetVelocity(0, 0.0);
} else if (this->dataPtr->joint_control_methods_[j] & VELOCITY) { // NOLINT
this->dataPtr->sim_joints_[j]->SetVelocity(0, this->dataPtr->joint_velocity_cmd_[j]);
} else if (this->dataPtr->joint_control_methods_[j] & EFFORT) { // NOLINT
Expand Down

0 comments on commit 0147844

Please sign in to comment.