Skip to content

Conversation

@Woojin-Crive
Copy link
Member

No description provided.

@Woojin-Crive Woojin-Crive added the bump Increase the version number to release label Jul 23, 2025
@github-project-automation github-project-automation bot moved this to 🌱 Todo in Platform Jul 23, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 significantly enhances the dynamixel_hardware_interface by introducing robust support for Dynamixel motors with varying firmware versions. The core change enables the system to automatically load the correct control table definitions based on a motor's firmware, ensuring compatibility and correct operation across different hardware revisions. This is achieved through new firmware-specific model files, updates to existing ones, and a new mechanism for dynamic model file selection. Additionally, a new utility script is provided to maintain the formatting of these model definition files.

Highlights

  • Firmware-aware Model Selection: Implemented logic to dynamically select the correct Dynamixel model file based on the detected firmware version of the motor. This addresses cases where control table addresses or other parameters vary between firmware revisions for the same hardware model.
  • New Firmware-Specific Model Files: Added specific model files (e.g., *_fw52.model) for certain Dynamixel models (XC330, XL330 series) to support different control table layouts found in older firmware versions.
  • Model File Updates and Corrections: Updated existing base model files for XC330 and XL330 series to reflect changes in indirect data addresses, fixed typos (Hybrid Saveve to Hybrid Save) in YM070/YM080 series models, and expanded error code history entries for ym080_230_b001.model.
  • Model File Formatting Tool: Introduced a new Python script (scripts/check_model_file_formatting.py) to ensure consistency in .model file formatting, checking for trailing spaces, EOF newlines, and excessive empty lines, with an option to auto-fix.
  • API Enhancements: Added new C++ methods in dynamixel.hpp and dynamixel_info.hpp to support reading firmware versions and handling firmware-specific model file loading, including overloads for ReadDxlModelFile and new functions like ReadFirmwareVersion, SelectModelFileByFirmwareVersion, ExtractFirmwareVersionFromFilename, and GetModelName.
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 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 or fill out our survey 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

  1. 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.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 introduces support for firmware version-aware model file selection, which is a great enhancement for handling different Dynamixel firmware versions. The changes include updates to the C++ code to read firmware versions and select appropriate model files, new model files for specific firmware, and a new Python script for checking model file formatting.

I've identified a couple of areas for improvement:

  • In src/dynamixel/dynamixel_info.cpp, the logic for selecting the model file can be made more efficient and readable.
  • The new Python script scripts/check_model_file_formatting.py has a mismatch between its documentation and implementation regarding line ending checks.

Overall, this is a solid contribution. Addressing these points will improve the code's quality and maintainability.

Comment on lines +23 to +25
1. Trailing spaces on lines
2. Proper EOF (End of File) placement
3. Consistent line endings
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The docstring mentions that the script checks for "Consistent line endings", but this functionality is not implemented in the check_file_formatting function. The documentation should be updated to reflect the actual capabilities of the script, or the feature should be implemented.

Comment on lines +273 to +284
for (const auto & fw_file : available_firmware_versions) {
uint8_t fw_version = ExtractFirmwareVersionFromFilename(fw_file);
if (fw_version > highest_fw_version) {
highest_fw_version = fw_version;
highest_fw_file = fw_file;
}
if (fw_version <= firmware_version &&
fw_version > ExtractFirmwareVersionFromFilename(selected_file))
{
selected_file = fw_file;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The logic in this loop can be simplified for better readability and efficiency.

  • The variable highest_fw_file is declared but never used.
  • The call to ExtractFirmwareVersionFromFilename(selected_file) inside the loop is inefficient as it re-parses the filename on each iteration.

A better approach would be to store the version of the selected file in a variable and update it along with selected_file.

  std::string selected_file = base_model_name;  // Default to base model
  uint8_t selected_fw_version = 0;
  int highest_fw_version = -1;

  for (const auto & fw_file : available_firmware_versions) {
    uint8_t fw_version = ExtractFirmwareVersionFromFilename(fw_file);
    if (fw_version > highest_fw_version) {
      highest_fw_version = fw_version;
    }
    if (fw_version <= firmware_version && fw_version > selected_fw_version) {
      selected_file = fw_file;
      selected_fw_version = fw_version;
    }
  }

Comment on lines +61 to +72
156 1 Error Code History 3
157 1 Error Code History 4
158 1 Error Code History 5
159 1 Error Code History 6
160 1 Error Code History 7
161 1 Error Code History 8
162 1 Error Code History 9
163 1 Error Code History 10
164 1 Error Code History 11
165 1 Error Code History 12
166 1 Error Code History 13
167 1 Error Code History 14
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The error code history entries are not sequential. It jumps from Error Code History 2 to Error Code History 15. Consider reordering these entries to ensure they are sequential for better readability and maintainability.

Comment on lines +69 to +73
224 1 Indirect Data 1
168 2 Indirect Address Write
208 1 Indirect Data Write
224 1 Indirect Data Write
180 2 Indirect Address Read
214 1 Indirect Data Read
230 1 Indirect Data Read
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The addresses for Indirect Data 1, Indirect Data Write, and Indirect Data Read have been changed from 208, 208, and 214 to 224, 224, and 230 respectively. Ensure that these changes are intentional and align with the updated memory map for the device.

Comment on lines +69 to +73
224 1 Indirect Data 1
168 2 Indirect Address Write
208 1 Indirect Data Write
224 1 Indirect Data Write
180 2 Indirect Address Read
214 1 Indirect Data Read
230 1 Indirect Data Read
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The addresses for Indirect Data 1, Indirect Data Write, and Indirect Data Read have been changed from 208, 208, and 214 to 224, 224, and 230 respectively. Ensure that these changes are intentional and align with the updated memory map for the device.

Comment on lines +71 to +75
224 1 Indirect Data 1
168 2 Indirect Address Write
208 1 Indirect Data Write
224 1 Indirect Data Write
180 2 Indirect Address Read
214 1 Indirect Data Read
230 1 Indirect Data Read
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The addresses for Indirect Data 1, Indirect Data Write, and Indirect Data Read have been changed from 208, 208, and 214 to 224, 224, and 230 respectively. Ensure that these changes are intentional and align with the updated memory map for the device.

Comment on lines +71 to +75
224 1 Indirect Data 1
168 2 Indirect Address Write
208 1 Indirect Data Write
224 1 Indirect Data Write
180 2 Indirect Address Read
214 1 Indirect Data Read
230 1 Indirect Data Read
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The addresses for Indirect Data 1, Indirect Data Write, and Indirect Data Read have been changed from 208, 208, and 214 to 224, 224, and 230 respectively. Ensure that these changes are intentional and align with the updated memory map for the device.

Comment on lines +69 to +73
224 1 Indirect Data 1
168 2 Indirect Address Write
208 1 Indirect Data Write
224 1 Indirect Data Write
180 2 Indirect Address Read
214 1 Indirect Data Read
230 1 Indirect Data Read
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The addresses for Indirect Data 1, Indirect Data Write, and Indirect Data Read have been changed from 208, 208, and 214 to 224, 224, and 230 respectively. Ensure that these changes are intentional and align with the updated memory map for the device.

Comment on lines +69 to +73
224 1 Indirect Data 1
168 2 Indirect Address Write
208 1 Indirect Data Write
224 1 Indirect Data Write
180 2 Indirect Address Read
214 1 Indirect Data Read
230 1 Indirect Data Read
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The addresses for Indirect Data 1, Indirect Data Write, and Indirect Data Read have been changed from 208, 208, and 214 to 224, 224, and 230 respectively. Ensure that these changes are intentional and align with the updated memory map for the device.

@robotpilot robotpilot merged commit 1c2af00 into jazzy Jul 23, 2025
25 checks passed
@github-project-automation github-project-automation bot moved this from 🌱 Todo to 🚩Done in Platform Jul 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bump Increase the version number to release

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants