Discussion - Running ros2_control on a real robot (Making a Mobile Robot Pt 13)

which the Motor and encoder you have use? why did you set 17280 (enc_counts_per_rev">17280 )

having the same issue. please let me know if you were able to fix it

try out this repo it works fine

Hi Josh, thank you very much for these amazing tutorials.

I am just beginning to learn robotics by following your videos step by step exactly, and fortunately, I am now coming to No.14- Using ros2_control to drive our robot with success. (I use ros2 humble and ubuntu 22.04 with almost the same hardware)

However, I met a problem with “Command: ros2 param get --hide-type /robot_state_publisher robot_description”. I must run the command twice “ros2 launch articubot_one launch_robot.launch.py” to start “controller manager”.

Description:

When running the command for the first time, the error is as follows:

:~/robot_ws$ ros2 launch articubot_one launch_robot.launch.py

[INFO] [launch]: All log files can be found below /home/nancy/.ros/log/2025-05-04-19-36-30-846515-nancy-105311

[INFO] [launch]: Default logging verbosity is set to INFO

[INFO] [robot_state_publisher-1]: process started with pid [105521]

[INFO] [twist_mux-2]: process started with pid [105526]

[twist_mux-2] [INFO] [1746401795.826832534] [twist_mux]: Topic handler ‘topics.joystick’ subscribed to topic ‘cmd_vel_joy’: timeout = 0.500000s , priority = 100.

[twist_mux-2] [INFO] [1746401795.840677602] [twist_mux]: Topic handler ‘topics.navigation’ subscribed to topic ‘cmd_vel’: timeout = 0.500000s , priority = 10.

[twist_mux-2] [INFO] [1746401795.861248252] [twist_mux]: Topic handler ‘topics.tracker’ subscribed to topic ‘cmd_vel_tracker’: timeout = 0.500000s , priority = 20.

[robot_state_publisher-1] [INFO] [1746401795.941471115] [robot_state_publisher]: got segment base_footprint

[robot_state_publisher-1] [INFO] [1746401795.942107794] [robot_state_publisher]: got segment base_link

[robot_state_publisher-1] [INFO] [1746401795.942220515] [robot_state_publisher]: got segment camera_link

[robot_state_publisher-1] [INFO] [1746401795.942261144] [robot_state_publisher]: got segment camera_link_optical

[robot_state_publisher-1] [INFO] [1746401795.942295292] [robot_state_publisher]: got segment caster_wheel

[robot_state_publisher-1] [INFO] [1746401795.942322995] [robot_state_publisher]: got segment chassis

[robot_state_publisher-1] [INFO] [1746401795.942349958] [robot_state_publisher]: got segment face_link

[robot_state_publisher-1] [INFO] [1746401795.942376050] [robot_state_publisher]: got segment laser_frame

[robot_state_publisher-1] [INFO] [1746401795.942402365] [robot_state_publisher]: got segment left_wheel

[robot_state_publisher-1] [INFO] [1746401795.942427439] [robot_state_publisher]: got segment right_wheel

[ERROR] [launch]: Caught exception in launch (see debug for traceback): executed command failed. Command: ros2 param get --hide-type /robot_state_publisher robot_description

Captured stderr output: Node not found

[INFO] [twist_mux-2]: sending signal ‘SIGINT’ to process[twist_mux-2]

[INFO] [robot_state_publisher-1]: sending signal ‘SIGINT’ to process[robot_state_publisher-1]

[twist_mux-2] [INFO] [1746401809.157362573] [rclcpp]: signal_handler(signum=2)

[robot_state_publisher-1] [INFO] [1746401809.183252579] [rclcpp]: signal_handler(signum=2)

[INFO] [twist_mux-2]: process has finished cleanly [pid 105526]

[INFO] [robot_state_publisher-1]: process has finished cleanly [pid 105521]

:~/robot_ws$

When running the same command again, the Controller Manager is loaded successfully, and everything is OK, which is very weird.

Would you please tell me how to solve this problem? Thank you.

Thank you, solved the issue for me!

Hey can someone please help me this error

s$ ros2 launch rosbot_controller rosbot_real.launch.py
[INFO] [launch]: All log files can be found below /home/harshit/.ros/log/2025-07-18-05-25-36-815321-Harshit-4062
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [robot_state_publisher-1]: process started with pid [4064]
[INFO] [twist_mux-2]: process started with pid [4066]
[twist_mux-2] [INFO] [1752796537.634843490] [twist_mux]: Topic handler 'topics.joystick' subscribed to topic 'cmd_vel_joy': timeout = 0.500000s , priority = 100.
[twist_mux-2] [INFO] [1752796537.638977218] [twist_mux]: Topic handler 'topics.navigation' subscribed to topic 'cmd_vel': timeout = 0.500000s , priority = 10.
[twist_mux-2] [INFO] [1752796537.640222524] [twist_mux]: Topic handler 'topics.tracker' subscribed to topic 'cmd_vel_tracker': timeout = 0.500000s , priority = 20.
[robot_state_publisher-1] [INFO] [1752796537.652629228] [robot_state_publisher]: got segment base_footprint
[robot_state_publisher-1] [INFO] [1752796537.652942244] [robot_state_publisher]: got segment base_link
[robot_state_publisher-1] [INFO] [1752796537.652988299] [robot_state_publisher]: got segment caster_wheel_link
[robot_state_publisher-1] [INFO] [1752796537.653018725] [robot_state_publisher]: got segment imu_link
[robot_state_publisher-1] [INFO] [1752796537.653044762] [robot_state_publisher]: got segment laser_link
[robot_state_publisher-1] [INFO] [1752796537.653069484] [robot_state_publisher]: got segment wheel_left_link
[robot_state_publisher-1] [INFO] [1752796537.653094261] [robot_state_publisher]: got segment wheel_right_link
[INFO] [ros2_control_node-3]: process started with pid [4096]
[INFO] [spawner-4]: process started with pid [4098]
[INFO] [spawner-5]: process started with pid [4100]
[ros2_control_node-3] [WARN] [1752796542.978847192] [controller_manager]: [Deprecated] Passing the robot description parameter directly to the control_manager node is deprecated. Use '~/robot_description' topic from 'robot_state_publisher' instead.
[ros2_control_node-3] [INFO] [1752796542.979858666] [resource_manager]: Loading hardware 'rosbot' 
[ros2_control_node-3] [INFO] [1752796542.983300141] [resource_manager]: Initialize hardware 'rosbot' 
[ros2_control_node-3] [INFO] [1752796542.984323466] [DiffDriveArduinoHardware]: PID values not supplied, using defaults.
[ros2_control_node-3] [INFO] [1752796542.984497335] [resource_manager]: Successful initialization of hardware 'rosbot'
[ros2_control_node-3] [INFO] [1752796542.985010869] [resource_manager]: 'configure' hardware 'rosbot' 
[ros2_control_node-3] [INFO] [1752796542.985089609] [DiffDriveArduinoHardware]: Configuring ...please wait...
[ros2_control_node-3] [INFO] [1752796542.995909936] [DiffDriveArduinoHardware]: Successfully configured!
[ros2_control_node-3] [INFO] [1752796542.996042638] [resource_manager]: Successful 'configure' of hardware 'rosbot'
[ros2_control_node-3] [INFO] [1752796542.996080656] [resource_manager]: 'activate' hardware 'rosbot' 
[ros2_control_node-3] [INFO] [1752796542.996107693] [DiffDriveArduinoHardware]: Activating ...please wait...
[ros2_control_node-3] [INFO] [1752796542.996131341] [DiffDriveArduinoHardware]: Successfully activated!
[ros2_control_node-3] [INFO] [1752796542.996156249] [resource_manager]: Successful 'activate' of hardware 'rosbot'
[ros2_control_node-3] [INFO] [1752796543.022179962] [controller_manager]: update rate is 100 Hz
[ros2_control_node-3] [INFO] [1752796543.022361609] [controller_manager]: Spawning controller_manager RT thread with scheduler priority: 50
[ros2_control_node-3] [WARN] [1752796543.024688851] [controller_manager]: No real-time kernel detected on this system. See [https://control.ros.org/master/doc/ros2_control/controller_manager/doc/userdoc.html] for details on how to enable realtime scheduling.
[ros2_control_node-3] [INFO] [1752796544.180463286] [controller_manager]: Loading controller 'joint_state_broadcaster'
[spawner-5] [INFO] [1752796544.253421130] [spawner_diff_drive_base_controller]: waiting for service /controller_manager/list_controllers to become available...
[spawner-4] [INFO] [1752796544.320680906] [spawner_joint_state_broadcaster]: Loaded joint_state_broadcaster
[ros2_control_node-3] [INFO] [1752796544.325369871] [controller_manager]: Configuring controller 'joint_state_broadcaster'
[ros2_control_node-3] [INFO] [1752796544.325741091] [joint_state_broadcaster]: 'joints' or 'interfaces' parameter is empty. All available state interfaces will be published
[ros2_control_node-3] The ReadByte() call has timed out.
[spawner-4] [WARN] [1752796554.350996050] [spawner_joint_state_broadcaster]: Failed getting a result from calling /controller_manager/switch_controller in 10.0. (Attempt 1 of 3.)
^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT)
[robot_state_publisher-1] [INFO] [1752796556.326064126] [rclcpp]: signal_handler(signum=2)
[ros2_control_node-3] [INFO] [1752796556.326408420] [rclcpp]: signal_handler(signum=2)
[ros2_control_node-3] [INFO] [1752796556.326713010] [controller_manager]: Shutdown request received....
[ros2_control_node-3] [INFO] [1752796556.327001712] [controller_manager]: Shutting down all controllers in the controller manager.
[twist_mux-2] [INFO] [1752796556.326591233] [rclcpp]: signal_handler(signum=2)
[INFO] [robot_state_publisher-1]: process has finished cleanly [pid 4064]
[INFO] [twist_mux-2]: process has finished cleanly [pid 4066]
[INFO] [spawner-5]: process has finished cleanly [pid 4100]
[ERROR] [spawner-4]: process[spawner-4] failed to terminate '5' seconds after receiving 'SIGINT', escalating to 'SIGTERM'
[ERROR] [ros2_control_node-3]: process[ros2_control_node-3] failed to terminate '5' seconds after receiving 'SIGINT', escalating to 'SIGTERM'
[INFO] [spawner-4]: sending signal 'SIGTERM' to process[spawner-4]
[INFO] [ros2_control_node-3]: sending signal 'SIGTERM' to process[ros2_control_node-3]
[ros2_control_node-3] [INFO] [1752796561.361060056] [rclcpp]: signal_handler(signum=15)
[ERROR] [spawner-4]: process has died [pid 4098, exit code -15, cmd '/opt/ros/humble/lib/controller_manager/spawner joint_state_broadcaster --ros-args'].
[ERROR] [ros2_control_node-3]: process[ros2_control_node-3] failed to terminate '10.0' seconds after receiving 'SIGTERM', escalating to 'SIGKILL'
[INFO] [ros2_control_node-3]: sending signal 'SIGKILL' to process[ros2_control_node-3]
[ERROR] [ros2_control_node-3]: process has died [pid 4096, exit code -9, cmd '/opt/ros/humble/lib/controller_manager/ros2_control_node --ros-args --params-file /tmp/launch_params_jkf1eol1 --params-file /home/harshit/rosbot_ws/install/rosbot_controller/share/rosbot_controller/config/rosbot_controllers.yaml'].