aubo机械臂ROS功能包在melodic版本下编译问题解决
首先下载aubo_robot formelodic源码
https://github.com/fitsir/aubo_robot/tree/melodic
将下载下来的功能包放入自己的工作空间的src路径下
1、编译问题
1.1 编译报Cannot locate node of type [aubo_joint_trajectory_action] in package [aubo_controller]
1 2 | ERROR: cannot launch node of type [aubo_controller/aubo_joint_trajectory_action]: Cannot locate node of type [aubo_joint_trajectory_action] in package [aubo_controller]. Make sure file exists in package path and permission is set to executable (chmod +x) ERROR: cannot launch node of type [aubo_driver/aubo_driver]: Cannot locate node of type [aubo_driver] in package [aubo_driver]. Make sure file exists in package path and permission is set to executable (chmod +x) |
环境没有source的缘故,改完bash source以下,或者手动下发下面指令
1 | source devel/setup.bash |
1.2 编译报 libprotobuf.so.9库缺失
1 | libprotobuf.so.9, needed by /home/user6/clx_ws/src/aubo_robot-melodic/aubo_driver/lib/lib64/aubocontroller/libauborobotcontroller.so, not found (try using -rpath or -rpath-link) |
手动安装缺少的so.9库,,命令如下:
1 2 3 4 5 6 7 | $ sudo apt-get update //更新资源列表 $ sudo apt-get install gdebi //安装gdebi $ wget http://archive.ubuntu.com/ubuntu/pool/main/p/protobuf/libprotobuf9v5_2.6.1-1.3_amd64.deb //下载so.9 $ sudo gdebi ./libprotobuf9v5_2.6.1-1.3_amd64.deb //安装下载的so.9 |
备注1:gdebi是一个用于安装你自己手动下载的包的GUI程序
备注2:weget是linux下一个下载文件的工具
1.3 libmoveit_robot_trajectory.so.0.9.15库文件找不到
1 2 | PluginlibFactory: The plugin for class 'moveit_rviz_plugin/MotionPlanning' failed to load. Error: Failed to load library /opt/ros/melodic/lib/libmoveit_motion_planning_rviz_plugin.so. Make sure that you are calling the PLUGINLIB_EXPORT_CLASS macro in the library code, and that names are consistent between this macro and your XML. Error string: Could not load library (Poco exception = libmoveit_robot_trajectory.so.0.9.15: 无法打开共享对象文件: 没有那个文件或目录) Traceback (most recent call last): |
原因是
1 2 3 4 5 6 7 8 9 10 11 12 | cd /opt/ros/kinetic/lib sudo cp -r libmoveit_robot_trajectory.so.0.9.17 .. sudo cp -r libmoveit_robot_model.so.0.9.17 .. sudo cp -r libmoveit_robot_state.so.0.9.17 .. cd .. sudo mv libmoveit_robot_state.so.0.9.17 libmoveit_robot_state.so.0.9.15 sudo mv libmoveit_robot_model.so.0.9.17 libmoveit_robot_model.so.0.9.15 sudo mv libmoveit_robot_trajectory.so.0.9.17 libmoveit_robot_trajectory.so.0.9.15 sudo cp -r libmoveit_robot_state.so.0.9.15 lib/ sudo cp -r libmoveit_robot_model.so.0.9.15 lib/ sudo cp -r libmoveit_robot_trajectory.so.0.9.15 lib/ 1234567891011 |
其实就是将上述三个
1.4 libconfig.so.11找不到
1 | error while loading shared libraries: libconfig.so.11: cannot open shared object file: No such file or directory |
出现此类问题是因为libconfig.so.11库不存在或者存在但不在usr/lib的路径下,那就先搜下这个库的位置
1 | sudo find / -name libconfig.so.11 |
返回:
1 2 3 | /home/user6/.local/share/Trash/files/aubo_robotmelodic/aubo_driver/lib/lib64/config/libconfig.so.11 /home/user6/.local/share/Trash/files/aubo_driver/lib/lib64/config/libconfig.so.11 /home/user6/clx_ws/src/aubo_robot-melodic/aubo_driver/lib/lib64/config/libconfig.so.11 |
方法一:
可以新建一个文件夹,将分布在不同文件中的so文件都放进去,然后把这个文件夹路径加入到usr-libs.conf文件里去。
新建/usr/local/lib
1 | mkdir -p /usr/local/lib |
把so文件拷贝进去
1 | sudo cp /home/user6/.local/share/Trash/files/aubo_robotmelodic/aubo_driver/lib/lib64/config/libconfig.so.11 /usr/local/lib |
向库配置文件usr-libs.conf* 中加入新建的库路径
1 2 3 | vim /etc/ld.so.conf.d/usr-libs.conf* #最后一行加入: /usr/local/lib |
更新/etc/ld.so.cache文件
1 | ldconfig |
方法二:
创建共享库的链接,进入/usr/lib
1 | cd /usr/lib |
创建看所缺so库的链接
1 | ln -s /home/user6/.local/share/Trash/files/aubo_robotmelodic/aubo_driver/lib/lib64/config/libconfig.so.11 libconfig.so.11 |
2、运行roslaunch moveit_planning_execution.launch robot_ip:=127.0.0.1后报PluginlibFactory错误
1 | [ERROR] [1605760114.392227103]: PluginlibFactory: The plugin for class 'moveit_rviz_plugin/MotionPlanning' failed to load. Error: Failed to load library /opt/ros/melodic/lib/libmoveit_motion_planning_rviz_plugin.so. Make sure that you are calling the PLUGINLIB_EXPORT_CLASS macro in the library code, and that names are consistent between this macro and your XML. Error string: Could not load library (Poco exception = libmoveit_semantic_world.so.1.0.6: 无法打开共享对象文件: 没有那个文件或目录) |
使用find命令查找缺失的so库,发现没有1.0.6版本
1 2 3 4 | user6@ubuntu:~$ sudo find / -name libmoveit_semantic_world.so* [sudo] user6 的密码: find: ‘/run/user/1000/gvfs’: 权限不够 /opt/ros/melodic/lib/libmoveit_semantic_world.so |
使用下面的命令进行更新
1 2 | sudo apt-get update sudo apt-get dist-upgrade |
sudo apt-get dist-upgrade的作用为根据update更新的索引记录来下载并更新软件包,更新软件资源并且更新相关的依赖。更新完成后重新进行搜索,发现1.0.6已经正常安装了
1 2 3 4 5 | user6@ubuntu:~$ sudo find / -name libmoveit_semantic_world.so* [sudo] user6 的密码: find: ‘/run/user/1000/gvfs’: 权限不够 /opt/ros/melodic/lib/libmoveit_semantic_world.so /opt/ros/melodic/lib/libmoveit_semantic_world.so.1.0.6 |
3 运行仿真节点
1 | roslaunch aubo)moveit_config moveit_planning_execution.launch robot_ip:=127.0.0.1 |
1 | roslaunch aubo_gazebo aubo_i5_gazebo_control.launch |
4 参考资料
1、https://blog.csdn.net/cstone123/article/details/96139241?utm_medium=distribute.pc_relevant.none-task-blog-title-3&spm=1001.2101.3001.4242