@@ -240,7 +240,7 @@ bool GazeboSystem::extractPID(
240
240
<< " max_integral_error = " << max_integral_error << " \t "
241
241
<< " antiwindup =" << std::boolalpha << antiwindup);
242
242
243
- pid.initPid (kp, ki, kd, max_integral_error, min_integral_error, antiwindup);
243
+ pid.initialize (kp, ki, kd, max_integral_error, min_integral_error, antiwindup);
244
244
}
245
245
return are_pids_set;
246
246
}
@@ -306,7 +306,7 @@ bool GazeboSystem::extractPIDFromParameters(
306
306
<< " kd = " << kd << " \t "
307
307
<< " max_integral_error = " << max_integral_error << " \t "
308
308
<< " antiwindup =" << std::boolalpha << antiwindup << " from node parameters" );
309
- pid.initPid (kp, ki, kd, max_integral_error, min_integral_error, antiwindup);
309
+ pid.initialize (kp, ki, kd, max_integral_error, min_integral_error, antiwindup);
310
310
}
311
311
312
312
return are_pids_set;
@@ -815,8 +815,6 @@ hardware_interface::return_type GazeboSystem::write(
815
815
this ->dataPtr ->joint_position_ [mimic_joint.mimicked_joint_index ];
816
816
}
817
817
818
- uint64_t dt = sim_period.nanoseconds ();
819
-
820
818
for (unsigned int j = 0 ; j < this ->dataPtr ->joint_names_ .size (); j++) {
821
819
if (this ->dataPtr ->sim_joints_ [j]) {
822
820
if (this ->dataPtr ->joint_control_methods_ [j] & POSITION) {
@@ -833,13 +831,13 @@ hardware_interface::return_type GazeboSystem::write(
833
831
} else if (this ->dataPtr ->joint_control_methods_ [j] & VELOCITY_PID) {
834
832
double vel_goal = this ->dataPtr ->joint_velocity_cmd_ [j];
835
833
double vel = this ->dataPtr ->sim_joints_ [j]->GetVelocity (0 );
836
- double cmd = this ->dataPtr ->vel_pid [j].computeCommand (vel_goal - vel, dt );
834
+ double cmd = this ->dataPtr ->vel_pid [j].compute_command (vel_goal - vel, sim_period );
837
835
this ->dataPtr ->sim_joints_ [j]->SetForce (0 , cmd);
838
836
839
837
} else if (this ->dataPtr ->joint_control_methods_ [j] & POSITION_PID) {
840
838
double pos_goal = this ->dataPtr ->joint_position_cmd_ [j];
841
839
double pos = this ->dataPtr ->sim_joints_ [j]->Position (0 );
842
- double cmd = this ->dataPtr ->pos_pid [j].computeCommand (pos_goal - pos, dt );
840
+ double cmd = this ->dataPtr ->pos_pid [j].compute_command (pos_goal - pos, sim_period );
843
841
this ->dataPtr ->sim_joints_ [j]->SetForce (0 , cmd);
844
842
845
843
} else if (this ->dataPtr ->is_joint_actuated_ [j] && this ->dataPtr ->hold_joints_ ) {
0 commit comments