Discussion - Changes for running mobile robot on Humble/Jammy

When you say does not work, what doesn’t work?

For those interested. I accidentally posted my answer on the wrong thread:

Hi,

I have the same issue
posted here Discussion - Running ros2_control on a real robot (Making a Mobile Robot Pt 13) - #77 by Mikhail_Andryievich
also change device to /dev/seraial/by-id/$(yourpathtoarduinodevice) didn’t help.

Hi,
Issue solved,

Please see my post Discussion - Running ros2_control on a real robot (Making a Mobile Robot Pt 13) - #78 by Mikhail_Andryievich

1 Like

I keep getting a controller manger error on my real robot , [spawner-4] [INFO] [1697218098.682967899] [spawner_joint_broad]: Waiting for ‘/controller_manager’ node to exist
[spawner-5] [INFO] [1697218098.687145515] [spawner_diff_cont]: Waiting for ‘/controller_manager’ node to exist
[spawner-4] [INFO] [1697218100.745289152] [spawner_joint_broad]: Waiting for ‘/controller_manager’ node to exist
[spawner-5] [INFO] [1697218100.747771286] [spawner_diff_cont]: Waiting for ‘/controller_manager’ node to exist
[spawner-4] [INFO] [1697218102.808255262] [spawner_joint_broad]: Waiting for ‘/controller_manager’ node to exist
[spawner-5] [INFO] [1697218102.810942465] [spawner_diff_cont]: Waiting for ‘/controller_manager’ node to exist
[spawner-4] [INFO] [1697218104.871516344] [spawner_joint_broad]: Waiting for ‘/controller_manager’ node to exist
[spawner-5] [INFO] [1697218104.872617710] [spawner_diff_cont]: Waiting for ‘/controller_manager’ node to exist
[spawner-4] [ERROR] [1697218106.728414678] [spawner_joint_broad]: Controller manager not available
[spawner-5] [ERROR] [1697218106.728412641] [spawner_diff_cont]: Controller manager not available
[ERROR] [spawner-5]: process has died [pid 6013, exit code 1, cmd ‘/opt/ros/humble/lib/controller_manager/spawner diff_cont --ros-args’].
[ERROR] [spawner-4]: process has died [pid 6011, exit code 1, cmd ‘/opt/ros/humble/lib/controller_manager/spawner joint_broad --ros-args’].

I’m using ROS2 Humble on 22.04 and I’m getting the following errors when trying to use the ‘serial_motor_demo’ nodes on both my PI and Dev box.
Any help would be welcome!
Here are the errors:

~/dev_ws$ colcon build --symlink-install
Starting >>> serial_motor_demo_msgs
Starting >>> articubot_one
Starting >>> joy_tester
Starting >>> my_bot                                                                                         
Finished <<< articubot_one [0.56s]                                                                                                                   
Finished <<< my_bot [0.60s]                                                                                          
Finished <<< serial_motor_demo_msgs [0.83s]                                                  
Starting >>> serial_motor_demo
/home/robert/.local/lib/python3.10/site-packages/setuptools/dist.py:717: UserWarning: Usage of dash-separated 'script-dir' will not be supported in future versions. Please use the underscore name 'script_dir' instead
  warnings.warn(
/home/robert/.local/lib/python3.10/site-packages/setuptools/dist.py:717: UserWarning: Usage of dash-separated 'install-scripts' will not be supported in future versions. Please use the underscore name 'install_scripts' instead
  warnings.warn(
Finished <<< joy_tester [1.14s]                                                 
--- stderr: serial_motor_demo                   
/home/robert/.local/lib/python3.10/site-packages/setuptools/dist.py:717: UserWarning: Usage of dash-separated 'script-dir' will not be supported in future versions. Please use the underscore name 'script_dir' instead
  warnings.warn(
---
Finished <<< serial_motor_demo [0.99s]

Summary: 5 packages finished [2.56s]
  1 package had stderr output: serial_motor_demo

source install/setup.bash
~/dev_ws$ ros2 run serial_motor_demo driver --ros-args -p serial_port:=/dev/ttyUSB0 -p baud_rate:=115200 -p loop_rate:=30 -p encoder_cpr:=403 

Traceback (most recent call last):
  File "/home/robert/dev_ws/install/serial_motor_demo/lib/serial_motor_demo/driver", line 33, in <module>
    sys.exit(load_entry_point('serial-motor-demo', 'console_scripts', 'driver')())
  File "/home/robert/dev_ws/install/serial_motor_demo/lib/serial_motor_demo/driver", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/robert/dev_ws/build/serial_motor_demo/serial_motor_demo/driver.py", line 8, in <module>
    import serial
ModuleNotFoundError: No module named 'serial'
[ros2run]: Process exited with failure 1
~/dev_ws$

I found the issue:
go to ~/dev_ws/src/serial_motor_demo/serial_motor_demo/setup.cfg and change script-dir to script_dir and install-scripts to install_scripts

To fix the other issues:
sudo apt update
pip install pyserial

colcon build --symlink-install
source install/setup.bash

This worked for me.

1 Like

[ERROR] [spawner-9]: process has died [pid 130035, exit code 1, cmd ‘/opt/ros/humble/lib/controller_manager/spawner joint_broad --ros-args’].
[ERROR] [spawner-8]: process has died [pid 130033, exit code 1, cmd ‘/opt/ros/humble/lib/controller_manager/spawner diff_cont --ros-args’].
suggest any solutions

Thank you very much @JoshNewans for such a useful content! I’m facing one issue. My real robot wheels are moving fine but in rviz2 it is not moving. Fixed frame is ‘odom’. The tf is also not moving. Don’t know the real problem. If anyone knows about this issue, please help me out. Thanks once again.

I have same issues running launch_sim.launch.py:

spawn_entity.py-7] [INFO] [1701511034.435623471] [spawn_entity]: Waiting for entity xml on robot_description
[spawn_entity.py-7] [INFO] [1701511034.446533217] [spawn_entity]: Waiting for service /spawn_entity, timeout = 30
[spawn_entity.py-7] [INFO] [1701511034.448278023] [spawn_entity]: Waiting for service /spawn_entity
[spawn_entity.py-7] [INFO] [1701511035.207765010] [spawn_entity]: Calling service /spawn_entity
[spawner-8] [INFO] [1701511036.253856100] [spawner_diff_cont]: Waiting for '/controller_manager' node to exist
[spawner-9] [INFO] [1701511036.411119062] [spawner_joint_broad]: Waiting for '/controller_manager' node to exist
[spawner-8] [INFO] [1701511038.265079010] [spawner_diff_cont]: Waiting for '/controller_manager' node to exist
[spawner-9] [INFO] [1701511038.422873011] [spawner_joint_broad]: Waiting for '/controller_manager' node to exist
[joy_node-2] [INFO] [1701511038.488014540] [joy_node]: No haptic (rumble) available, skipping initialization
[joy_node-2] [INFO] [1701511038.488207328] [joy_node]: Opened joystick: 8BitDo Pro 2.  deadzone: 0.050000
[spawner-8] [INFO] [1701511040.276564534] [spawner_diff_cont]: Waiting for '/controller_manager' node to exist
[spawner-9] [INFO] [1701511040.434304214] [spawner_joint_broad]: Waiting for '/controller_manager' node to exist
[spawner-8] [INFO] [1701511042.287987996] [spawner_diff_cont]: Waiting for '/controller_manager' node to exist
[spawner-9] [INFO] [1701511042.445203461] [spawner_joint_broad]: Waiting for '/controller_manager' node to exist
[spawner-8] [ERROR] [1701511044.299611844] [spawner_diff_cont]: Controller manager not available
[spawner-9] [ERROR] [1701511044.456709296] [spawner_joint_broad]: Controller manager not available
[ERROR] [spawner-8]: process has died [pid 8739, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner diff_cont --ros-args'].
[ERROR] [spawner-9]: process has died [pid 8742, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner joint_broad --ros-args'].

please help, this is making me crazy…

EDIT: SOLVED, need to source the ros installation too: source /opt/ros/humble/setup.bash

Hello, I am running this command
“ros2 launch articubot_one launch_sim.launch.py world:=src/articubot_one/worlds/obstacles.world”

Following issue occurs that mainly says, "waiting for ‘/controller_manager’ node to exits.
I have not connected the hardware, i just want to run simulation, i have also not connected the joystick controller. Please help.

[spawner-8] [INFO] [1702742482.928396398] [spawner_diff_cont]: Waiting for '/controller_manager' node to exist
[spawner-9] [INFO] [1702742482.978355460] [spawner_joint_broad]: Waiting for '/controller_manager' node to exist
[spawner-8] [INFO] [1702742484.944556101] [spawner_diff_cont]: Waiting for '/controller_manager' node to exist
[spawner-9] [INFO] [1702742484.993915675] [spawner_joint_broad]: Waiting for '/controller_manager' node to exist
[spawner-8] [INFO] [1702742486.960455335] [spawner_diff_cont]: Waiting for '/controller_manager' node to exist
[spawner-9] [INFO] [1702742487.009761191] [spawner_joint_broad]: Waiting for '/controller_manager' node to exist
[spawner-8] [INFO] [1702742488.975815797] [spawner_diff_cont]: Waiting for '/controller_manager' node to exist
[spawner-9] [INFO] [1702742489.026076443] [spawner_joint_broad]: Waiting for '/controller_manager' node to exist
[spawner-8] [ERROR] [1702742490.991288597] [spawner_diff_cont]: Controller manager not available
[spawner-9] [ERROR] [1702742491.042033206] [spawner_joint_broad]: Controller manager not available
[ERROR] [spawner-8]: process has died [pid 46964, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner diff_cont --ros-args'].
[ERROR] [spawner-9]: process has died [pid 46966, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner joint_broad --ros-args'].

hey im having the same problem. at first i also get the erroe of waiting for controller manager, but i manage that error when i run this command to start the controller manager ros2 run controller_manager ros2_control_node
but now the joint_broad and diff_contr wont loaded. do you have any idea how to fix that??
thankyou.

agnes@agnes-virtual-machine:~/ros2_ws$ ros2 launch articubot_one launch_sim.launch.py world:=./src/articubot_one/worlds/obstacles.world 
[INFO] [launch]: All log files can be found below /home/agnes/.ros/log/2023-12-20-09-21-00-038973-agnes-virtual-machine-31197
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [robot_state_publisher-1]: process started with pid [31199]
[INFO] [joy_node-2]: process started with pid [31201]
[INFO] [teleop_node-3]: process started with pid [31203]
[INFO] [twist_mux-4]: process started with pid [31205]
[INFO] [gzserver-5]: process started with pid [31225]
[INFO] [gzclient-6]: process started with pid [31229]
[INFO] [spawn_entity.py-7]: process started with pid [31240]
[INFO] [spawner-8]: process started with pid [31251]
[INFO] [spawner-9]: process started with pid [31253]
[teleop_node-3] [INFO] [1703038861.876974544] [TeleopTwistJoy]: Teleop enable button 6.
[teleop_node-3] [INFO] [1703038861.877030519] [TeleopTwistJoy]: Turbo on button 7.
[teleop_node-3] [INFO] [1703038861.877036240] [TeleopTwistJoy]: Linear axis x on 1 at scale 0.500000.
[teleop_node-3] [INFO] [1703038861.877043058] [TeleopTwistJoy]: Turbo for linear axis x is scale 1.000000.
[teleop_node-3] [INFO] [1703038861.877047368] [TeleopTwistJoy]: Angular axis yaw on 0 at scale 0.500000.
[teleop_node-3] [INFO] [1703038861.877051233] [TeleopTwistJoy]: Turbo for angular axis yaw is scale 1.000000.
[twist_mux-4] [INFO] [1703038861.897146758] [twist_mux]: Topic handler 'topics.joystick' subscribed to topic 'cmd_vel_joy': timeout = 0.500000s , priority = 100.
[twist_mux-4] [INFO] [1703038861.916095919] [twist_mux]: Topic handler 'topics.navigation' subscribed to topic 'cmd_vel': timeout = 0.500000s , priority = 10.
[twist_mux-4] [INFO] [1703038861.917244499] [twist_mux]: Topic handler 'topics.tracker' subscribed to topic 'cmd_vel_tracker': timeout = 0.500000s , priority = 20.
[robot_state_publisher-1] [INFO] [1703038861.964330737] [robot_state_publisher]: got segment base_footprint
[robot_state_publisher-1] [INFO] [1703038861.965701276] [robot_state_publisher]: got segment base_link
[robot_state_publisher-1] [INFO] [1703038861.967038541] [robot_state_publisher]: got segment camera_link
[robot_state_publisher-1] [INFO] [1703038861.968030737] [robot_state_publisher]: got segment camera_link_optical
[robot_state_publisher-1] [INFO] [1703038861.969049981] [robot_state_publisher]: got segment caster_wheel
[robot_state_publisher-1] [INFO] [1703038861.969619292] [robot_state_publisher]: got segment chassis
[robot_state_publisher-1] [INFO] [1703038861.970116589] [robot_state_publisher]: got segment face_link
[robot_state_publisher-1] [INFO] [1703038861.970740701] [robot_state_publisher]: got segment laser_frame
[robot_state_publisher-1] [INFO] [1703038861.971250580] [robot_state_publisher]: got segment left_wheel
[robot_state_publisher-1] [INFO] [1703038861.971730175] [robot_state_publisher]: got segment right_wheel
[spawner-9] [FATAL] [1703038862.553379073] [spawner_joint_broad]: Failed loading controller joint_broad
[spawner-8] [FATAL] [1703038862.651437509] [spawner_diff_cont]: Failed loading controller diff_cont
[spawn_entity.py-7] [INFO] [1703038862.740672163] [spawn_entity]: Spawn Entity started
[ERROR] [gzserver-5]: process has died [pid 31225, exit code 255, cmd 'gzserver ./src/articubot_one/worlds/obstacles.world -slibgazebo_ros_init.so -slibgazebo_ros_factory.so -slibgazebo_ros_force_system.so --ros-args --params-file /home/agnes/ros2_ws/install/articubot_one/share/articubot_one/config/gazebo_params.yaml'].
[spawn_entity.py-7] [INFO] [1703038862.741441424] [spawn_entity]: Loading entity published on topic robot_description
[spawn_entity.py-7] /opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/qos.py:307: UserWarning: DurabilityPolicy.RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL is deprecated. Use DurabilityPolicy.TRANSIENT_LOCAL instead.
[spawn_entity.py-7]   warnings.warn(
[spawn_entity.py-7] [INFO] [1703038862.750233011] [spawn_entity]: Waiting for entity xml on robot_description
[ERROR] [spawner-9]: process has died [pid 31253, exit code 1, cmd '/home/agnes/ros2_ws/install/controller_manager/lib/controller_manager/spawner joint_broad --ros-args'].
[spawn_entity.py-7] [INFO] [1703038862.766765224] [spawn_entity]: Waiting for service /spawn_entity, timeout = 30
[spawn_entity.py-7] [INFO] [1703038862.767761119] [spawn_entity]: Waiting for service /spawn_entity
[ERROR] [spawner-8]: process has died [pid 31251, exit code 1, cmd '/home/agnes/ros2_ws/install/controller_manager/lib/controller_manager/spawner diff_cont --ros-args'].
^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT)
[robot_state_publisher-1] [INFO] [1703038863.826713890] [rclcpp]: signal_handler(signum=2)
[twist_mux-4] [INFO] [1703038863.826709508] [rclcpp]: signal_handler(signum=2)
[spawn_entity.py-7] Traceback (most recent call last):
[spawn_entity.py-7]   File "/opt/ros/humble/lib/gazebo_ros/spawn_entity.py", line 370, in <module>
[spawn_entity.py-7]     main()
[spawn_entity.py-7]   File "/opt/ros/humble/lib/gazebo_ros/spawn_entity.py", line 365, in main
[joy_node-2] [INFO] [1703038863.826991977] [rclcpp]: signal_handler(signum=2)
[spawn_entity.py-7]     exit_code = spawn_entity_node.run()
[spawn_entity.py-7]   File "/opt/ros/humble/lib/gazebo_ros/spawn_entity.py", line 228, in run
[spawn_entity.py-7]     success = self._spawn_entity(entity_xml, initial_pose, spawn_service_timeout)
[spawn_entity.py-7]   File "/opt/ros/humble/lib/gazebo_ros/spawn_entity.py", line 276, in _spawn_entity
[spawn_entity.py-7]     if client.wait_for_service(timeout_sec=timeout):
[spawn_entity.py-7]   File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/client.py", line 177, in wait_for_service
[spawn_entity.py-7]     time.sleep(sleep_time)
[spawn_entity.py-7] KeyboardInterrupt
[teleop_node-3] [INFO] [1703038863.829216666] [rclcpp]: signal_handler(signum=2)
[ERROR] [spawn_entity.py-7]: process has died [pid 31240, exit code -2, cmd '/opt/ros/humble/lib/gazebo_ros/spawn_entity.py -topic robot_description -entity my_bot --ros-args'].
[INFO] [twist_mux-4]: process has finished cleanly [pid 31205]
[INFO] [teleop_node-3]: process has finished cleanly [pid 31203]
[INFO] [robot_state_publisher-1]: process has finished cleanly [pid 31199]
[INFO] [joy_node-2]: process has finished cleanly [pid 31201]
[INFO] [gzclient-6]: process has finished cleanly [pid 31229]

There’s a problem…
I think the Raspberry Pi USB port is twisted.
Arduino port must be connected to USB1 and RPLidar port must be connected to USB0
But in my robot state, the Arduino connection is USB0, and Rplidar is connected to USB1. And my Rplidar keeps getting operating-time-out errors and just logs that the process has died.
How do I change my usb port and rplidar error?

Hmm that is odd, it means ros2_control is not correctly publishing the /joint_states message, so I would be investigating that. (Sorry that is probably a bit late to be useful!)

Make sure you have installed ros2_control (e.g. sudo apt install ros-humble-ros2-control) and have sourced your ROS installation (source /opt/ros/humble/setup.bash should be in your .bashrc).

That is odd, have you made sure to install ros2_control, source your ROS installation, rebuild with colcon, and see what happens? You also should not need to run the controller_manager manually.
Also make sure you are using the right branch for your version of ROS.

Hmm, I would recommend using the device names in /dev/serial/by-id/ or /dev/serial/by-path/ when you have two devices connected (if you aren’t already). This is instead of e.g. /dev/ttyUSB0.

First of all, thank you for your help.
I’ve made some modifications.
ros2_control.xacro에선

/dev/ttyUSB0 I modified the above part to USB1,

in rplidar.launch.py
‘serial_port’: ‘/dev/ttyUSB0’,
It has been modified to .

They’ve designated USB ports, but it’s still
launch the ros2 launch articubot_one rplidar.launch.py,
Error, operation time out. SL_RESULT_OPERATION_TIMEOUT!
The above statement is generated.
Right now, the bad rate is 115200
Rplidar is using the A2m8 version.

my issues github link

i am getting this error how to solve it

sid@humble:~/dev_ws$ colcon build --symlink-install
Starting >>> articubot_one
— stderr: articubot_one
CMake Error at CMakeLists.txt:19 (find_package):
By not providing “Findament_cmake.cmake” in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
“ament_cmake”, but CMake did not find one.

Could not find a package configuration file provided by “ament_cmake” with
any of the following names:

ament_cmakeConfig.cmake
ament_cmake-config.cmake

Add the installation prefix of “ament_cmake” to CMAKE_PREFIX_PATH or set
“ament_cmake_DIR” to a directory containing one of the above files. If
“ament_cmake” provides a separate development package or SDK, be sure it
has been installed.


Failed <<< articubot_one [0.10s, exited with code 1]

Summary: 0 packages finished [0.62s]
1 package failed: articubot_one
1 package had stderr output: articubot_one

Hey… I want to fuse my mpu 6050 imu module data with the encoder data. How can i implement this.For read the imu data i use a Arduino nano.