-
Notifications
You must be signed in to change notification settings - Fork 12
Bump 1.4.3 #34
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.3 #34
Conversation
Signed-off-by: Wonho Yun <[email protected]>
Signed-off-by: Wonho Yun <[email protected]>
Signed-off-by: Wonho Yun <[email protected]>
Signed-off-by: Wonho Yun <[email protected]>
Signed-off-by: Wonho Yun <[email protected]>
Signed-off-by: Wonho Yun <[email protected]>
Modified Build Error
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.
Hello @yun-goon, 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 from 1.4.2 to 1.4.3. It includes a fix for build errors, updates the changelog, and modifies the dynamixel.cpp and dynamixel_hardware_interface.cpp files to improve error message formatting and remove unused variables. Additionally, the ConvertValueRPMToVelocityRPS and ConvertVelocityRPSToValueRPM functions in dynamixel_info.hpp are updated to remove the unnecessary id parameter.
Highlights
- Version Bump: The package version is incremented to 1.4.3 in
package.xmland the changelog is updated to reflect the new version and associated fixes. - Code Improvements: The
ConvertValueRPMToVelocityRPSandConvertVelocityRPSToValueRPMfunctions indynamixel_info.hppare updated to remove the unnecessaryidparameter, simplifying their usage. - Error Message Formatting: The error messages in
dynamixel.cppare updated to use%ldfor printing the size ofread_data_list_, ensuring compatibility with different architectures and preventing potential format string vulnerabilities. Also, a default case is added to theDxlErrorToStringfunction to handle unknown error codes. - Unused Variable Removal: The
previous_stateparameter is marked as[[maybe_unused]]in theon_activateandon_deactivatemethods ofDynamixelHardwareindynamixel_hardware_interface.cpp, and thetimeandperiodparameters are marked as[[maybe_unused]]in thereadandwritemethods, indicating that these parameters are not currently used within the function bodies. Similarly, therequestparameter is marked as[[maybe_unused]]in thereboot_dxl_srv_callbackmethod.
Changelog
Click here to see the changelog
- CHANGELOG.rst
- Added entry for version 1.4.3, noting the fix for build errors and the contributor (Wonho Yun).
- include/dynamixel_hardware_interface/dynamixel/dynamixel_info.hpp
- Removed the
idparameter from theConvertValueRPMToVelocityRPSandConvertVelocityRPSToValueRPMfunctions.
- Removed the
- package.xml
- Updated the package version to 1.4.3.
- src/dynamixel/dynamixel.cpp
- Added a default case to the
DxlErrorToStringfunction to handle unknown error codes. - Updated the format specifier in
fprintfcalls forSyncRead Tx/Rx FailandBulkRead Tx/Rx Failmessages from%dto%ldto correctly print the size ofread_data_list_. - Removed the
idparameter from calls todxl_info_.ConvertValueRPMToVelocityRPSanddxl_info_.ConvertVelocityRPSToValueRPM.
- Added a default case to the
- src/dynamixel_hardware_interface.cpp
- Marked the
previous_stateparameter as[[maybe_unused]]in theon_activateandon_deactivatemethods. - Marked the
timeandperiodparameters as[[maybe_unused]]in thereadandwritemethods. - Marked the
requestparameter as[[maybe_unused]]in thereboot_dxl_srv_callbackmethod.
- Marked the
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.
A version ascends,
Bugs squashed, the build now mends,
Code flows anew.
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
The pull request bumps the version to 1.4.3 and includes fixes for build errors. The changes look good overall, with some minor improvements suggested below.
Summary of Findings
- Log message formatting: In
src/dynamixel/dynamixel.cpp, the format specifier%dis used forread_data_list_.size(), which is of typesize_t. It's better to use%ldforsize_tto avoid potential issues on different architectures. - Unused parameter: In
src/dynamixel_hardware_interface.cpp, several functions have unused parameters. Using[[maybe_unused]]is a good practice to suppress warnings, but it's worth considering if these parameters can be removed entirely to simplify the function signatures. - Redundant
idparameter: Ininclude/dynamixel_hardware_interface/dynamixel/dynamixel_info.hppandsrc/dynamixel/dynamixel.cpp, theidparameter is removed fromConvertValueRPMToVelocityRPSandConvertVelocityRPSToValueRPMfunctions. Ensure that the removal of theidparameter does not affect the functionality of these functions. - Missing default case in switch statement: In
src/dynamixel/dynamixel.cpp, a default case is added to theDxlErrorToStringfunction to handle unknown error codes. This is a good practice to prevent unexpected behavior when new error codes are introduced.
Merge Readiness
The pull request is almost ready for merging. Please address the medium and high severity issues identified in the review comments. After addressing these issues, the code should be in good shape to be merged. I am unable to approve this pull request, and recommend that others review and approve this code before merging.
| if (is_sync) { | ||
| dxl_comm_result = group_sync_read->txPacket(); | ||
| if (dxl_comm_result != COMM_SUCCESS) { | ||
| fprintf( |
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.
Consider using static_cast<long> to explicitly cast read_data_list_.size() to long to avoid potential compiler warnings or errors. It is generally safer to use %ld for size_t as size_t is an unsigned type, and %d is for signed integers.
| fprintf( | |
| stderr, "SyncRead Tx Fail [Dxl Size : %ld] [Error code : %d]\n", | |
| static_cast<long>(read_data_list_.size()), dxl_comm_result); |
| if (dxl_comm_result != COMM_SUCCESS) { | ||
| fprintf( | ||
| stderr, "BulkRead Tx Fail [Dxl Size : %d] [Error code : %d]\n", | ||
| stderr, "BulkRead Tx Fail [Dxl Size : %ld] [Error code : %d]\n", |
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.
Consider using static_cast<long> to explicitly cast read_data_list_.size() to long to avoid potential compiler warnings or errors. It is generally safer to use %ld for size_t as size_t is an unsigned type, and %d is for signed integers.
| stderr, "BulkRead Tx Fail [Dxl Size : %ld] [Error code : %d]\n", | |
| stderr, "BulkRead Tx Fail [Dxl Size : %ld] [Error code : %d]\n", | |
| static_cast<long>(read_data_list_.size()), dxl_comm_result); |
| if (is_sync) { | ||
| dxl_comm_result = group_sync_read->rxPacket(); | ||
| if (dxl_comm_result != COMM_SUCCESS) { | ||
| fprintf( |
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.
Consider using static_cast<long> to explicitly cast read_data_list_.size() to long to avoid potential compiler warnings or errors. It is generally safer to use %ld for size_t as size_t is an unsigned type, and %d is for signed integers.
| fprintf( | |
| stderr, "SyncRead Rx Fail [Dxl Size : %ld] [Error code : %d]\n", | |
| static_cast<long>(read_data_list_.size()), dxl_comm_result); |
| if (dxl_comm_result != COMM_SUCCESS) { | ||
| fprintf( | ||
| stderr, "BulkRead Rx Fail [Dxl Size : %d] [Error code : %d]\n", | ||
| stderr, "BulkRead Rx Fail [Dxl Size : %ld] [Error code : %d]\n", |
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.
Consider using static_cast<long> to explicitly cast read_data_list_.size() to long to avoid potential compiler warnings or errors. It is generally safer to use %ld for size_t as size_t is an unsigned type, and %d is for signed integers.
| stderr, "BulkRead Rx Fail [Dxl Size : %ld] [Error code : %d]\n", | |
| stderr, "BulkRead Rx Fail [Dxl Size : %ld] [Error code : %d]\n", | |
| static_cast<long>(read_data_list_.size()), dxl_comm_result); |
robotpilot
left a comment
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.
LGTM
No description provided.