Skip to content

Conversation

@Woojin-Crive
Copy link
Member

No description provided.

@Woojin-Crive Woojin-Crive requested a review from robotpilot June 23, 2025 07:24
@Woojin-Crive Woojin-Crive self-assigned this Jun 23, 2025
@Woojin-Crive Woojin-Crive added the bump Increase the version number to release label Jun 23, 2025
@github-project-automation github-project-automation bot moved this to 🌱 Todo in Platform Jun 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 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.7 to 1.4.8 in package.xml and CHANGELOG.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 in dynamixel.model (ID 231). This new model appears to consolidate type info and control table parameters previously defined in omy_end.model, streamlining model definitions and supporting virtual DXL.
  • Enhanced Communication Protocol: The SetDxlValueToSyncWrite and SetDxlValueToBulkWrite methods in src/dynamixel/dynamixel.cpp have been generalized. They now support writing various data types (1, 2, or 4 bytes) for indirect addressing, moving beyond just goal_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 the start() method has been adjusted. Goal positions are now synchronized (CalcJointToTransmission() and WriteMultiDxlData()) 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.model definition 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

  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.

@Woojin-Crive Woojin-Crive requested a review from yun-goon June 23, 2025 07:25
@Woojin-Crive Woojin-Crive moved this from 🌱 Todo to 📝 Pull Request in Platform Jun 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.

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.

Comment on lines +36 to +37
112 2 Indirect Address Write
816 1 Indirect Data Write
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

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.

Comment on lines +1837 to 1851
} 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);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

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;
          }
        }
      }

Comment on lines +2070 to 2084
} 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);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This logic is a duplicate of the code in SetDxlValueToSyncWrite() (lines 1837-1851). Refactor this into a shared helper function to avoid code duplication.

@Woojin-Crive Woojin-Crive removed the request for review from yun-goon June 23, 2025 07:32
@robotpilot robotpilot merged commit 8ca1b5a into jazzy Jun 23, 2025
25 checks passed
@github-project-automation github-project-automation bot moved this from 📝 Pull Request to 🚩Done in Platform Jun 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.

4 participants