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:
/dev/serial/by-path/pci-0000\:05\:00.3-usb-0\:2\:1.0
error:
namdc@Nam20195107:~/project_arduino$ ros2 launch diffdrive_arduino diffbot.launch.py
[INFO] [launch]: All log files can be found below /home/namdc/.ros/log/2023-11-25-12-52-15-389354-Nam20195107-10120
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [ros2_control_node-1]: process started with pid [10123]
[INFO] [robot_state_publisher-2]: process started with pid [10125]
[INFO] [spawner-3]: process started with pid [10127]
[ros2_control_node-1] [INFO] [1700891536.231110072] [resource_manager]: Loading hardware 'DiffBot'
[ros2_control_node-1] [INFO] [1700891536.232843117] [resource_manager]: Initialize hardware 'DiffBot'
[ros2_control_node-1] [INFO] [1700891536.233266397] [resource_manager]: Successful initialization of hardware 'DiffBot'
[ros2_control_node-1] [INFO] [1700891536.233504397] [resource_manager]: 'configure' hardware 'DiffBot'
[ros2_control_node-1] [INFO] [1700891536.233545464] [DiffDriveArduinoHardware]: Configuring ...please wait...
[ros2_control_node-1] terminate called after throwing an instance of 'LibSerial::OpenFailed'
[ros2_control_node-1] what(): Bad file descriptor
[ros2_control_node-1] Stack trace (most recent call last):
[robot_state_publisher-2] [WARN] [1700891536.235810194] [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-2] [INFO] [1700891536.236364170] [robot_state_publisher]: got segment base_link
[robot_state_publisher-2] [INFO] [1700891536.236486892] [robot_state_publisher]: got segment caster_frontal_wheel
[robot_state_publisher-2] [INFO] [1700891536.236504515] [robot_state_publisher]: got segment caster_rear_wheel
[robot_state_publisher-2] [INFO] [1700891536.236517450] [robot_state_publisher]: got segment left_wheel
[robot_state_publisher-2] [INFO] [1700891536.236529713] [robot_state_publisher]: got segment right_wheel
[ros2_control_node-1] #22 Object "", at 0xffffffffffffffff, in
[ros2_control_node-1] #21 Object "/opt/ros/humble/lib/controller_manager/ros2_control_node", at 0x55ebb695dd84, in
[ros2_control_node-1] #20 Source "../csu/libc-start.c", line 392, in __libc_start_main_impl [0x7faad2c29e3f]
[ros2_control_node-1] #19 Source "../sysdeps/nptl/libc_start_call_main.h", line 58, in __libc_start_call_main [0x7faad2c29d8f]
[ros2_control_node-1] #18 Object "/opt/ros/humble/lib/controller_manager/ros2_control_node", at 0x55ebb695d89e, in
[ros2_control_node-1] #17 Object "/opt/ros/humble/lib/libcontroller_manager.so", at 0x7faad3657661, in controller_manager::ControllerManager::ControllerManager(std::shared_ptr, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, rclcpp::NodeOptions const&)
[ros2_control_node-1] #16 Object "/opt/ros/humble/lib/libcontroller_manager.so", at 0x7faad3656b2e, in controller_manager::ControllerManager::init_resource_manager(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)
[ros2_control_node-1] #15 Object "/opt/ros/humble/lib/libhardware_interface.so", at 0x7faad32f8900, in hardware_interface::ResourceManager::activate_all_components()
[ros2_control_node-1] #14 Object "/opt/ros/humble/lib/libhardware_interface.so", at 0x7faad32f80bb, in hardware_interface::ResourceManager::set_component_state(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, rclcpp_lifecycle::State&)
[ros2_control_node-1] #13 Object "/opt/ros/humble/lib/libhardware_interface.so", at 0x7faad32f95e2, in bool hardware_interface::ResourceStorage::set_component_state(hardware_interface::System&, rclcpp_lifecycle::State const&)
[ros2_control_node-1] #12 Object "/opt/ros/humble/lib/libhardware_interface.so", at 0x7faad330489b, in
[ros2_control_node-1] #11 Object "/opt/ros/humble/lib/libhardware_interface.so", at 0x7faad331aaeb, in
[ros2_control_node-1] #10 Object "/opt/ros/humble/lib/libhardware_interface.so", at 0x7faad3312776, in hardware_interface::System::configure()
[ros2_control_node-1] #9 Object "/home/namdc/project_arduino/install/diffdrive_arduino/lib/libdiffdrive_arduino.so", at 0x7faacd614b24, in diffdrive_arduino::DiffDriveArduinoHardware::on_configure(rclcpp_lifecycle::State const&)
[ros2_control_node-1] #8 Object "/home/namdc/project_arduino/install/diffdrive_arduino/lib/libdiffdrive_arduino.so", at 0x7faacd61765c, in ArduinoComms::connect(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, int, int)
[ros2_control_node-1] #7 Object "/usr/lib/x86_64-linux-gnu/libserial.so.1.0.0", at 0x7faacd5a40b3, in
[ros2_control_node-1] #6 Object "/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30", at 0x7faad30ae4d7, in __cxa_throw
[ros2_control_node-1] #5 Object "/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30", at 0x7faad30ae276, in std::terminate()
[ros2_control_node-1] #4 Object "/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30", at 0x7faad30ae20b, in
[ros2_control_node-1] #3 Object "/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30", at 0x7faad30a2b9d, in
[ros2_control_node-1] #2 Source "./stdlib/abort.c", line 79, in abort [0x7faad2c287f2]
[ros2_control_node-1] #1 Source "../sysdeps/posix/raise.c", line 26, in raise [0x7faad2c42475]
[ros2_control_node-1] #0 | Source "./nptl/pthread_kill.c", line 89, in __pthread_kill_internal
[ros2_control_node-1] | Source "./nptl/pthread_kill.c", line 78, in __pthread_kill_implementation
[ros2_control_node-1] Source "./nptl/pthread_kill.c", line 44, in __pthread_kill [0x7faad2c969fc]
[ros2_control_node-1] Aborted (Signal sent by tkill() 10123 1000)
[ERROR] [ros2_control_node-1]: process has died [pid 10123, exit code -6, cmd '/opt/ros/humble/lib/controller_manager/ros2_control_node --ros-args --params-file /tmp/launch_params_xpux93li --params-file /home/namdc/project_arduino/install/diffdrive_arduino/share/diffdrive_arduino/config/diffbot_controllers.yaml'].
[spawner-3] [INFO] [1700891538.812032991] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' node to exist
[spawner-3] [INFO] [1700891540.830612800] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' node to exist
[spawner-3] [INFO] [1700891542.849569356] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' node to exist
[spawner-3] [INFO] [1700891544.867227744] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' node to exist
[spawner-3] [ERROR] [1700891546.883473615] [spawner_joint_state_broadcaster]: Controller manager not available
[ERROR] [spawner-3]: process has died [pid 10127, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner joint_state_broadcaster --controller-manager /controller_manager --ros-args'].
[INFO] [spawner-4]: process started with pid [10167]
[INFO] [rviz2-5]: process started with pid [10169]
[rviz2-5] Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
[rviz2-5] [INFO] [1700891547.947906029] [rviz2]: Stereo is NOT SUPPORTED
[rviz2-5] [INFO] [1700891547.948230081] [rviz2]: OpenGl version: 4.6 (GLSL 4.6)
[rviz2-5] [INFO] [1700891547.987819732] [rviz2]: Stereo is NOT SUPPORTED
[rviz2-5] [ERROR] [1700891548.258911760] [rviz2]: The link is static or has unrealistic inertia, so the equivalent inertia box will not be shown.
[rviz2-5]
[rviz2-5] [ERROR] [1700891548.259194124] [rviz2]: The link is static or has unrealistic inertia, so the equivalent inertia box will not be shown.
[rviz2-5]
[spawner-4] [INFO] [1700891549.758581685] [spawner_diffbot_base_controller]: Waiting for '/controller_manager' node to exist
[spawner-4] [INFO] [1700891551.777160247] [spawner_diffbot_base_controller]: Waiting for '/controller_manager' node to exist
[spawner-4] [INFO] [1700891553.793324662] [spawner_diffbot_base_controller]: Waiting for '/controller_manager' node to exist
[spawner-4] [INFO] [1700891555.810854949] [spawner_diffbot_base_controller]: Waiting for '/controller_manager' node to exist
[spawner-4] [ERROR] [1700891557.828001767] [spawner_diffbot_base_controller]: Controller manager not available
[ERROR] [spawner-4]: process has died [pid 10167, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner diffbot_base_controller --controller-manager /controller_manager --ros-args'].