Support HX5-D20 XM335 devices on Humble#114
Conversation
There was a problem hiding this comment.
Code Review
This pull request disables the fast read protocol by default, adds model definitions for Dynamixel xm335_t332 and xm335_t323, and optimizes GetDxlValueFromSyncRead by implementing a direct read path when only a single item is being read. Feedback on the implementation suggests capturing the read data item by const reference rather than copying it by value to prevent unnecessary memory allocations in a real-time control loop.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| DxlError Dynamixel::GetDxlValueFromSyncRead(double period_ms) | ||
| { | ||
| if (read_data_list_.size() == 1) { | ||
| auto it_read_data = read_data_list_.front(); |
There was a problem hiding this comment.
The RWItemList struct contains several std::vector and std::string members. Copying it by value here introduces unnecessary memory allocations and overhead, which is particularly undesirable in a real-time controller loop. Consider capturing it by const reference instead.
const auto & it_read_data = read_data_list_.front();
Summary
This adds the missing HX5-D20 XM335 model metadata needed by the ROS 2 Humble branch and adjusts the read path used during HX5-D20 bringup.
xm335_t332.modelandxm335_t323.modelcontrol table definitions.readTxRx.Why
While bringing up an HX5-D20 right hand on ROS 2 Humble, the Dynamixel hardware interface failed against the actual hardware even though DYNAMIXEL Wizard detected and controlled the full device chain correctly.
The observed device layout was:
The Humble model list did not include model number
1710, so the interface reported:After adding the model definition, bringup progressed further but the HX5-D20-MRT read transaction still failed when the read group contained only ID 110:
For the single-device MRT read case, direct protocol read succeeds and avoids requiring fast/group sync-read support from that one target.
Impact
This allows the Humble branch to recognize the XM335-T323 devices used in HX5-D20 and avoids a bringup-time read failure on the HX5-D20-MRT controller path.
The existing grouped sync-read path remains used for multi-device reads.
Validation
Built locally on ROS 2 Humble:
Validated against an HX5-D20 right hand at 4 Mbps on
/dev/ttyUSB0; the model table now resolves model1710asxm335_t323.model, and the bringup no longer stops at the missing-model or single-device fast sync read failure.