[dynamixel_driver] Support for Multi-turn Mode#68
Open
pazeshun wants to merge 7 commits intoarebgun:masterfrom
Open
[dynamixel_driver] Support for Multi-turn Mode#68pazeshun wants to merge 7 commits intoarebgun:masterfrom
pazeshun wants to merge 7 commits intoarebgun:masterfrom
Conversation
cdce937 to
f2797e3
Compare
14f9060 to
461389c
Compare
Contributor
Author
|
Tested with MX-28R |
Contributor
Author
|
Contributor
Author
|
@arebgun Please review this |
| # extract data values from the raw data | ||
| goal = response[5] + (response[6] << 8) | ||
| position = response[11] + (response[12] << 8) | ||
| if position & 0x8000: |
Contributor
There was a problem hiding this comment.
likewise, you need this just above:
if goal & 0x8000:
goal += -0x10000
| 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 |
Contributor
There was a problem hiding this comment.
why not check DXL_MODEL_TO_PARAMS on model_number to see if multi-turn is supported rather than relying on this try .. except?
Contributor
Author
There was a problem hiding this comment.
I think checking DXL_MODEL_TO_PARAMS should only be in lowest layer (ex. get_resolution_divider) for simplicity.
Contributor
|
I've successfully tested this on the MX-12W, thank you @pazeshun ! |
Contributor
Author
|
@dbolkensteyn Thanks for review! I fixed goal of feedback. |
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What I did