赞
踩
ROS2中ros-dashing-driver不太会用,而且跟serial.h库中的api有些出入,因此找了鱼香ros的第三方库以及例程学习,特此记录期间遇到的问题以及解决办法。
sudo apt install libboost-dev
git clone https://github.com/fishros/fish_protocol.git
cd fish_protocol && mkdir build && cd build
cmake .. && sudo make install # 将安装到系统库
cd fish_protocol/examples/example_ros2/example_fish_protocol
colcon build
source install/setup.bash
ros2 run example_fish_protocol example_fish_protocol
报错1
编译例程功能包时,出现报错
undefined reference to symbol '_ZN5boost6system15system_categoryEv
....
解决办法
新开一个终端,如下出想路径
lin@pc:~/fish_protocol/examples/example_ros2/example_fish_protocol$ locate boost_system
/usr/lib/x86_64-linux-gnu/libboost_system.a
/usr/lib/x86_64-linux-gnu/libboost_system.so
/usr/lib/x86_64-linux-gnu/libboost_system.so.1.65.1
打开例程功能包下的CMakeLists.txt
target_link_libraries(example_fish_protocol
"fish_protocol"
//在此添加上述路径
/usr/lib/x86_64-linux-gnu/libboost_system.a
/usr/lib/x86_64-linux-gnu/libboost_system.so
/usr/lib/x86_64-linux-gnu/libboost_system.so.1.65.1
)
报错2
can't open shared object file: No such file or direction
解决办法
sudo sh -c "echo '/usr/local/lib' >> /etc/ld.so.conf"
sudo ldconfig
重新编译运行即可
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。