-
Notifications
You must be signed in to change notification settings - Fork 168
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
[dynamixel_driver] Support for Multi-turn Mode #68
base: master
Are you sure you want to change the base?
Changes from all commits
59f16d1
d357809
d122b36
461389c
bdf9bd8
d90a619
6d64678
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -136,6 +136,13 @@ def __fill_motor_parameters(self, motor_id, model_number): | |
encoder_resolution = DXL_MODEL_TO_PARAMS[model_number]['encoder_resolution'] | ||
range_degrees = DXL_MODEL_TO_PARAMS[model_number]['range_degrees'] | ||
range_radians = math.radians(range_degrees) | ||
if angles['max'] == 4095 and angles['min'] == 4095: # In multi-turn mode if the servo is MX motor | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why not check There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think checking |
||
try: | ||
resolution_divider = self.dxl_io.get_resolution_divider(motor_id) | ||
range_degrees = (range_degrees / encoder_resolution) * resolution_divider * DXL_MULTI_TURN_RANGE_TICK | ||
range_radians = math.radians(range_degrees) | ||
encoder_resolution = DXL_MULTI_TURN_RANGE_TICK | ||
except dynamixel_io.UnsupportedFeatureError: pass # The servo is not MX motor | ||
rospy.set_param('dynamixel/%s/%d/encoder_resolution' %(self.port_namespace, motor_id), encoder_resolution) | ||
rospy.set_param('dynamixel/%s/%d/range_degrees' %(self.port_namespace, motor_id), range_degrees) | ||
rospy.set_param('dynamixel/%s/%d/range_radians' %(self.port_namespace, motor_id), range_radians) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
likewise, you need this just above:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!