Skip to content

Commit

Permalink
Fix merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
christophfroehlich committed Jul 6, 2024
1 parent a492f87 commit 84e63f7
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions gazebo_ros2_control/src/gazebo_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -766,29 +766,21 @@ hardware_interface::return_type GazeboSystem::write(
double cmd = this->dataPtr->joint_position_cmd_[j];
this->dataPtr->sim_joints_[j]->SetPosition(0, cmd, true);
this->dataPtr->sim_joints_[j]->SetVelocity(0, 0.0);

} else if (this->dataPtr->joint_control_methods_[j] & VELOCITY) {
this->dataPtr->sim_joints_[j]->SetVelocity(0, this->dataPtr->joint_velocity_cmd_[j]);

} else if (this->dataPtr->joint_control_methods_[j] & EFFORT) {
this->dataPtr->sim_joints_[j]->SetForce(0, this->dataPtr->joint_effort_cmd_[j]);
<<<<<<< HEAD

} else if (this->dataPtr->joint_control_methods_[j] & VELOCITY_PID) {
double vel_goal = this->dataPtr->joint_velocity_cmd_[j];
double vel = this->dataPtr->sim_joints_[j]->GetVelocity(0);
double cmd = this->dataPtr->vel_pid[j].computeCommand(vel_goal - vel, dt);
this->dataPtr->sim_joints_[j]->SetForce(0, cmd);

} else if (this->dataPtr->joint_control_methods_[j] & POSITION_PID) {
double pos_goal = this->dataPtr->joint_position_cmd_[j];
double pos = this->dataPtr->sim_joints_[j]->Position(0);
double cmd = this->dataPtr->pos_pid[j].computeCommand(pos_goal - pos, dt);
this->dataPtr->sim_joints_[j]->SetForce(0, cmd);
} else if (this->dataPtr->is_joint_actuated_[j]) {
=======
} else if (this->dataPtr->is_joint_actuated_[j] && this->dataPtr->hold_joints_) {
>>>>>>> 7682dce (Add `hold_joints` parameter (#251))
// Fallback case is a velocity command of zero (only for actuated joints)
this->dataPtr->sim_joints_[j]->SetVelocity(0, 0.0);
}
Expand Down

0 comments on commit 84e63f7

Please sign in to comment.