ros2_control_node dies after launch

asked 2023-08-06 17:59:05 -0500

updated 2023-08-07 00:50:35 -0500

gvdhoorn gravatar image

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 ...
(more)
edit retag flag offensive close merge delete

Comments

Looks to me this is the important part of the error messages:

[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

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.

gvdhoorn gravatar image gvdhoorn  ( 2023-08-07 00:51:50 -0500 )edit

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.

billy gravatar image billy  ( 2023-08-08 22:37:31 -0500 )edit