环境:Ubuntu20.04+noetic
1.下载官方提供的ur5模型:
https://github.com/ros-industrial/universal_robot
2.创建一个工作空间,并初始化:
mkdir -p 自定义空间名称/src
cd 自定义空间名称
catkin_make
3.在下载好的文件中,找到ur_description,把这个文件夹复制到工作空间的src目录中。
4.在 vscode 中打开,编译一下
5.修改 view_ur5.launch 文件中的 state_publisher
为 robot_state_publisher
6.运行roscore
7.运行 launch 文件,成功显示
sudo apt-get install ros-noedit-moveit
moveit_version
1.安装wstool:
sudo apt install python3-wstool
2.cd 进 src 目录:
wstool init .
wstool merge -t . https://raw.githubusercontent.com/ros-planning/moveit/master/moveit.rosinstall
wstool remove moveit_tutorials # this is cloned in the next section
wstool update -t .
注意,上面的方法是官方文档里的,在我实际安装时,网址可以换成:
https://github.com/ros-planning/moveit/blob/master/moveit.rosinstall
在使用wstool merge时,可能会出现错误,解决方法是:
直接把 moveit.rosinstall 文件中的内容复制到 src 目录下刚才建好的 .rosinstall 文件中,保存即可,然后继续remove等后续操作。
如果在clone 过程中出现访问失败的报错,解决方法是:
sudo apt-get install gnutls-bin
git config --global http.sslVerify false
git config --global http.postBuffer 1048576000
1.下载示例代码
cd ~/ws_moveit/src
git clone https://github.com/ros-planning/moveit_tutorials.git -b master
git clone https://github.com/ros-planning/panda_moveit_config.git -b melodic-devel
安装时发现,只需要执行第一条 clone 语句即可。
2.启动演示用的 launch 文件
roslaunch panda_moveit_config demo.launch rviz_tutorial:=true
解决:方法1:source一下
方法2:https://zhuanlan.zhihu.com/p/428391114
sudo apt install ros-noetic-franka-description
解决:
https://answers.ros.org/question/192369/moveit-rviz-plugin-error/
sudo apt-get install ros-noetic-moveit-visual-tools
sudo apt-get install ros-noetic-moveit-ros-visualization
安装中,报错:Failed to fetch
解决:https://blog.csdn.net/Davidietop/article/details/88909622
最后,顺利启动 rviz 界面,
在 RViz 显示选项卡中,按 Add :
从 moveit_ros_visualization 文件夹中,选择“MotionPlanning”作为 DisplayType。按“确定”。
可以看到机器人