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.
Copilot AI review requested due to automatic review settings March 20, 2025 01:26
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 self-assigned this Mar 20, 2025
@robotpilot robotpilot added the bump Increase the version number to release label 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, DXL model files, and source code to incorporate these new features and improvements.

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).
  • Goal Current Control: Support for goal current control is added, including modifications to the hardware interface and transmission command calculation.
  • Transmission Command Calculation: Enhanced transmission command calculation to account for goal current control.
  • Unified Initialization Structure: The initialization structure is unified for better consistency.

Changelog

Click here to see the changelog
  • CHANGELOG.rst
    • Added version 1.4.0 with release date 2025-03-20.
    • Added Torque Constant Parameter to DXL Model Files.
    • Enhanced Transmission Command Calculation.
    • Unified Initialization Structure.
    • Support for Goal Current Control.
    • Added Woojin Wie to contributors.
  • include/dynamixel_hardware_interface/dynamixel/dynamixel_info.hpp
    • Added torque_constant to the GetDxlTypeInfo method parameters.
  • include/dynamixel_hardware_interface/dynamixel_hardware_interface.hpp
    • Added definition for GOAL_CURRENT_INDEX.
  • package.xml
    • Updated package version to 1.4.0.
  • param/dxl_model/xc330_t181.model
    • Added torque_constant parameter with value 0.0006709470296015791.
  • param/dxl_model/xc330_t288.model
    • Added torque_constant parameter with value 0.0009674796739867748.
  • param/dxl_model/xh540_w150.model
    • Added torque_constant parameter with value 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' interfaces.
    • Modified CalcJointToTransmission to calculate and set 'Goal Position' and 'Goal Current' values for transmissions.
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.


The gears they mesh, the motors hum,
A constant torque, precisely spun.
From model files, parameters gleam,
A roboticist's electric dream.

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.

@robotpilot robotpilot moved this 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.

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, some areas could benefit from further clarification and potential optimization.

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 or removed if not planned for immediate implementation.
  • Potential Redundancy in InitDxlWriteItems: The InitDxlWriteItems function adds "Goal Position" and potentially "Goal Current" interfaces. It might be beneficial to ensure that these interfaces are not added multiple times or unnecessarily.
  • Inconsistent use of GOAL_CURRENT_INDEX: The GOAL_CURRENT_INDEX is used in CalcJointToTransmission with multiple nested conditional statements. This could be simplified for better readability and efficiency.

Merge Readiness

The pull request introduces valuable new features and improvements. However, the TODO in dynamixel_hardware_interface.hpp and the potential redundancy in InitDxlWriteItems should be addressed before merging. Additionally, the nested conditional statements in CalcJointToTransmission could be simplified. I am unable to approve this pull request, and recommend that another reviewer does so before merging. I recommend that the pull request not be merged until the high severity issues are addressed (at a minimum).

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

high

This TODO indicates an incomplete feature. Either implement it or remove the definition if it's not planned for implementation in the near future. Leaving it as is can be misleading.

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

Choose a reason for hiding this comment

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

medium

Consider refactoring this section to avoid potential redundancy. The Goal Position interface is always added, and Goal Current is conditionally added within the loop. Ensure that these interfaces are not added multiple times if the conditions are not met as expected.

Comment on lines +871 to 889
for (size_t i = 0; i < num_of_transmissions_; i++) {
if (hdl_trans_commands_.at(i).interface_name_vec.size() > GOAL_CURRENT_INDEX &&
hdl_trans_commands_.at(i).interface_name_vec.at(GOAL_CURRENT_INDEX) == "Goal Current")
{
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)
{
double value = 0.0;
for (size_t k = 0; k < num_of_joints_; k++) {
value += joint_to_transmission_matrix_[i][k] *
(*hdl_joint_commands_.at(k).value_ptr_vec.at(GOAL_CURRENT_INDEX));
}
*hdl_trans_commands_.at(i).value_ptr_vec.at(GOAL_CURRENT_INDEX) = value;
}
}
}
}
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 section contains multiple nested conditional statements. Consider refactoring this logic to improve readability and potentially reduce computational complexity. For instance, you could extract the inner loop and conditional checks into a separate function.

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