Repository navigation
kortex_driver: export handles instead of value pointers (ros2_control 6.12) - #431
Open
Tobias-Fischer wants to merge 1 commit into
Open
Tobias-Fischer wants to merge 1 commit into
Tobias-Fischer wants to merge 1 commit into
Conversation
… 6.12) ros2_control 6.12 (ros-controls/ros2_control#3610) removed the pointer-based StateInterface/CommandInterface constructors and export_state_interfaces()/ export_command_interfaces(), so kortex_driver no longer builds on Rolling (Kinovarobotics#430). The driver keeps its logic and interface lists: the former export loops now describe (prefix, name, &member) bindings. The interfaces the URDF declares come from the base class; the others (per-joint velocity/effort commands, the gripper's set_gripper_max_velocity/effort, tcp/twist.*, reset_fault/*) are exported as unlisted interfaces with the same names, all double. Every member written only by the control loop is mirrored: write() first copies the command handles into the members, read() ends by copying the state members into their handles, and wherever the driver itself resets commands (perform_command_mode_switch, on_activate, the fault reset in write()) it writes the handles too. Also: arm_commands_velocities_ is reset with std::fill instead of a six-element literal (which shrank it to six entries on the 7-DoF arm), and the reset_fault members are initialised. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tobias-Fischer
added a commit
to RoboStack/robostack
that referenced
this pull request
Oct 19, 2026
…gain [skip ci] Instead of excluding Kortex on rolling, patch kortex_driver 0.2.5: the CMake part of Kinovarobotics/ros2_kortex#415 (no ament_target_dependencies in ament_cmake 2.9) and the handle-based interface export, the same C++ change as Kinovarobotics/ros2_kortex#431 (sent upstream for #430): unlisted interfaces for everything the URDF doesn't declare, same names and types, with the members mirrored around read()/write() and the driver's own command resets written to the handles. Built against hardware_interface 6.12.0 on linux-64 with kortex_bringup and the 7-DoF Gen3 MoveIt config on top; an offline check of the exported interface names matches 0.2.5's. Not tested on hardware. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #430. ros2_control 6.12 (ros-controls/ros2_control#3610) removed the pointer-based
StateInterface/CommandInterfaceconstructors andexport_state_interfaces()/export_command_interfaces(), sokortex_driverno longer builds on Rolling.The port keeps the driver's logic and its interface lists:
(prefix, name, &member)bindings. Interfaces the URDF declares (per joint: command position, state position/velocity/effort; gripper: command position, state position/velocity) come from the base class. The ones it doesn't (per-joint velocity/effort commands,set_gripper_max_velocity/set_gripper_max_effort,tcp/twist.*,reset_fault/command,reset_fault/async_success,reset_fault/internal_fault) are exported as unlisted interfaces with the same names, alldouble, so controllers and configurations need no changes.write()first copies the command handles into the members,read()ends by copying the state members into their handles, and wherever the driver itself resets commands (perform_command_mode_switch,on_activate, the fault reset inwrite()) it writes the handles too. After export, each command handle starts at its member's initial value (e.g. the gripper's max velocity/effort).arm_commands_velocities_is reset withstd::fillinstead of a six-element literal (which shrank it to six entries on the 7-DoF arm, and the sync loops index every joint), and thereset_faultmembers are initialised.Formatted with clang-format 18 (the pre-commit version); no new cppcheck findings.
Tested:
hardware_interface6.12.0 (RoboStack, linux-64), on the 0.2.5 release with the CMake part of Kortex API & Rolling Binary Build Updates #415, which is the same C++ change as this PR;kortex_bringupandkinova_gen3_7dof_robotiq_2f_85_moveit_configbuild on top.on_initup to the robot connection, and lists the exported interfaces: for gen3 7-DoF with and without the gripper and gen3 6-DoF, the names and types match exactly what 0.2.5 exported, and the state/command sync works in both directions.Unrelated, but noticed while testing on Rolling:
robotiq_description0.0.1 rejects themock_sensor_commandsargument thatkortex_descriptionpasses to the gripper xacro.🤖 Claude (AI assistant), on behalf of @Tobias-Fischer
🤖 Generated with Claude Code