-
Notifications
You must be signed in to change notification settings - Fork 169
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?
Conversation
cdce937
to
f2797e3
Compare
14f9060
to
461389c
Compare
Tested with MX-28R |
|
@arebgun Please review this |
@@ -935,6 +1013,8 @@ def get_feedback(self, servo_id): | |||
# extract data values from the raw data | |||
goal = response[5] + (response[6] << 8) | |||
position = response[11] + (response[12] << 8) | |||
if position & 0x8000: |
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:
if goal & 0x8000:
goal += -0x10000
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!
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
why not check DXL_MODEL_TO_PARAMS
on model_number
to see if multi-turn is supported rather than relying on this try .. except
?
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.
I think checking DXL_MODEL_TO_PARAMS
should only be in lowest layer (ex. get_resolution_divider
) for simplicity.
I've successfully tested this on the MX-12W, thank you @pazeshun ! |
@dbolkensteyn Thanks for review! I fixed goal of feedback. |
What I did