dynamixel_hardware icon indicating copy to clipboard operation
dynamixel_hardware copied to clipboard

`[TxRxResult] Port is in use!` error working with XC330-M288T on ROS2 Humble

Open soham2560 opened this issue 9 months ago • 1 comments

System Info

  • ROS2 Humble
  • XC330-M288T x1 in Position Control Mode
  • With Joint Trajectory Controller
  • Using branch humble
  • Using ros-humble-dynamixel-workbench*
  • Using ros-humble-dynamixel-sdk

I am encountering the following errors in my log

[INFO] [launch]: All log files can be found below /home/container_user/.ros/log/2024-05-11-14-00-18-474799-E14-7727
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [ros2_control_node-1]: process started with pid [7736]
[INFO] [robot_state_publisher-2]: process started with pid [7738]
[INFO] [spawner-3]: process started with pid [7740]
[ros2_control_node-1] [INFO] [1715416218.928573690] [robot.controller_manager]: Subscribing to '~/robot_description' topic for robot description file.
[ros2_control_node-1] [INFO] [1715416218.929964564] [robot.controller_manager]: update rate is 200 Hz
[ros2_control_node-1] [INFO] [1715416218.930277923] [robot.controller_manager]: RT kernel is recommended for better performance
[robot_state_publisher-2] [INFO] [1715416218.978141700] [robot.robot_state_publisher]: got segment wheel_link
[robot_state_publisher-2] [INFO] [1715416218.978346253] [robot.robot_state_publisher]: got segment world
[ros2_control_node-1] [INFO] [1715416219.144636252] [robot.controller_manager]: Received robot description file.
[ros2_control_node-1] [INFO] [1715416219.146690928] [resource_manager]: Loading hardware 'Wheel' 
[ros2_control_node-1] [INFO] [1715416219.148623249] [resource_manager]: Initialize hardware 'Wheel' 
[ros2_control_node-1] [INFO] [1715416219.149287259] [DynamixelHardware]: joint_id 0: 101
[ros2_control_node-1] [INFO] [1715416219.149321060] [DynamixelHardware]: usb_port: /dev/ttyUSB0
[ros2_control_node-1] [INFO] [1715416219.149333352] [DynamixelHardware]: baud_rate: 57600
[ros2_control_node-1] [INFO] [1715416219.213230954] [DynamixelHardware]: Position control
[ros2_control_node-1] [INFO] [1715416219.229221121] [DynamixelHardware]: Torque enabled
[ros2_control_node-1] [INFO] [1715416219.229490831] [resource_manager]: Successful initialization of hardware 'Wheel'
[ros2_control_node-1] [INFO] [1715416219.229742245] [resource_manager]: 'configure' hardware 'Wheel' 
[ros2_control_node-1] [INFO] [1715416219.236202030] [resource_manager]: Successful 'configure' of hardware 'Wheel'
[ros2_control_node-1] [INFO] [1715416219.236272636] [resource_manager]: 'activate' hardware 'Wheel' 
[ros2_control_node-1] [ERROR] [1715416219.240448750] [DynamixelHardware]: [TxRxResult] Port is in use!
[ros2_control_node-1] [ERROR] [1715416219.240558395] [DynamixelHardware]: groupSyncRead getdata failed
[ros2_control_node-1] [ERROR] [1715416219.240573689] [DynamixelHardware]: groupSyncRead getdata failed
[ros2_control_node-1] [ERROR] [1715416219.240585910] [DynamixelHardware]: groupSyncRead getdata failed
[ros2_control_node-1] [ERROR] [1715416219.240726423] [DynamixelHardware]: [TxRxResult] Port is in use!
[ros2_control_node-1] [ERROR] [1715416219.245845826] [DynamixelHardware]: groupSyncWrite addparam failed

I am however able to control the motor using Dynamixel Wizard 2.0

soham2560 avatar May 11 '24 08:05 soham2560

I seem to have solved this issue, it was a combination of below

  • Too high controller frequency
    • Was running at 200hz, the errors went away when brought down to 10hz
  • Latency Setting not setup according to u2d2 settings
    • Once the latency was set to 1ms, the max frequency jumped to around 40-50hz

I believe one of the reasons for this is that the read and write functions are called once init fucntion is done, if we can delay till after on activate function, this problems go away at 200hz+ on my system, will put a pr for the same

soham2560 avatar May 12 '24 09:05 soham2560