0
$\begingroup$

Rosanswers logo

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..


Originally posted by shahrol.baharom on ROS Answers with karma: 76 on 2021-10-08

Post score: 0


Original comments

Comment by Dragonslayer on 2021-10-09:
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?

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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


Originally posted by shahrol.baharom with karma: 76 on 2021-10-09

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.