Skip to content

Commit 94a6c4a

Browse files
committed
Kd is unstable
1 parent 57a8a08 commit 94a6c4a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

ign_ros2_control/src/ign_system.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -362,9 +362,9 @@ bool IgnitionSystem::initSim(
362362
registerSensors(hardware_info);
363363

364364
// Initialize PID controllers for converting position commands to Gazebo joint velocities
365-
double proportional_gain = 1.0;
366-
double integral_gain = 0.1;
367-
double derivative_gain = 0.1;
365+
double proportional_gain = 10.0;
366+
double integral_gain = 1.0;
367+
double derivative_gain = 0.0;
368368
this->dataPtr->joint_position_pids_.resize(this->dataPtr->n_dof_);
369369
for (unsigned int j = 0; j < this->dataPtr->n_dof_; j++) {
370370
const std::string joint_name = this->dataPtr->joints_[j].name;
@@ -387,7 +387,9 @@ bool IgnitionSystem::initSim(
387387
"The position_integral_gain parameter was not defined for joint " << joint_name <<
388388
", defaulting to: " << integral_gain);
389389
}
390-
390+
// TODO(andyz): a nonzero derivative gain seems to be destabilizing. Investigate in the
391+
// control_toolbox.
392+
/*
391393
if (!this->nh_->get_parameter_or(
392394
joint_name + "/position_derivative_gain", derivative_gain,
393395
derivative_gain))
@@ -397,7 +399,7 @@ bool IgnitionSystem::initSim(
397399
"The position_derivative_gain parameter was not defined for joint " << joint_name <<
398400
", defaulting to: " << derivative_gain);
399401
}
400-
402+
*/
401403
this->dataPtr->joint_position_pids_.at(j) = control_toolbox::Pid(
402404
proportional_gain,
403405
integral_gain,

0 commit comments

Comments
 (0)