ros2_control_node dies after launch
Using laptop with Ubuntu Jammy and Ros2 Humble, with the Andino Github rover robot package. I changed the lidar and camera to false in launch file, since they are not installed yet, and the Arduino Uno is programmed and connected to motor driver. This error shows a lot of information but its meaning is beyond me! I expected to be able to control motors with joystick after this launch file loaded its routines. A serial command to Arduino through IDE does cause motor to spin.
russ@russ-HP-Pavilion-Laptop-15-eh0xxx:~$ ros2 launch andino_bringup andino_robot.launch.py
[INFO] [launch]: All log files can be found below /home/russ/.ros/log/2023-08-05-21-08-03-726931-russ-HP-Pavilion-Laptop-15-eh0xxx-14973
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [robot_state_publisher-1]: process started with pid [14974]
[INFO] [twist_mux-2]: process started with pid [14976]
[twist_mux-2] [INFO] [1691287684.071292502] [twist_mux]: Topic handler 'topics.joy' subscribed to topic 'cmd_vel_joy': timeout = 0.500000s , priority = 30.
[twist_mux-2] [INFO] [1691287684.072275936] [twist_mux]: Topic handler 'topics.keyboard' subscribed to topic 'cmd_vel_keyboard': timeout = 0.500000s , priority = 20.
[twist_mux-2] [INFO] [1691287684.072586940] [twist_mux]: Topic handler 'topics.navigation' subscribed to topic 'cmd_vel': timeout = 0.500000s , priority = 10.
[robot_state_publisher-1] [WARN] [1691287684.074231910] [kdl_parser]: The root link base_link has an inertia specified in the URDF, but KDL does not support a root link with an inertia. As a workaround, you can add an extra dummy link to your URDF.
[robot_state_publisher-1] [INFO] [1691287684.074314114] [robot_state_publisher]: got segment base_footprint
[robot_state_publisher-1] [INFO] [1691287684.074364120] [robot_state_publisher]: got segment base_link
[robot_state_publisher-1] [INFO] [1691287684.074374107] [robot_state_publisher]: got segment camera_link
[robot_state_publisher-1] [INFO] [1691287684.074383187] [robot_state_publisher]: got segment caster_base_link
[robot_state_publisher-1] [INFO] [1691287684.074392685] [robot_state_publisher]: got segment caster_rotation_link
[robot_state_publisher-1] [INFO] [1691287684.074401834] [robot_state_publisher]: got segment caster_wheel_link
[robot_state_publisher-1] [INFO] [1691287684.074410774] [robot_state_publisher]: got segment left_motor
[robot_state_publisher-1] [INFO] [1691287684.074419853] [robot_state_publisher]: got segment left_wheel
[robot_state_publisher-1] [INFO] [1691287684.074428583] [robot_state_publisher]: got segment right_motor
[robot_state_publisher-1] [INFO] [1691287684.074437593] [robot_state_publisher]: got segment right_wheel
[robot_state_publisher-1] [INFO] [1691287684.074446602] [robot_state_publisher]: got segment rplidar_laser_link
[robot_state_publisher-1] [INFO] [1691287684.074455193] [robot_state_publisher]: got segment second_base_link
[INFO] [ros2_control_node-3]: process started with pid [15028]
[INFO] [spawner-4]: process started with pid [15030]
[ros2_control_node-3] [INFO] [1691287690.774201633] [resource_manager]: Loading hardware 'RealRobot'
[ros2_control_node-3] [INFO] [1691287690.775026388] [resource_manager]: Initialize hardware 'RealRobot'
[ros2_control_node-3] [INFO] [1691287690.775172217] [DiffDriveAndino]: On init...
[ros2_control_node-3] [INFO] [1691287690.775186883] [DiffDriveAndino]: Finished On init.
[ros2_control_node-3] [INFO] [1691287690.775194636] [resource_manager]: Successful initialization of hardware 'RealRobot'
[ros2_control_node-3] [INFO] [1691287690.775291994] [resource_manager]: 'configure' hardware 'RealRobot'
[ros2_control_node-3] [INFO] [1691287690.775298210] [DiffDriveAndino]: On configure...
[ros2_control_node-3] terminate called after throwing an instance of 'LibSerial::NotOpen'
[ros2_control_node-3] what(): Serial port not open.
[ros2_control_node-3] Bad file descriptor
[ros2_control_node-3] Stack trace (most recent call last):
[ros2_control_node-3] #22 Object "", at 0xffffffffffffffff, in
[ros2_control_node-3] #21 Object "/opt/ros/humble/lib/controller_manager/ros2_control_node", at 0x55ddfc63bd84, in
[ros2_control_node-3] #20 Source "../csu/libc-start.c", line 392, in __libc_start_main_impl [0x7fe510029e3f]
[ros2_control_node-3] #19 Source "../sysdeps/nptl/libc_start_call_main.h", line 58, in __libc_start_call_main [0x7fe510029d8f]
[ros2_control_node-3] #18 Object "/opt/ros/humble/lib/controller_manager/ros2_control_node", at 0x55ddfc63b89e, in
[ros2_control_node-3] #17 Object "/opt/ros/humble/lib/libcontroller_manager.so", at 0x7fe5108b9da1, in controller_manager::ControllerManager::ControllerManager(std::shared_ptr<rclcpp::Executor>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, rclcpp::NodeOptions const&)
[ros2_control_node-3] #16 Object "/opt/ros/humble/lib/libcontroller_manager.so", at 0x7fe5108b926e, in controller_manager::ControllerManager::init_resource_manager(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
[ros2_control_node-3] #15 Object "/opt/ros/humble/lib/libhardware_interface.so", at 0x7fe51032e360, in hardware_interface::ResourceManager::activate_all_components()
[ros2_control_node-3] #14 Object "/opt/ros/humble/lib/libhardware_interface.so", at 0x7fe51032db1b, in hardware_interface::ResourceManager::set_component_state(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, rclcpp_lifecycle::State&)
[ros2_control_node-3] #13 Object "/opt/ros/humble/lib/libhardware_interface.so", at 0x7fe5103360e2, in bool hardware_interface::ResourceStorage::set_component_state<hardware_interface::System>(hardware_interface::System&, rclcpp_lifecycle::State const&)
[ros2_control_node-3] #12 Object "/opt/ros/humble/lib/libhardware_interface.so", at 0x7fe51034089b, in
[ros2_control_node-3] #11 Object "/opt/ros/humble/lib/libhardware_interface.so", at 0x7fe510355c3b, in
[ros2_control_node-3] #10 Object "/opt/ros/humble/lib/libhardware_interface.so", at 0x7fe51034e256, in hardware_interface::System::configure()
[ros2_control_node-3] #9 Object "/home/russ/Andy_ws/install/andino_base/lib/libdiffdrive_andino.so", at 0x7fe5086336f6, in andino_base::DiffDriveAndino::on_configure(rclcpp_lifecycle::State const&)
[ros2_control_node-3] #8 Object "/home/russ/Andy_ws/install/andino_base/lib/libmotor_driver.so", at 0x7fe5085f59d4, in andino_base::MotorDriver::Setup(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, int)
[ros2_control_node-3] #7 Object "/usr/lib/x86_64-linux-gnu/libserial.so.1.0.0", at 0x7fe5085b718e, in
[ros2_control_node-3] #6 Object "/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30", at 0x7fe5104ae4d7, in __cxa_throw
[ros2_control_node-3] #5 Object "/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30", at 0x7fe5104ae276, in std::terminate()
[ros2_control_node-3] #4 Object "/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30", at 0x7fe5104ae20b, in
[ros2_control_node-3] #3 Object "/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30", at 0x7fe5104a2b9d, in
[ros2_control_node-3] #2 Source "./stdlib/abort.c", line 79, in abort [0x7fe5100287f2]
[ros2_control_node-3] #1 Source "../sysdeps/posix/raise.c", line 26, in raise [0x7fe510042475]
[ros2_control_node-3] #0 | Source "./nptl/pthread_kill.c", line 89, in __pthread_kill_internal
[ros2_control_node-3] | Source "./nptl/pthread_kill.c", line 78, in __pthread_kill_implementation
[ros2_control_node-3] Source "./nptl/pthread_kill.c", line 44, in __pthread_kill [0x7fe510096a7c]
[ros2_control_node-3] Aborted (Signal sent by tkill() 15028 1000)
[ERROR] [ros2_control_node-3]: process has died [pid 15028, exit code -6, cmd '/opt/ros/humble/lib/controller_manager/ros2_control_node --ros-args --params-file /tmp/launch_params_qen6_tng --params-file /home/russ/Andy_ws/install/andino_control/share/andino_control/config/andino_controllers.yaml'].
[spawner-4] [INFO] [1691287692.990939580] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' node to exist
[spawner-4] [INFO] [1691287695.008092403] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' node to exist
[spawner-4] [INFO] [1691287697.025583887] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' node to exist
[spawner-4] [INFO] [1691287699.042514406] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' node to exist
[spawner-4] [ERROR] [1691287701.059553249] [spawner_joint_state_broadcaster]: Controller manager not available
[ERROR] [spawner-4]: process has died [pid 15030, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner joint_state_broadcaster --controller-manager /controller_manager --ros-args'].
[INFO] [spawner-5]: process started with pid [15060]
[spawner-5] [INFO] [1691287703.499772855] [spawner_diff_controller]: Waiting for '/controller_manager' node to exist
[spawner-5] [INFO] [1691287705.517221457] [spawner_diff_controller]: Waiting for '/controller_manager' node to exist
[spawner-5] [INFO] [1691287707.534490917] [spawner_diff_controller]: Waiting for '/controller_manager' node to exist
[spawner-5] [INFO] [1691287709.551582142] [spawner_diff_controller]: Waiting for '/controller_manager' node to exist
[spawner-5] [ERROR] [1691287711.567693704] [spawner_diff_controller]: Controller manager not available
[ERROR] [spawner-5]: process has died [pid 15060, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner diff_controller --controller-manager /controller_manager --ros-args'].
^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT)
[robot_state_publisher-1] [INFO] [1691288912.300928778] [rclcpp]: signal_handler(signum=2)
[twist_mux-2] [INFO] [1691288912.300951057] [rclcpp]: signal_handler(signum=2)
[INFO] [robot_state_publisher-1]: process has finished cleanly [pid 14974]
[INFO] [twist_mux-2]: process has finished cleanly [pid 14976]
Asked by Rodolfo8 on 2023-08-06 17:59:05 UTC
Comments
Looks to me this is the important part of the error messages:
I don't have that hw, nor robot, nor do I use the sw, but I'd suggest checking the serial connection is not already opened by something else, the port configured is correct, the "other side" (ie: on the arduino) is 'running' (whatever that may mean in this context), etc.
Asked by gvdhoorn on 2023-08-07 00:51:50 UTC
In addition to gvdhoom's comments, the port may not be open and just needs the following inelegant solution at least as a test.
sudo chmod 666 /dev/ttys0
of course with the actual name of the serial port you're trying to use.Asked by billy on 2023-08-08 22:37:31 UTC