I watched the video “You can use ANY hardware with ros2_control”, I downloaded the code of that video, The purpose of that code is that I want to use the frame available in the code to connect to the arduino mega board. Currently I am in the stage of connecting ros2_control to arduino through the code framework available in the video, But I have connection problems when launching the diffbot.launch.py file, currently I am working on the ros_humble version. I’m really sorry that my English sentence seems grammatically incorrect. Thank you everyone for your help.
I just edited the device parameter:
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. The tf is also not moving. Fixed frame is ‘odom’. Tried other fixed frame but of no avail. Don’t know the real problem. If anyone knows about this issue, please help me out. Thanks once again.
Hi @JoshNewans I have learned a lot from your tutorials and applying them on my graduation project so thank you for all the work you have done I would not got anywhere without your generous help
I have been running into issues when I run the “launch_robot.launch.py” on the RasberryPi while it works perfectly on my laptop and in both cases the Arduino board works fine but I do not seem to load “diff_cont” for some reason on the Pi here is the error I get
[INFO] [ros2_control_node-4]: process started with pid [196016]
[INFO] [spawner-5]: process started with pid [196018]
[INFO] [spawner-6]: process started with pid [196020]
[ros2_control_node-4] [INFO] [1700919705.073008620] [resource_manager]: Loading hardware 'RealRobot'
[ros2_control_node-4] [INFO] [1700919705.094977924] [resource_manager]: Initialize hardware 'RealRobot'
[ros2_control_node-4] [INFO] [1700919705.098197162] [DiffDriveArduino]: Configuring...
[ros2_control_node-4] [INFO] [1700919705.128308250] [DiffDriveArduino]: Finished Configuration
[ros2_control_node-4] [INFO] [1700919705.128477832] [resource_manager]: Successful initialization of hardware 'RealRobot'
[ros2_control_node-4] [INFO] [1700919705.129383249] [resource_manager]: 'configure' hardware 'RealRobot'
[ros2_control_node-4] [INFO] [1700919705.129478457] [resource_manager]: Successful 'configure' of hardware 'RealRobot'
[ros2_control_node-4] [INFO] [1700919705.129508218] [resource_manager]: 'activate' hardware 'RealRobot'
[ros2_control_node-4] [INFO] [1700919705.129532016] [DiffDriveArduino]: Starting Controller...
[ros2_control_node-4] [INFO] [1700919706.134547443] [resource_manager]: Successful 'activate' of hardware 'RealRobot'
[ros2_control_node-4] [INFO] [1700919706.271511173] [controller_manager]: update rate is 30 Hz
[ros2_control_node-4] [INFO] [1700919706.288859315] [controller_manager]: RT kernel is recommended for better performance
[ros2_control_node-4] [INFO] [1700919707.306182869] [controller_manager]: Loading controller 'joint_broad'
[ros2_control_node-4] [INFO] [1700919707.525818714] [controller_manager]: Loading controller 'diff_cont'
[ros2_control_node-4] [ERROR] [1700919707.525999760] [controller_manager]: Loader for controller 'diff_cont' (type 'diff_drive_controller/DiffDriveController') not found.
[ros2_control_node-4] [INFO] [1700919707.526040966] [controller_manager]: Available classes:
[ros2_control_node-4] [INFO] [1700919707.526075634] [controller_manager]: controller_manager/test_controller
[ros2_control_node-4] [INFO] [1700919707.526103543] [controller_manager]: controller_manager/test_controller_failed_init
[ros2_control_node-4] [INFO] [1700919707.526129859] [controller_manager]: controller_manager/test_controller_with_interfaces
[ros2_control_node-4] [INFO] [1700919707.526158527] [controller_manager]: joint_state_broadcaster/JointStateBroadcaster
[ros2_control_node-4] [INFO] [1700919707.526212030] [controller_manager]: joint_trajectory_controller/JointTrajectoryController
[ros2_control_node-4] [INFO] [1700919707.528960763] [controller_manager]: controller_manager/test_chainable_controller
[spawner-6] [FATAL] [1700919707.533096584] [spawner_diff_cont]: Failed loading controller diff_cont
[spawner-5] [INFO] [1700919707.759520886] [spawner_joint_broad]: Loaded joint_broad
[ros2_control_node-4] [INFO] [1700919707.765827910] [controller_manager]: Configuring controller 'joint_broad'
[ros2_control_node-4] [INFO] [1700919707.766330214] [joint_broad]: 'joints' or 'interfaces' parameter is empty. All available state interfaces will be published
[spawner-5] [INFO] [1700919707.954555349] [spawner_joint_broad]: Configured and activated joint_broad
[ERROR] [spawner-6]: process has died [pid 196020, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner diff_cont --ros-args'].
[INFO] [spawner-5]: process has finished cleanly [pid 196018]
my initial thoughts that it dose not see the “my_controllers.yaml” file but it runs the “joint_broad” without any problems
Hi Josh!
I’m planning to simulate an AUV for 3D underwater object tracking with camera sensor using ROS and Gazebo. Do you have Any recommendations on the ROS version, Gazebo version, and plugins for simulation this scenario? or GitHub directory?
hello, i have problem with the diffdrive_arduino, it can’t be compiled. im using the ubuntu 22.04 with ros humble and i can install the ros-foxy, so i use the ros-humble. but after i install the ros-humble-ros2-control & ros-humble-ros2-controllers the diffdrive_arduino still won’t compiled. can u help me?? thankyou
agnes@raspberrypi:~/ros2_ws$ colcon build --symlink-install
[8.185s] WARNING:colcon.colcon_core.package_selection:Some selected packages are already built in one or more underlay workspaces:
‘rplidar_ros’ is in: /home/agnes/ros2_ws/install/rplidar_ros
If a package in a merged underlay workspace is overridden and it installs headers, then all packages in the overlay must sort their include directories by workspace order. Failure to do so may result in build failures or undefined behavior at run time.
If the overridden package is used by another package in any underlay, then the overriding package in the overlay must be API and ABI compatible or undefined behavior at run time may occur.
If you understand the risks and want to override a package anyways, add the following to the command line:
–allow-overriding rplidar_ros
This may be promoted to an error in a future release of colcon-override-check.
Starting >>> serial
Starting >>> articubot_one
Starting >>> ldlidar_stl_ros2
Starting >>> rplidar_ros
Finished <<< articubot_one [3.33s]
Finished <<< ldlidar_stl_ros2 [3.37s]
Finished <<< serial [4.88s]
Starting >>> diffdrive_arduino
Finished <<< rplidar_ros [4.61s]
— stderr: diffdrive_arduino
In file included from /home/agnes/ros2_ws/src/diffdrive_arduino/src/fake_robot.cpp:1:
/home/agnes/ros2_ws/src/diffdrive_arduino/include/diffdrive_arduino/fake_robot.h:7:10: fatal error: hardware_interface/base_interface.hpp: No such file or directory
7 | #include “hardware_interface/base_interface.hpp”
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [CMakeFiles/fake_robot.dir/build.make:76: CMakeFiles/fake_robot.dir/src/fake_robot.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:165: CMakeFiles/fake_robot.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs…
In file included from /home/agnes/ros2_ws/src/diffdrive_arduino/src/diffdrive_arduino.cpp:1:
/home/agnes/ros2_ws/src/diffdrive_arduino/include/diffdrive_arduino/diffdrive_arduino.h:7:10: fatal error: hardware_interface/base_interface.hpp: No such file or directory
7 | #include “hardware_interface/base_interface.hpp”
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [CMakeFiles/diffdrive_arduino.dir/build.make:76: CMakeFiles/diffdrive_arduino.dir/src/diffdrive_arduino.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:139: CMakeFiles/diffdrive_arduino.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
Failed <<< diffdrive_arduino [3.85s, exited with code 2]
Summary: 4 packages finished [14.0s]
1 package failed: diffdrive_arduino
1 package had stderr output: diffdrive_arduino
hello Mr joshNewans i have a problem when i try to run this command ros2 launch articubot_one launch_robot.launch.py
the error is :
[INFO] [launch]: All log files can be found below /home/omar/.ros/log/2023-12-19-14-15-50-067095-omarlegiony540-15500
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [robot_state_publisher-1]: process started with pid [15503]
[INFO] [twist_mux-2]: process started with pid [15505]
[robot_state_publisher-1] Parsing robot urdf xml string.
[robot_state_publisher-1] Link base_footprint had 0 children
[robot_state_publisher-1] Link chassis had 3 children
[robot_state_publisher-1] Link camera_link had 1 children
[robot_state_publisher-1] Link camera_link_optical had 0 children
[robot_state_publisher-1] Link caster_wheel had 0 children
[robot_state_publisher-1] Link laser_frame had 0 children
[robot_state_publisher-1] Link left_wheel had 0 children
[robot_state_publisher-1] Link right_wheel had 0 children
[robot_state_publisher-1] [INFO] [1702988150.253367756] [robot_state_publisher]: got segment base_footprint
[robot_state_publisher-1] [INFO] [1702988150.253457840] [robot_state_publisher]: got segment base_link
[robot_state_publisher-1] [INFO] [1702988150.253472042] [robot_state_publisher]: got segment camera_link
[robot_state_publisher-1] [INFO] [1702988150.253482521] [robot_state_publisher]: got segment camera_link_optical
[robot_state_publisher-1] [INFO] [1702988150.253492593] [robot_state_publisher]: got segment caster_wheel
[robot_state_publisher-1] [INFO] [1702988150.253502422] [robot_state_publisher]: got segment chassis
[robot_state_publisher-1] [INFO] [1702988150.253512065] [robot_state_publisher]: got segment laser_frame
[robot_state_publisher-1] [INFO] [1702988150.253521801] [robot_state_publisher]: got segment left_wheel
[robot_state_publisher-1] [INFO] [1702988150.253531529] [robot_state_publisher]: got segment right_wheel
[twist_mux-2] [INFO] [1702988150.253417560] [twist_mux]: Topic handler ‘topics.joystick’ subscribed to topic ‘cmd_vel_joy’: timeout = 0.500000s , priority = 100.
[twist_mux-2] [INFO] [1702988150.253767902] [twist_mux]: Topic handler ‘topics.navigation’ subscribed to topic ‘cmd_vel’: timeout = 0.500000s , priority = 10.
[twist_mux-2] [INFO] [1702988150.253950440] [twist_mux]: Topic handler ‘topics.tracker’ subscribed to topic ‘cmd_vel_tracker’: timeout = 0.500000s , priority = 20.
[INFO] [ros2_control_node-3]: process started with pid [15541]
[INFO] [spawner.py-4]: process started with pid [15543]
[INFO] [spawner.py-5]: process started with pid [15545]
[ros2_control_node-3] terminate called after throwing an instance of ‘pluginlib::LibraryLoadException’
[ros2_control_node-3] what(): According to the loaded plugin descriptions the class diffdrive_arduino/DiffDriveArduino with base class type hardware_interface::SystemInterface does not exist. Declared types are fake_components/GenericSystem test_hardware_components/TestSystemCommandModes test_hardware_components/TestTwoJointSystem test_system turtlebot3_manipulation_hardware/TurtleBot3ManipulationSystemHardware
[spawner.py-4] [INFO] [1702988154.738035052] [spawner_joint_broad]: Waiting for /controller_manager services
[spawner.py-5] [INFO] [1702988154.742421839] [spawner_diff_cont]: Waiting for /controller_manager services
[ERROR] [ros2_control_node-3]: process has died [pid 15541, exit code -6, cmd ‘/opt/ros/foxy/lib/controller_manager/ros2_control_node --ros-args --params-file /tmp/launch_params_i511tc0_ --params-file /home/omar/colcon_ws/install/articubot_one/share/articubot_one/config/my_controllers.yaml’].
[spawner.py-4] [INFO] [1702988156.754901118] [spawner_joint_broad]: Waiting for /controller_manager services
[spawner.py-5] [INFO] [1702988156.758037875] [spawner_diff_cont]: Waiting for /controller_manager services
[spawner.py-4] [INFO] [1702988158.770261931] [spawner_joint_broad]: Waiting for /controller_manager services
[spawner.py-5] [INFO] [1702988158.773408347] [spawner_diff_cont]: Waiting for /controller_manager services
[spawner.py-4] [INFO] [1702988160.788893056] [spawner_joint_broad]: Waiting for /controller_manager services
[spawner.py-5] [INFO] [1702988160.791728848] [spawner_diff_cont]: Waiting for /controller_manager services
[spawner.py-4] [INFO] [1702988162.807066439] [spawner_joint_broad]: Waiting for /controller_manager services
[spawner.py-5] [INFO] [1702988162.811132170] [spawner_diff_cont]: Waiting for /controller_manager services
[spawner.py-4] [ERROR] [1702988164.823391319] [spawner_joint_broad]: Controller manager not available
[spawner.py-5] [ERROR] [1702988164.828567043] [spawner_diff_cont]: Controller manager not available
[ERROR] [spawner.py-4]: process has died [pid 15543, exit code 1, cmd ‘/opt/ros/foxy/lib/controller_manager/spawner.py joint_broad --ros-args’].
[ERROR] [spawner.py-5]: process has died [pid 15545, exit code 1, cmd ‘/opt/ros/foxy/lib/controller_manager/spawner.py diff_cont --ros-args’].
^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT)
[twist_mux-2] [INFO] [1702988175.110388053] [rclcpp]: signal_handler(signal_value=2)
[robot_state_publisher-1] [INFO] [1702988175.110824006] [rclcpp]: signal_handler(signal_value=2)
[INFO] [robot_state_publisher-1]: process has finished cleanly [pid 15503]
[INFO] [twist_mux-2]: process has finished cleanly [pid 15505]
Hi Josh ,
I’m having the same issue like others with controller manager some how is not working .
I’ve been stuck in this for 4 days now with no luck ! any chance you recommend something ? I echo /cmd_vel_unstamped in robot and I can see the values passing
[spawner-4] [INFO] [1703827838.665064167] [spawner_joint_broad]: Waiting for ‘/controller_manager’ node to exist
[spawner-5] [INFO] [1703827838.785338511] [spawner_diff_cont]: Waiting for ‘/controller_manager’ node to exist
[spawner-4] [INFO] [1703827840.711671532] [spawner_joint_broad]: Waiting for ‘/controller_manager’ node to exist
[spawner-5] [INFO] [1703827840.828404607] [spawner_diff_cont]: Waiting for ‘/controller_manager’ node to exist
[spawner-4] [INFO] [1703827842.760930707] [spawner_joint_broad]: Waiting for ‘/controller_manager’ node to exist
[spawner-5] [INFO] [1703827842.877129094] [spawner_diff_cont]: Waiting for ‘/controller_manager’ node to exist
[spawner-4] [INFO] [1703827844.805368341] [spawner_joint_broad]: Waiting for ‘/controller_manager’ node to exist
[spawner-5] [INFO] [1703827844.923151119] [spawner_diff_cont]: Waiting for ‘/controller_manager’ node to exist
[spawner-4] [ERROR] [1703827846.646826040] [spawner_joint_broad]: Controller manager not available
[spawner-5] [ERROR] [1703827846.763479498] [spawner_diff_cont]: Controller manager not available
[ERROR] [spawner-4]: process has died [pid 7297, exit code 1, cmd ‘/opt/ros/humble/lib/controller_manager/spawner joint_broad --ros-args’].
[ERROR] [spawner-5]: process has died [pid 7299, exit code 1, cmd ‘/opt/ros/humble/lib/controller_manager/spawner diff_cont --ros-args’].
Also I ran controller_manager and no connection
ros2 run controller_manager spawner diff_cont
[INFO] [1703828709.701625640] [spawner_diff_cont]: Waiting for ‘/controller_manager’ node to exist
[INFO] [1703828711.722023739] [spawner_diff_cont]: Waiting for ‘/controller_manager’ node to exist
[INFO] [1703828713.742430911] [spawner_diff_cont]: Waiting for ‘/controller_manager’ node to exist
[INFO] [1703828715.764174999] [spawner_diff_cont]: Waiting for ‘/controller_manager’ node to exist
[ERROR] [1703828717.784713751] [spawner_diff_cont]: Controller manager not available
[ros2run]: Process exited with failure 1
make you clone the " humble " Branch from josh repo . This should solve your issue .
Hi Josh,
i am trying to launch launch_robot.lauch.py but in my dev machine to try the motors with teleop and i got this problem when launch it (Note i donot have diffarduino_drive in my packages and when i try to have it and build it , it give me error)
[INFO] [launch]: All log files can be found below /home/omar/.ros/log/2023-12-30-21-04-24-680391-omarlegiony540-26297
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [robot_state_publisher-1]: process started with pid [26300]
[INFO] [twist_mux-2]: process started with pid [26302]
[twist_mux-2] [INFO] [1703963064.968940347] [twist_mux]: Topic handler ‘topics.joystick’ subscribed to topic ‘cmd_vel_joy’: timeout = 0.500000s , priority = 100.
[twist_mux-2] [INFO] [1703963064.969531345] [twist_mux]: Topic handler ‘topics.navigation’ subscribed to topic ‘cmd_vel’: timeout = 0.500000s , priority = 10.
[robot_state_publisher-1] Parsing robot urdf xml string.
[robot_state_publisher-1] Link base_footprint had 0 children
[robot_state_publisher-1] Link chassis had 2 children
[robot_state_publisher-1] Link camera_link had 1 children
[robot_state_publisher-1] Link camera_link_optical had 0 children
[robot_state_publisher-1] Link laser_frame had 0 children
[robot_state_publisher-1] Link left_wheel had 0 children
[robot_state_publisher-1] Link leftb_wheel had 0 children
[robot_state_publisher-1] Link leftf_wheel had 0 children
[robot_state_publisher-1] Link right_wheel had 0 children
[robot_state_publisher-1] Link rightb_wheel had 0 children
[robot_state_publisher-1] Link rightf_wheel had 0 children
[robot_state_publisher-1] [INFO] [1703963064.974543580] [robot_state_publisher]: got segment base_footprint
[robot_state_publisher-1] [INFO] [1703963064.974624726] [robot_state_publisher]: got segment base_link
[robot_state_publisher-1] [INFO] [1703963064.974637111] [robot_state_publisher]: got segment camera_link
[robot_state_publisher-1] [INFO] [1703963064.974645299] [robot_state_publisher]: got segment camera_link_optical
[robot_state_publisher-1] [INFO] [1703963064.974652976] [robot_state_publisher]: got segment chassis
[robot_state_publisher-1] [INFO] [1703963064.974660158] [robot_state_publisher]: got segment laser_frame
[robot_state_publisher-1] [INFO] [1703963064.974666931] [robot_state_publisher]: got segment left_wheel
[robot_state_publisher-1] [INFO] [1703963064.974673816] [robot_state_publisher]: got segment leftb_wheel
[robot_state_publisher-1] [INFO] [1703963064.974680677] [robot_state_publisher]: got segment leftf_wheel
[robot_state_publisher-1] [INFO] [1703963064.974687395] [robot_state_publisher]: got segment right_wheel
[robot_state_publisher-1] [INFO] [1703963064.974694133] [robot_state_publisher]: got segment rightb_wheel
[robot_state_publisher-1] [INFO] [1703963064.974701012] [robot_state_publisher]: got segment rightf_wheel
[INFO] [ros2_control_node-3]: process started with pid [26338]
[INFO] [spawner.py-4]: process started with pid [26340]
[INFO] [spawner.py-5]: process started with pid [26342]
[ros2_control_node-3] terminate called after throwing an instance of ‘pluginlib::LibraryLoadException’
[ros2_control_node-3] what(): According to the loaded plugin descriptions the class diffdrive_arduino/DiffDriveArduino with base class type hardware_interface::SystemInterface does not exist. Declared types are fake_components/GenericSystem test_hardware_components/TestSystemCommandModes test_hardware_components/TestTwoJointSystem test_system
[spawner.py-4] [INFO] [1703963069.430926611] [spawner_joint_broad]: Waiting for /controller_manager services
[spawner.py-5] [INFO] [1703963069.431065690] [spawner_diff_cont]: Waiting for /controller_manager services
[ERROR] [ros2_control_node-3]: process has died [pid 26338, exit code -6, cmd ‘/opt/ros/foxy/lib/controller_manager/ros2_control_node --ros-args --params-file /tmp/launch_params_8fuljyhu --params-file /home/omar/real_ws/install/medo/share/medo/config/my_controllers.yaml’].
[spawner.py-4] [INFO] [1703963071.446737365] [spawner_joint_broad]: Waiting for /controller_manager services
[spawner.py-5] [INFO] [1703963071.447554445] [spawner_diff_cont]: Waiting for /controller_manager services
^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT)
[twist_mux-2] [INFO] [1703963073.455811200] [rclcpp]: signal_handler(signal_value=2)
[robot_state_publisher-1] [INFO] [1703963073.455834934] [rclcpp]: signal_handler(signal_value=2)
[spawner.py-5] Traceback (most recent call last):
[spawner.py-5] File “/opt/ros/foxy/lib/controller_manager/spawner.py”, line 204, in
[spawner.py-5] sys.exit(main())
[spawner.py-5] File “/opt/ros/foxy/lib/controller_manager/spawner.py”, line 118, in main
[spawner.py-5] if not wait_for_controller_manager(node, controller_manager_name,
[spawner.py-5] File “/opt/ros/foxy/lib/controller_manager/spawner.py”, line 59, in wait_for_controller_manager
[spawner.py-5] time.sleep(0.2)
[spawner.py-5] KeyboardInterrupt
[spawner.py-4] Traceback (most recent call last):
[spawner.py-4] File “/opt/ros/foxy/lib/controller_manager/spawner.py”, line 204, in
[spawner.py-4] sys.exit(main())
[spawner.py-4] File “/opt/ros/foxy/lib/controller_manager/spawner.py”, line 118, in main
[spawner.py-4] if not wait_for_controller_manager(node, controller_manager_name,
[spawner.py-4] File “/opt/ros/foxy/lib/controller_manager/spawner.py”, line 59, in wait_for_controller_manager
[spawner.py-4] time.sleep(0.2)
[spawner.py-4] KeyboardInterrupt
[INFO] [twist_mux-2]: process has finished cleanly [pid 26302]
[INFO] [robot_state_publisher-1]: process has finished cleanly [pid 26300]
[ERROR] [spawner.py-5]: process has died [pid 26342, exit code -2, cmd ‘/opt/ros/foxy/lib/controller_manager/spawner.py diff_cont --ros-args’].
[ERROR] [spawner.py-4]: process has died [pid 26340, exit code -2, cmd ‘/opt/ros/foxy/lib/controller_manager/spawner.py joint_broad --ros-args’].
I was able to resolve this issue by cloning the repo from buzzology github and then rebuilt the whole project with colcon .
hey Josh, thanks for the amazing tutorial and the generous content in general
i see you have commented on this issue before but i can’t seem to figure it out yet it happens on both the machine and the pi
[spawner.py-6] [INFO] [1704429643.856203298] [spawner_joint_broad]: Waiting for /controller_manager services
[spawner.py-5] [INFO] [1704429643.945700660] [spawner_diff_cont]: Waiting for /controller_manager services
[spawner.py-6] [INFO] [1704429645.866817026] [spawner_joint_broad]: Waiting for /controller_manager services
[spawner.py-5] [INFO] [1704429645.955195869] [spawner_diff_cont]: Waiting for /controller_manager services
[spawner.py-6] [INFO] [1704429647.880334317] [spawner_joint_broad]: Waiting for /controller_manager services
[spawner.py-5] [INFO] [1704429647.967992784] [spawner_diff_cont]: Waiting for /controller_manager services
[spawner.py-6] [INFO] [1704429649.896868913] [spawner_joint_broad]: Waiting for /controller_manager services
[spawner.py-5] [INFO] [1704429649.984468641] [spawner_diff_cont]: Waiting for /controller_manager services
[spawner.py-6] [ERROR] [1704429651.911524114] [spawner_joint_broad]: Controller manager not available
[ERROR] [spawner.py-6]: process has died [pid 9922, exit code 1, cmd ‘/opt/ros/foxy/lib/controller_manager/spawner.py joint_broad --ros-args’].
[spawner.py-5] [ERROR] [1704429651.999166283] [spawner_diff_cont]: Controller manager not available
[ERROR] [spawner.py-5]: process has died [pid 9920, exit code 1, cmd ‘/opt/ros/foxy/lib/controller_manager/spawner.py diff_cont --ros-args’].
See the documentation on the hardware_interface for the ros2_control, on github
Migration from Foxy to newer versions
Between Foxy and Galactic we made substantial changes to the interface of hardware components to enable management of their lifecycle. The following list shows a set of quick changes to port existing hardware components to Galactic:
- Rename
configure
toon_init
and change return type toCallbackReturn
- If using BaseInterface as base class then you should remove it. Specifically, change:
hardware_interface::BaseInterface<hardware_interface::[Actuator|Sensor|System]Interface>
to
hardware_interface::[Actuator|Sensor|System]Interface
- Remove include of headers
base_interface.hpp
andhardware_interface_status_values.hpp
Hey @Afiq003,
i got the same error… but as @JoshNewans:
i’m a bit confused by your solution.
what exactly did u do to resolve this? Thanks alot in advance!
EDIT: found the issue. in rsp.launch.py
i needed to insert an blank before the “sim_mode” parameter as follows:
old:
robot_description_config = Command(['xacro ‘, xacro_file, ’ use_ros2_control:=’, use_ros2_control, ‘sim_mode:=’, use_sim_time])
new:
robot_description_config = Command([‘xacro ‘, xacro_file, ’ use_ros2_control:=’, use_ros2_control, ’ sim_mode:=’, use_sim_time])
Hi @JoshNewans thanks a lot for the videos, They helped me a lot to understand ROS2 and how to build a differential drive bot. I am working on a 4 WD and have been following your tutorials until " [Using ros2_control to drive our robot (off the edge of the bench...)](https://www.youtube.com/watch?v=4VVrTCnxvSw&t=601s)
" video. I am facing some trouble after changing to ros2_control, The issue is that my robot is not moving either left or right in gazebo but it seems to move in Rviz as expected. I have searched all the online resources but did not find anything that helps.
here is the link to my repo GitHub - BooraKaushik/autobot
Video of what is happening, IMG_5920.mov - Google Drive
as you can see it is turning fine in rviz but not in gazebo.
I would really appreciate any help.
Thanks,
Kaushik Boora
Hi guys. I am new to ROS2 and I am following @JoshNewans tutorial to make my own robot. I am using an arduino uno board with polulu motors. I was able to make the robot work in gazebo/rviz but when I downloaded the diffdrive controller from Josh’ github and started to port it on the robot using RPI 3b+, I get the error:
ros2 launch adrover_ROS2 launch_robot.launch.py
[INFO] [launch]: All log files can be found below /home/adrover/.ros/log/2024-03-20-14-58-26-819462-adrover-2942
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [robot_state_publisher-1]: process started with pid [2945]
[robot_state_publisher-1] Parsing robot urdf xml string.
[robot_state_publisher-1] Link chassis_link_back had 1 children
[robot_state_publisher-1] Link laser_frame had 0 children
[robot_state_publisher-1] Link chassis_link_front had 1 children
[robot_state_publisher-1] Link lcd_link had 1 children
[robot_state_publisher-1] Link camera_link had 1 children
[robot_state_publisher-1] Link camera_link_optical had 0 children
[robot_state_publisher-1] Link chassis_link_left had 2 children
[robot_state_publisher-1] Link caster_wheel_link_lb had 0 children
[robot_state_publisher-1] Link caster_wheel_link_lf had 0 children
[robot_state_publisher-1] Link chassis_link_right had 2 children
[robot_state_publisher-1] Link caster_wheel_link_rb had 0 children
[robot_state_publisher-1] Link caster_wheel_link_rf had 0 children
[robot_state_publisher-1] Link left_wheel_link had 0 children
[robot_state_publisher-1] Link right_wheel_link had 0 children
[robot_state_publisher-1] [INFO] [1710928708.453907263] [robot_state_publisher]: got segment base_link
[robot_state_publisher-1] [INFO] [1710928708.454549749] [robot_state_publisher]: got segment camera_link
[robot_state_publisher-1] [INFO] [1710928708.454657611] [robot_state_publisher]: got segment camera_link_optical
[robot_state_publisher-1] [INFO] [1710928708.454703444] [robot_state_publisher]: got segment caster_wheel_link_lb
[robot_state_publisher-1] [INFO] [1710928708.454747245] [robot_state_publisher]: got segment caster_wheel_link_lf
[robot_state_publisher-1] [INFO] [1710928708.454788963] [robot_state_publisher]: got segment caster_wheel_link_rb
[robot_state_publisher-1] [INFO] [1710928708.454830316] [robot_state_publisher]: got segment caster_wheel_link_rf
[robot_state_publisher-1] [INFO] [1710928708.454871253] [robot_state_publisher]: got segment chassis_link_back
[robot_state_publisher-1] [INFO] [1710928708.454913543] [robot_state_publisher]: got segment chassis_link_front
[robot_state_publisher-1] [INFO] [1710928708.454954636] [robot_state_publisher]: got segment chassis_link_left
[robot_state_publisher-1] [INFO] [1710928708.454996562] [robot_state_publisher]: got segment chassis_link_right
[robot_state_publisher-1] [INFO] [1710928708.455047186] [robot_state_publisher]: got segment laser_frame
[robot_state_publisher-1] [INFO] [1710928708.455090831] [robot_state_publisher]: got segment lcd_link
[robot_state_publisher-1] [INFO] [1710928708.455134007] [robot_state_publisher]: got segment left_wheel_link
[robot_state_publisher-1] [INFO] [1710928708.455264005] [robot_state_publisher]: got segment right_wheel_link
[INFO] [ros2_control_node-2]: process started with pid [2957]
[ros2_control_node-2] terminate called after throwing an instance of 'std::runtime_error'
[ros2_control_node-2] what(): invalid URDF passed in to robot parser
[ERROR] [ros2_control_node-2]: process has died [pid 2957, exit code -6, cmd '/opt/ros/foxy/lib/controller_manager/ros2_control_node --ros-args --params-file /tmp/launch_params_y8g2xwtv --params-file /home/adrover/adrover_ws/install/adrover_ROS2/share/adrover_ROS2/config/adrover_controller.yaml'].
I have commented out the spawner in my launch files since the controller manager terminates automatically. Also my description file looks like:
<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro">
<ros2_control name="RealRobot" type="system">
<hardware>
<plugin>diffdrive_arduino/DiffDriveArduino</plugin>
<param name="left_wheel_names">left_wheel_joint</param>
<param name="right_wheel_names">right_wheel_joint</param>
<param name="loop_rate">30</param>
<param name="device">/dev/serial/by-id/usb-1a86_USB2.0-Ser_-if00-port0</param>
<param name="baud_rate">57600</param>
<param name="timeout">1000</param>
<param name="enc_counts_per_rev">8400</param>
</hardware>
<joint name="left_wheel_joint">
<command_interface name="velocity">
<param name="min">-10</param>
<param name="max">10</param>
</command_interface>
<state_interface name="velocity" />
<state_interface name="position" />
</joint>
<joint name="right_wheel_joint">
<command_interface name="velocity">
<param name="min">-10</param>
<param name="max">10</param>
</command_interface>
<state_interface name="velocity" />
<state_interface name="position" />
</joint>
</ros2_control>
<gazebo>
<plugin name="gazebo_ros2_control" filename="libgazebo_ros2_control.so">
<parameters>$(find adrover_ROS2)/config/adrover_controller.yaml</parameters>
</plugin>
</gazebo>
</robot>
Kindly any help in this regard?
hi , i m an issue while launch ros2 control list hardware interface output will coming like this could not contact to service controller manager
can anyone please help me out
It worked for me. For reference, I switched to ROS foxy but the issue persisted. I was connected to RPi over ssh and using nano for editing. I ultimately connected to vscode over remote connection, replaced all my code with the snippets provided in the blog by Josh ( I did this to ros2_control.xacroa and the launch_robot.launch.py files though I couldn’t see any difference between the two), removed the gazebo_control part completely instead of commenting it out and recompiled and run the launch file. It worked… Thankyou everyone and specially @JoshNewans for these great tutorials.
Hi Josh
I’m trying to run “ros2 launch articubot_one launch_robot.launch.py” but get this error, I wonder if you can guide me to a solution. Thanks
[INFO] [launch]: All log files can be found below /home/diaz/.ros/log/2024-04-04-06-44-23-550460-diaz-desktop-13685
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [robot_state_publisher-1]: process started with pid [13688]
[robot_state_publisher-1] 1712227464.651032 [0] robot_stat: using network interface wlan0 (udp/192.168.1.107) selected arbitrarily from: wlan0, docker0
[robot_state_publisher-1] Parsing robot urdf xml string.
[robot_state_publisher-1] Link chassis had 4 children
[robot_state_publisher-1] Link camera_link had 1 children
[robot_state_publisher-1] Link camera_link_optical had 0 children
[robot_state_publisher-1] Link caster_wheel had 0 children
[robot_state_publisher-1] Link face_link had 0 children
[robot_state_publisher-1] Link laser_frame had 0 children
[robot_state_publisher-1] Link left_wheel had 0 children
[robot_state_publisher-1] Link right_wheel had 0 children
[robot_state_publisher-1] [INFO] [1712227464.679112441] [robot_state_publisher]: got segment base_link
[robot_state_publisher-1] [INFO] [1712227464.679405597] [robot_state_publisher]: got segment camera_link
[robot_state_publisher-1] [INFO] [1712227464.679503966] [robot_state_publisher]: got segment camera_link_optical
[robot_state_publisher-1] [INFO] [1712227464.679596512] [robot_state_publisher]: got segment caster_wheel
[robot_state_publisher-1] [INFO] [1712227464.679661025] [robot_state_publisher]: got segment chassis
[robot_state_publisher-1] [INFO] [1712227464.679858499] [robot_state_publisher]: got segment face_link
[robot_state_publisher-1] [INFO] [1712227464.679919908] [robot_state_publisher]: got segment laser_frame
[robot_state_publisher-1] [INFO] [1712227464.679992325] [robot_state_publisher]: got segment left_wheel
[robot_state_publisher-1] [INFO] [1712227464.680050182] [robot_state_publisher]: got segment right_wheel
Task exception was never retrieved
future: <Task finished name=‘Task-12’ coro=<LaunchService._process_one_event() done, defined at /opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py:226> exception=SubstitutionFailure(‘executed command showed stderr output. Command: ros2 param get --hide-type /robot_state_publisher robot_description\nCaptured stderr output:\n1712227469.524891 [0] ros2: using network interface wlan0 (udp/192.168.1.107) selected arbitrarily from: wlan0, docker0\n1712227470.409871 [0] ros2: using network interface wlan0 (udp/192.168.1.107) selected arbitrarily from: wlan0, docker0\n’)>
Traceback (most recent call last):
File “/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py”, line 228, in _process_one_event
await self.__process_event(next_event)
File “/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py”, line 248, in __process_event
visit_all_entities_and_collect_futures(entity, self.__context))
File “/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py”, line 45, in visit_all_entities_and_collect_futures
futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
File “/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py”, line 38, in visit_all_entities_and_collect_futures
sub_entities = entity.visit(context)
File “/opt/ros/foxy/lib/python3.8/site-packages/launch/action.py”, line 108, in visit
return self.execute(context)
File “/opt/ros/foxy/lib/python3.8/site-packages/launch_ros/actions/node.py”, line 444, in execute
self._perform_substitutions(context)
File “/opt/ros/foxy/lib/python3.8/site-packages/launch_ros/actions/node.py”, line 399, in _perform_substitutions
evaluated_parameters = evaluate_parameters(context, self.__parameters)
File “/opt/ros/foxy/lib/python3.8/site-packages/launch_ros/utilities/evaluate_parameters.py”, line 164, in evaluate_parameters
output_params.append(evaluate_parameter_dict(context, param))
File “/opt/ros/foxy/lib/python3.8/site-packages/launch_ros/utilities/evaluate_parameters.py”, line 71, in evaluate_parameter_dict
evaluated_value = perform_substitutions(context, list(value))
File “/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/perform_substitutions_impl.py”, line 26, in perform_substitutions
return ‘’.join([context.perform_substitution(sub) for sub in subs])
File “/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/perform_substitutions_impl.py”, line 26, in
return ‘’.join([context.perform_substitution(sub) for sub in subs])
File “/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_context.py”, line 232, in perform_substitution
return substitution.perform(self)
File “/opt/ros/foxy/lib/python3.8/site-packages/launch/substitutions/command.py”, line 122, in perform
raise SubstitutionFailure(on_stderr_message)
launch.substitutions.substitution_failure.SubstitutionFailure: executed command showed stderr output. Command: ros2 param get --hide-type /robot_state_publisher robot_description
Captured stderr output:
1712227469.524891 [0] ros2: using network interface wlan0 (udp/192.168.1.107) selected arbitrarily from: wlan0, docker0
1712227470.409871 [0] ros2: using network interface wlan0 (udp/192.168.1.107) selected arbitrarily from: wlan0, docker0
^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT)
[robot_state_publisher-1] [INFO] [1712228830.109878910] [rclcpp]: signal_handler(signal_value=2)
[INFO] [robot_state_publisher-1]: process has finished cleanly [pid 13688]
I’ve been banging on this for some time and would appreciate any help that someone can offer. I’ve followed the update instructions for Humble to the best of my ability and can run everything in the simulated environment. The error comes when I try to run on the real robot. I get this error:
[ros2_control_node-3] [WARN] [1717166914.463673109] [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] [1717168386.815847187] [resource_manager]: Loading hardware ‘RealRobot’
[ros2_control_node-3] terminate called after throwing an instance of ‘pluginlib::LibraryLoadException’
[ros2_control_node-3] what(): According to the loaded plugin descriptions the class diffdrive_arduino/DiffDriveArduinoHardware with base class type hardware_interface::SystemInterface does not exist. Declared types are diffdrive_arduino/DiffDriveArduino fake_components/GenericSystem fake_robot/FakeRobot mock_components/GenericSystem test_hardware_components/TestSystemCommandModes test_hardware_components/TestTwoJointSystem
I build 4 wheel differential drive whit this tutorial, but i have problem with arduino diff drive because not supported for 4 wheel, can anyone help me?