Open manuelnt11 opened 9 years ago
-> dynamixel_io.py <-
def set_d_gain(self, servo_id, d_gain):
"""
Sets the value of derivative action of PID controller.
Gain value is in range 0 to 254.
"""
response = self.write(servo_id, DXL_D_GAIN, [d_gain])
if response:
- self.exception_on_error(response[4], servo_id, 'setting D gain value of PID controller to %d' % slope)
+ self.exception_on_error(response[4], servo_id, 'setting D gain value of PID controller to %d' % d_gain)
return response
def set_i_gain(self, servo_id, i_gain):
"""
Sets the value of integral action of PID controller.
Gain value is in range 0 to 254.
"""
response = self.write(servo_id, DXL_I_GAIN, [i_gain])
if response:
- self.exception_on_error(response[4], servo_id, 'setting I gain value of PID controller to %d' % slope)
+ self.exception_on_error(response[4], servo_id, 'setting I gain value of PID controller to %d' % i_gain)
return response
def set_p_gain(self, servo_id, p_gain):
"""
Sets the value of proportional action of PID controller.
Gain value is in range 0 to 254.
"""
response = self.write(servo_id, DXL_P_GAIN, [p_gain])
if response:
- self.exception_on_error(response[4], servo_id, 'setting P gain value of PID controller to %d' % slope)
+ self.exception_on_error(response[4], servo_id, 'setting P gain value of PID controller to %d' % p_gain)
return response
I have been working with dynamixel motors and I needed set gains like parameters in the tilt.yaml. Well, I implemented this function and may be you want to do a clear implementation in the module.
This is my changes in the python code -> joint_controller.py <-
-> joint_position_controller.py <-