Skip to content

Commit

Permalink
Enable to dump multi-turn offset and resolution divider by info_dump.py
Browse files Browse the repository at this point in the history
  • Loading branch information
pazeshun committed Nov 13, 2016
1 parent d122b36 commit 461389c
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions dynamixel_driver/scripts/info_dump.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'
Expand Down

0 comments on commit 461389c

Please sign in to comment.