Skip to content

Dynamixel SDK cpp RAII updates#681

Open
GyuH13 wants to merge 10 commits intomainfrom
feature-cpp-raii
Open

Dynamixel SDK cpp RAII updates#681
GyuH13 wants to merge 10 commits intomainfrom
feature-cpp-raii

Conversation

@GyuH13
Copy link
Copy Markdown
Member

@GyuH13 GyuH13 commented Apr 13, 2026

This PR refactors the C++ SDK and ROS 2 C++ wrapper internals to use RAII-based buffer management instead of manual new[]/delete[] and malloc/free. Dynamic packet, group read/write, and error buffers are migrated to std::vector<uint8_t>, reducing manual memory handling and making ownership clearer across the packet handlers, group handlers, and fast read paths.

In addition, the PR updates package and library versioning for the 5.0.0 release. The standalone C++ library and ROS 2 shared library now declare VERSION 5.0.0 and SOVERSION 3 to reflect the C++ ABI change caused by public class layout updates. Related version metadata was also aligned across C, C++, Python, documentation, Arduino metadata, and ROS package manifests/changelogs.

The PR also revises the standalone C++ uninstall flow. Instead of relying on install_manifest.txt, the uninstall script now removes SDK-owned install paths by name under the configured install prefix, including headers, libraries, CMake package files, and shared data such as the control table.

GyuH13 added 7 commits April 7, 2026 17:54
…ng with the new release. Enhancements include safer dynamic storage in C++ SDK and unified versioning.
….0 and SOVERSION 3 for ROS 2 shared library, and updated uninstall process to remove SDK-owned paths by name.
…local buffers, replacing them with stack-allocated vectors for improved memory management and performance.
Copy link
Copy Markdown
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 upgrades the Dynamixel SDK to version 5.0.0, transitioning from manual memory management to std::vector for group and packet buffers in both the standalone C++ SDK and ROS 2 wrappers. The update also includes modernizing casts to static_cast, replacing bzero with memset, and refactoring the CMake uninstall logic. Review feedback focuses on enhancing robustness by using std::vector::size() instead of manual length calculations during packet transmission, which prevents potential buffer over-reads if parameter population is incomplete.

Comment thread c++/src/dynamixel_sdk/group_bulk_write.cpp Outdated
Comment thread c++/src/dynamixel_sdk/group_sync_write.cpp Outdated
Comment thread ros/dynamixel_sdk/src/dynamixel_sdk/group_bulk_write.cpp Outdated
Comment thread ros/dynamixel_sdk/src/dynamixel_sdk/group_sync_write.cpp Outdated
Comment thread c++/src/dynamixel_sdk/group_bulk_read.cpp
Comment thread c++/src/dynamixel_sdk/group_bulk_read.cpp
Comment thread c++/src/dynamixel_sdk/group_sync_read.cpp
Comment thread c++/src/dynamixel_sdk/group_fast_bulk_read.cpp
GyuH13 added 2 commits April 14, 2026 15:37
…ite classes to prevent transmission errors. Return COMM_TX_ERROR for invalid parameter sizes before executing write operations.
@GyuH13 GyuH13 self-assigned this Apr 14, 2026
…lecting the new release. Changes include enhancements in the C++ SDK and consistent versioning across C, C++, Python, and ROS 2 packages.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant