dynamixel_hardware icon indicating copy to clipboard operation
dynamixel_hardware copied to clipboard

Change name of port to "port_name"

Open Betacrucis opened this issue 1 year ago • 0 comments

Hi, Thanks for the great software!

I have been stuck with not being able to connect the USB port to the Dynamixel actuators. I am using ROS2 Humble on a Ubuntu system with a USB2Dynamixel interface.

It kept crashing at line 84 of /dynamixel_hardware/src/dynamixel_hardware.cpp

auto usb_port = info_.hardware_parameters.at("usb_port");

The issue was resolved when the name of the port is changed to "port_name".

The name of the variable for the port is set in the DynamixelSDK DynamixelSDK/dynamixel_sdk/src/dynamixel_sdk/port_handler.cpp

PortHandler *PortHandler::getPortHandler(const char *port_name)

Line 84 in dynamixel_hardware.cpp needs to be changed to:

auto usb_port = info_.hardware_parameters.at("port_name");

You will also need to change the param name for the port in the examples to "port_name".

open_manipulator_x_description/urdf/open_manipulator_x.ros2_control.xacro

dynamixel_hardware/DynamixelHardware /dev/ttyUSB0 1000000

After this minor change the software works without a problem. I hope this helps.

Betacrucis avatar May 01 '24 01:05 Betacrucis