Skip to content

Conversation

@robotpilot
Copy link
Member

No description provided.

Woojin-Crive and others added 9 commits March 19, 2025 16:19
- Added new models: xh540_w150 and xc330_t288.
- Introduced torque constant parameter in relevant functions.
…al Current' interface. Ensured proper checks for interface names before accumulating values for transmission commands.
- Introduced 'torque_constant' to xc330_t181.model, xc330_t288.model, and xh540_w150.model.
@robotpilot robotpilot added the bump Increase the version number to release label Mar 20, 2025
@robotpilot robotpilot self-assigned this Mar 20, 2025
Copilot AI review requested due to automatic review settings March 20, 2025 01:27
@github-project-automation github-project-automation bot moved this to 🌱 Todo in Platform Mar 20, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.

Files not reviewed (10)
  • CHANGELOG.rst: Language not supported
  • include/dynamixel_hardware_interface/dynamixel/dynamixel_info.hpp: Language not supported
  • include/dynamixel_hardware_interface/dynamixel_hardware_interface.hpp: Language not supported
  • package.xml: Language not supported
  • param/dxl_model/xc330_t181.model: Language not supported
  • param/dxl_model/xc330_t288.model: Language not supported
  • param/dxl_model/xh540_w150.model: Language not supported
  • src/dynamixel/dynamixel.cpp: Language not supported
  • src/dynamixel/dynamixel_info.cpp: Language not supported
  • src/dynamixel_hardware_interface.cpp: Language not supported

@robotpilot robotpilot moved this from 🌱 Todo to 📝 Pull Request in Platform Mar 20, 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.

Hello @robotpilot, 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!

Summary of Changes

This pull request bumps the version of the dynamixel_hardware_interface package to 1.4.0. It introduces a torque constant parameter to the DXL model files, enhances transmission command calculation, unifies the initialization structure, and adds support for goal current control. The changes include modifications to the changelog, dynamixel info header, hardware interface header, package XML, DXL model files, and source files.

Highlights

  • Version Bump: The package version is bumped from 1.3.0 to 1.4.0.
  • Torque Constant Parameter: A torque constant parameter is added to the DXL model files (xc330_t181.model, xc330_t288.model, xh540_w150.model) to improve accuracy in effort/torque calculations.
  • Goal Current Control: Support for goal current control is added, allowing the user to set the desired current for the Dynamixel motors.
  • Transmission Command Calculation: The transmission command calculation is enhanced to support goal current control, using the joint-to-transmission matrix to calculate the appropriate transmission commands based on joint efforts.
  • Unified Initialization Structure: The initialization structure is unified to streamline the setup process.

Changelog

Click here to see the changelog
  • CHANGELOG.rst
    • Added version 1.4.0 changelog entry.
    • Added Torque Constant Parameter to DXL Model Files
    • Enhanced Transmission Command Calculation
    • Unified Initialization Structure
    • Support for Goal Current Control
  • include/dynamixel_hardware_interface/dynamixel/dynamixel_info.hpp
    • Added torque_constant parameter to the GetDxlTypeInfo method.
  • include/dynamixel_hardware_interface/dynamixel_hardware_interface.hpp
    • Added definitions for GOAL_POSITION_INDEX and GOAL_CURRENT_INDEX.
  • package.xml
    • Updated package version to 1.4.0.
  • param/dxl_model/xc330_t181.model
    • Added torque_constant parameter with a value of 0.0006709470296015791.
  • param/dxl_model/xc330_t288.model
    • Added torque_constant parameter with a value of 0.0009674796739867748.
  • param/dxl_model/xh540_w150.model
    • Added torque_constant parameter with a value of 0.0045.
  • src/dynamixel/dynamixel.cpp
    • Modified GetDxlValueFromSyncRead and GetDxlValueFromBulkRead to convert current to effort using dxl_info_.ConvertCurrentToEffort.
  • src/dynamixel/dynamixel_info.cpp
    • Modified GetDxlTypeInfo to retrieve and set the torque_constant value.
  • src/dynamixel_hardware_interface.cpp
    • Modified InitDxlWriteItems to include "Goal Position" and "Goal Current" command interfaces.
    • Modified CalcJointToTransmission to calculate transmission commands for both goal position and goal current.
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.


Trivia time!

What company originally developed the Dynamixel actuators?

Click here for the answer
The Dynamixel actuators were originally developed by Robotis Co., Ltd.

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

The pull request bumps the version to 1.4.0 and introduces several new features and improvements, including torque constant parameter, enhanced transmission command calculation, unified initialization structure, and goal current control. The changes seem well-structured and address relevant aspects of the dynamixel hardware interface. However, there are a few areas that could benefit from further attention.

Summary of Findings

  • Missing Goal Velocity Implementation: The GOAL_VELOCITY_INDEX is defined but commented out with a TODO. This indicates an incomplete feature that should be addressed before merging, or the TODO should be removed if the feature is not planned for this release.
  • Inconsistent Interface Handling: The InitDxlWriteItems function adds "Goal Position" and potentially "Goal Current" interfaces, but the logic for handling these interfaces in CalcJointToTransmission is somewhat complex and could be simplified for better readability and maintainability.
  • Potential Redundancy in Interface Checks: The nested if statements in CalcJointToTransmission for handling "Goal Current" might be redundant and could be refactored for clarity and efficiency.

Merge Readiness

The pull request introduces valuable new features and improvements. However, the incomplete GOAL_VELOCITY_INDEX implementation and the complexity in CalcJointToTransmission warrant further attention. I recommend addressing these issues before merging. I am unable to approve this pull request, and users should have others review and approve this code before merging.

#define PRESENT_EFFORT_INDEX 2

#define GOAL_POSITION_INDEX 0
// #define GOAL_VELOCITY_INDEX 1 // TODO: to be implemented
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 line is commented out with a TODO. Is the goal velocity control to be implemented in this release? If not, consider removing this line to avoid confusion. If it is to be implemented, please do so before merging.

Comment on lines +714 to +728
HandlerVarType temp_write;
temp_write.id = id;
temp_write.name = gpio.name;

temp_write.interface_name_vec.push_back("Goal Position");
temp_write.value_ptr_vec.push_back(std::make_shared<double>(0.0));

temp_write.interface_name_vec.push_back(it.name);
temp_write.value_ptr_vec.push_back(std::make_shared<double>(0.0));
hdl_trans_commands_.push_back(temp_write);
for (auto it : gpio.command_interfaces) {
if (it.name == "Goal Current") {
temp_write.interface_name_vec.push_back("Goal Current");
temp_write.value_ptr_vec.push_back(std::make_shared<double>(0.0));
}
}

hdl_trans_commands_.push_back(temp_write);
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 here could be simplified. Instead of creating a temp_write object and pushing it back, consider directly pushing the necessary interfaces and values into hdl_trans_commands_ within the loop. This might reduce the number of lines and improve readability.

Comment on lines +875 to +878
for (size_t j = 0; j < hdl_joint_commands_.size(); j++) {
if (hdl_joint_commands_.at(j).interface_name_vec.size() > GOAL_CURRENT_INDEX &&
hdl_joint_commands_.at(j).interface_name_vec.at(GOAL_CURRENT_INDEX) ==
hardware_interface::HW_IF_EFFORT)
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 nested if statement checks for the same condition twice. Consider refactoring this to avoid redundancy and improve readability. You could extract the condition into a variable and reuse it.

@robotpilot robotpilot merged commit 22292c5 into jazzy Mar 20, 2025
33 checks passed
@robotpilot robotpilot deleted the bump-1.4.0 branch March 20, 2025 01:39
@github-project-automation github-project-automation bot moved this from 📝 Pull Request to 🚩Done in Platform Mar 20, 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