概述
ubuntu18.04安装ROS Melodic,步骤:
1.设置你的 sources.list
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
2.设置密钥,安装curl,添加key
sudo apt install curl
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
3.更新源
sudo apt update
4.桌面完整安装:(推荐):ROS、rqt、rviz、机器人通用库、2D/3D 模拟器和 2D/3D 感知
sudo apt install ros-melodic-desktop-full
5.环境设置
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc
6.依赖库安装
sudo apt install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential
7.初始化 rosdep
sudo apt install python-rosdep
sudo rosdep init
rosdep update
8.测试是否安装成功
第一个终端
roscore
第二个终端
rosrun turtlesim turtlesim_node
第三个终端
rosrun turtlesim turtle_teleop_key
安装成功!!!
编译aubo包,步骤:
1.建立工作空间
#建立工作空间文件夹
mkdir -p aubo_ws
cd aubo_ws
mkdir src
cd src
2.git clone官方包,ubuntu16.04 git 分支:git clone -b kinetic,ubuntu18.04 git branch:git clone -b melodic
在src文件夹内克隆aubo包
git -b melodic https://github.com/AuboRobot/aubo_robot.git
#返回上一级u目录
cd ..
#开始编译
catkin_make
遇到的错误
CMake Error at /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by "aubo_msgs" with
any of the following names:
xxxx_xxxxConfig.cmake
xxxx_xxxx-config.cmake
解决方法:报错的原因是缺少xxxx_xxxx这个文件,以上类似错误都是缺少包
sudo apt-get install ros-melodic-xxxx-xxxxx
2.错误忘记截图了,大概意思是找不到 eigen3这个东西
解决方法:建立软链接,
#具体看你的文件路径
sudo ln -s /usr/local/include/eigen3/Eigen /usr/include/Eigen
sudo ln -s /usr/local/include/eigen3/unsupported /usr/include/unsupported
3.大概意思是在一个文件路径下找不到 libprotobuf.so.9在这里插入代码片,还有一个错误是lib/x86下找不到 libconfig.so.11
解决方法:在我云盘下载所需文件,移动到该文件路径下即可
https://drive.google.com/drive/folders/1Ci0dERHuLgqO66TAY_hs_6gulLDI5WXl?usp=sharing
4.编译成功后,roslaunch 后,aubo的urdf出不来
解决方法:缺少rviz工具包
sudo apt-get install ros-melodic-rviz #我记得是这个,大家可以Tab一下
5.缺少moveit
sudo apt-get install ros-melodic-moveit
6.roslaunch moveit_planning_execution.launch sim:=false robot_ip:=xxx.xxx.xx.xxx,稍微拖动模型,真实机械臂会遇到奇异点问题,示教器会报错
解决方法:aubo示教器版本太低了,aubo的github基本不更新,重点吐嘈这一点!!!我问的aubo技术人员要的更新包,大家可以下载到u盘,更新一下示教器即可
https://drive.google.com/drive/folders/1Ci0dERHuLgqO66TAY_hs_6gulLDI5WXl?usp=sharing
7.raise DistutilsError("Setup script exited with %s" % (v.args[0],))distutils.errors.DistutilsError: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-23ykqx51/pynacl/
解决方法:pip3 install --upgrade pip
8./usr/bin/ld: cannot find -lindustrial_robot_client collect2: error: ld returned 1 exit status
解决方法:sudo apt-get install ros-melodic-industrial-robot-client
9.expected unqualified-id before numeric constant #define EIGEN_HAS_XXX 1
解决方法:这个错误的出现由于我误卸载了ros-melodic-xxx一些库导致ros报错,重新安装ros-meolodic后,编译aubo包会报这个错,大概原因是Eigen3出现错误了,得卸载重装一下Eigen3库
#卸载Eigen3
sudo updatedb
locate eigen3
sudo rm -rf /usr/local/include/eigen3 /usr/include/eigen3
#安装Eigen,在Eigen官网下载eigen3.4.0
cd eigen-3.4.0
mkdir build && cd build
cmake ..
sudo make install
#建立软链接,不然编译会报:在/usr/include/找不的eigen3这个文件夹
sudo ln -s /usr/local/include/eigen3/Eigen /usr/include/Eigen
sudo ln -s /usr/local/include/eigen3 /usr/include/eigen3
sudo ln -s /usr/local/include/eigen3/unsupported /usr/include/unsupported
重新catkin_make即可成功
…
错误待更新,我编译的时候有很多错,忘记截图了(尴尬),大家遇到以上没有的错误可以带图私我,我应该能记起来!!
解决错误,全部安装成功后
启动终端:
cd aubo_ws
source devel/setup.sh
roslaunch aubo_i5_moveit_config moveit_planning_execution.launch sim:=false robot_ip:=192.168.99.254 ##ip地址根据机械臂所定
(在宿舍写的博客,没有在实验室连接aubo机械臂,连接后拖动模型,plan&execute后,机械臂会按照rviz规划的路径移动)
为了方便启动launch文件,可以把source指令加入系统变量中,启动终端后自动source
sudo gedit ~/.bashrc
#最后一行加入
source ~/aubo_ws/devel/setup.sh
到这ROS-Meloic和aubo官方包编译就完成了,下一节更新手眼标定!
最后
以上就是彪壮网络为你收集整理的aubo_i5机械臂无序抓取实践一:安装ros-meolodic,编译aubo包解决错误,全部安装成功后的全部内容,希望文章能够帮你解决aubo_i5机械臂无序抓取实践一:安装ros-meolodic,编译aubo包解决错误,全部安装成功后所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复