For dynamixel motors, there is a moving register :
‘moving’: {
‘address’: 0x31,
‘length’: 1,
‘access’: _DxlAccess.readonly,
‘dxl_to_si’: conv.dxl_to_bool,
‘getter_name’: ‘is_moving’
According to documentation, this register can be used to know when the movement is finish (which can be really useful). Is there a reason explaining why this register is not synced ?
The moving register seems to work correctly :
robot.m11.moving_speed = 50
dxl_io=robot._controllers[0].io
robot.m11.goal_position = 0
t0 = time.time()
while dxl_io.is_moving((11,))[0]:
time.sleep(0.01)
t1 = time.time()
print('temps pour atteindre la position : %f' % (t1-t0))
> Out :
temps pour atteindre la position : 2.535064
hummm… After more tests, this register seems to be not totaly stable, sometimes send nothing and sometimes a True when the motor is not moving…
is_moving seems to be something like “there is current in the motor”, and it can happened just because there is a torque on the motor and not a movememt, so not really useful to know when the desire movement is done
So to know when the movement is done, just compared goal and present with a tolerance depending on the PID you have.