-
Notifications
You must be signed in to change notification settings - Fork 12
Bump 1.4.8 #55
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
Bump 1.4.8 #55
Conversation
Signed-off-by: Hyungyu Kim <[email protected]>
add rosdep ci
…namixel model list
…ToBulkWrite for varying item sizes
…rite configurations
…ion write for OMY sync table
…features and synchronization improvements
Add new model configuration for OMY end tool
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.
Summary of Changes
Hello @Woojin-Crive, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request updates the dynamixel_hardware_interface package to version 1.4.8. The primary focus is on introducing a new Dynamixel model for OMY, enhancing the underlying communication mechanisms to support more flexible data writing via sync/bulk operations, and implementing a crucial goal position synchronization step before enabling torque, which is essential for the OMY sync table feature.
Highlights
- Version Bump: The package version has been incremented from
1.4.7to1.4.8inpackage.xmlandCHANGELOG.rst, reflecting the new features and improvements. - New Dynamixel Model for OMY: A new Dynamixel model,
omy_end_rh_p12_rn.model, has been introduced and registered indynamixel.model(ID 231). This new model appears to consolidatetype infoandcontrol tableparameters previously defined inomy_end.model, streamlining model definitions and supporting virtual DXL. - Enhanced Communication Protocol: The
SetDxlValueToSyncWriteandSetDxlValueToBulkWritemethods insrc/dynamixel/dynamixel.cpphave been generalized. They now support writing various data types (1, 2, or 4 bytes) for indirect addressing, moving beyond justgoal_current. This enhancement provides greater flexibility for features like virtual DXL and sync tables. - Goal Position Synchronization Before Torque Enable: In
src/dynamixel_hardware_interface.cpp, the initialization sequence within thestart()method has been adjusted. Goal positions are now synchronized (CalcJointToTransmission()andWriteMultiDxlData()) before torque is enabled, which is a critical step for the OMY sync table feature. A 500ms sleep was also removed. - Indirect Addressing for OMY_HAT Model: The
omy_hat.modeldefinition has been updated to include new indirect address and data entries for both write and read operations, further enabling advanced communication patterns for this specific model.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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.
Code Review
This pull request bumps the package version to 1.4.8 and introduces a new model for OMY to support virtual_dxl, along with synchronizing goal position before enabling torque. A critical issue was found in param/dxl_model/omy_hat.model where new control table entries have conflicting addresses with existing ones. A medium maintainability issue was found in src/dynamixel/dynamixel.cpp due to duplicated code for data serialization in SetDxlValueToSyncWrite and SetDxlValueToBulkWrite. Refactoring into a helper function is recommended.
| 112 2 Indirect Address Write | ||
| 816 1 Indirect Data Write |
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.
The Indirect Address Write at address 112 conflicts with Indirect Address at the same address on line 20. Similarly, Indirect Data Write at address 816 on line 37 conflicts with Indirect Data at the same address on line 35. Verify the correct addresses for these new items and ensure there are no address conflicts.
| } else { | ||
| if (indirect_info_write_[comm_id].item_size.at(item_index) == 4) { | ||
| int32_t value = static_cast<int32_t>(data); | ||
| param_write_value[added_byte + 0] = DXL_LOBYTE(DXL_LOWORD(value)); | ||
| param_write_value[added_byte + 1] = DXL_HIBYTE(DXL_LOWORD(value)); | ||
| param_write_value[added_byte + 2] = DXL_LOBYTE(DXL_HIWORD(value)); | ||
| param_write_value[added_byte + 3] = DXL_HIBYTE(DXL_HIWORD(value)); | ||
| } else if (indirect_info_write_[comm_id].item_size.at(item_index) == 2) { | ||
| int16_t value = static_cast<int16_t>(data); | ||
| param_write_value[added_byte + 0] = DXL_LOBYTE(value); | ||
| param_write_value[added_byte + 1] = DXL_HIBYTE(value); | ||
| } else if (indirect_info_write_[comm_id].item_size.at(item_index) == 1) { | ||
| param_write_value[added_byte] = static_cast<uint8_t>(data); | ||
| } | ||
| } |
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.
This block of code for packing data into the write buffer is duplicated in SetDxlValueToBulkWrite() (lines 2070-2084). Consider extracting this logic into a private helper function to improve maintainability and reduce redundancy. A switch statement could be cleaner here than a series of if-else if statements.
} else {
switch (indirect_info_write_[comm_id].item_size.at(item_index)) {
case 4: {
int32_t value = static_cast<int32_t>(data);
param_write_value[added_byte + 0] = DXL_LOBYTE(DXL_LOWORD(value));
param_write_value[added_byte + 1] = DXL_HIBYTE(DXL_LOWORD(value));
param_write_value[added_byte + 2] = DXL_LOBYTE(DXL_HIWORD(value));
param_write_value[added_byte + 3] = DXL_HIBYTE(DXL_HIWORD(value));
break;
}
case 2: {
int16_t value = static_cast<int16_t>(data);
param_write_value[added_byte + 0] = DXL_LOBYTE(value);
param_write_value[added_byte + 1] = DXL_HIBYTE(value);
break;
}
case 1: {
param_write_value[added_byte] = static_cast<uint8_t>(data);
break;
}
}
}| } else { | ||
| if (indirect_info_write_[comm_id].item_size.at(item_index) == 4) { | ||
| int32_t value = static_cast<int32_t>(data); | ||
| param_write_value[added_byte + 0] = DXL_LOBYTE(DXL_LOWORD(value)); | ||
| param_write_value[added_byte + 1] = DXL_HIBYTE(DXL_LOWORD(value)); | ||
| param_write_value[added_byte + 2] = DXL_LOBYTE(DXL_HIWORD(value)); | ||
| param_write_value[added_byte + 3] = DXL_HIBYTE(DXL_HIWORD(value)); | ||
| } else if (indirect_info_write_[comm_id].item_size.at(item_index) == 2) { | ||
| int16_t value = static_cast<int16_t>(data); | ||
| param_write_value[added_byte + 0] = DXL_LOBYTE(value); | ||
| param_write_value[added_byte + 1] = DXL_HIBYTE(value); | ||
| } else if (indirect_info_write_[comm_id].item_size.at(item_index) == 1) { | ||
| param_write_value[added_byte] = static_cast<uint8_t>(data); | ||
| } | ||
| } |
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.
No description provided.