Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support DXMIO #100

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Enable to dump multi-turn offset and resolution divider by info_dump.py
pazeshun committed Nov 13, 2016
commit 461389c72466775f6a1f9d3373961b97ef4aa4e8
26 changes: 26 additions & 0 deletions dynamixel_driver/scripts/info_dump.py
Original file line number Diff line number Diff line change
@@ -58,17 +58,34 @@ def print_data(values):
print '''\
Motor %(id)d is connected:
Freespin: True
Multi-Turn: False
Model ------------------- %(model)s
Current Speed ----------- %(speed)d
Current Temperature ----- %(temperature)d%(degree_symbol)sC
Current Voltage --------- %(voltage).1fv
Current Load ------------ %(load)d
Moving ------------------ %(moving)s
''' %values
elif values['multi_turn']:
print '''\
Motor %(id)d is connected:
Freespin: False
Multi-Turn: True
Model ------------------- %(model)s
Multi-Turn Offset ------- %(multi_turn_offset)d
Resolution Divider ------ %(resolution_divider)d
Current Position -------- %(position)d
Current Speed ----------- %(speed)d
Current Temperature ----- %(temperature)d%(degree_symbol)sC
Current Voltage --------- %(voltage).1fv
Current Load ------------ %(load)d
Moving ------------------ %(moving)s
''' %values
else:
print '''\
Motor %(id)d is connected:
Freespin: False
Multi-Turn: False
Model ------------------- %(model)s
Min Angle --------------- %(min)d
Max Angle --------------- %(max)d
@@ -127,8 +144,17 @@ def print_data(values):
print 'done'
if angles['max'] == 0 and angles['min'] == 0:
values['freespin'] = True
values['multi_turn'] = False
else:
values['freespin'] = False
if (DXL_MULTI_TURN_OFFSET_L in DXL_MODEL_TO_PARAMS[model]['features']) \
and angles['max'] == 4095 and angles['min'] == 4095:
values['multi_turn'] = True
values['multi_turn_offset'] = dxl_io.get_multi_turn_offset(motor_id)
values['resolution_divider'] = dxl_io.get_resolution_divider(motor_id)
else:
values['multi_turn'] = False

print_data(values)
else:
print 'error'