@@ -246,10 +246,10 @@ bool IgnitionSystem::initSim(
246
246
this ->dataPtr ->ecm ->Component <ignition::gazebo::components::JointAxis>(
247
247
this ->dataPtr ->joints_ [j].sim_joint );
248
248
// PID parameters
249
- double p_gain = 100.0 ;
250
- double i_gain = 1 .0 ;
251
- double d_gain = 50 .0 ;
252
- // set integral max and min component to 10 percent of the max effort
249
+ double p_gain = 10.0 * jointAxis-> Data (). Effort () ;
250
+ double i_gain = 0 .0 ;
251
+ double d_gain = 0 .0 ;
252
+ // set integral max and min component to 50 percent of the max effort
253
253
double iMax = std::isnan (jointAxis->Data ().Effort ()) ? 500.0 : jointAxis->Data ().Effort () *
254
254
0.5 ;
255
255
double iMin = std::isnan (jointAxis->Data ().Effort ()) ? 500.0 : -jointAxis->Data ().Effort () *
@@ -710,14 +710,13 @@ hardware_interface::return_type IgnitionSystem::write(
710
710
this ->dataPtr ->joints_ [i].joint_position_cmd , jointAxis->Data ().Lower (),
711
711
jointAxis->Data ().Upper ());
712
712
713
- // error can be maximal 10 percent of the range
714
713
error =
715
714
copysign (
716
715
1.0 ,
717
716
error) *
718
717
std::clamp (
719
718
std::abs (error), 0.0 ,
720
- std::abs (jointAxis->Data ().Upper () - jointAxis->Data ().Lower ()) * 0.1 );
719
+ std::abs (jointAxis->Data ().Upper () - jointAxis->Data ().Lower ()));
721
720
722
721
// calculate target force/torque
723
722
double target_force = this ->dataPtr ->joints_ [i].pid .Update (
@@ -791,11 +790,10 @@ hardware_interface::return_type IgnitionSystem::write(
791
790
position_mimicked_joint * mimic_joint.multiplier ,
792
791
jointAxis->Data ().Lower (), jointAxis->Data ().Upper ());
793
792
794
- // error can be maximal 10 percent of the range
795
793
position_error = copysign (1.0 , position_error) * std::clamp (
796
794
std::abs (
797
795
position_error), 0.0 , std::abs (
798
- jointAxis->Data ().Upper () - jointAxis->Data ().Lower ()) * 0.1 );
796
+ jointAxis->Data ().Upper () - jointAxis->Data ().Lower ()));
799
797
800
798
// calculate target force/torque
801
799
double target_force = this ->dataPtr ->joints_ [mimic_joint.joint_index ].pid .Update (
0 commit comments