ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Add serial port to ros2_control demo cause error

asked 2021-10-08 07:39:20 -0500

shahrol.baharom gravatar image

updated 2021-10-08 09:57:56 -0500

gvdhoorn gravatar image

Need Help, I use ros2_control demo diff_drive example, I create a serial port function file, compiling with no error but when I run it show an error:

[ros2_control_node-2] [INFO] [1633700315.468669177] [MobotSystemHardware]: Starting ...please wait...
[ros2_control_node-2] /home/shahrol/ros2_control_ws/install/controller_manager/lib/controller_manager/ros2_control_node: symbol lookup error: /home/shahrol/ros2_control_ws/install/mobot_hardware/lib/libmobot_hardware.so: undefined symbol: _ZN14mobot_hardware15MobotSerialPortC1Ev
[ERROR] [ros2_control_node-2]: process has died [pid 59942, exit code 127, cmd '/home/shahrol/ros2_control_ws/install/controller_manager/lib/controller_manager/ros2_control_node --ros-args --params-file /tmp/launch_params_u8ti5ohi --params-file /home/shahrol/ros2_control_ws/install/mobot_bringup/share/mobot_bringup/config/mobot_diff_drive_controller.yaml'].

I believe the error cause by this code I add , when remove it ok... but need to use for instantiate the serial port:

serial_port_ = std::make_shared<MobotSerialPort>();

I add this in start() function in hardware interface. If I remove it the program can run with no error.

Please Help..

edit retag flag offensive close merge delete

Comments

Iam looking at the same code base at the moment. Whitout your actual code its difficult. What does your analog to "mecanumbot_serial_port.hpp" look like, and its CMake?

Dragonslayer gravatar image Dragonslayer  ( 2021-10-09 06:39:55 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-10-09 07:52:55 -0500

shahrol.baharom gravatar image

I have solve the problem...... it is cause of serial_port.cpp is not added to cmakelist file. If you have same problem please check the cmakelist.txt file

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2021-10-08 07:39:20 -0500

Seen: 380 times

Last updated: Oct 09 '21