1、安装moveit
sudo apt-get install ros-melodic-moveit
2、创建工作空间
mkdir -p ~/catkin_ws/src
cd catkin_ws/src
git clone -b melodic-devel https://github.com/ros-industrial/universal_robot.git
git clone -b calibration_devel https://github.com/fmauch/universal_robot.git src/fmauch_universal_robot
3、切换路径,检查依赖
cd ~/catkin_ws/
rosdep update
rosdep install --rosdistro melodic --ignore-src --from-paths src
4、编译
catkin_make
5、激活工作空间
source ~/catkin_ws/devel/setup.bash
6、仿真测试
分别在3个终端打开
#启动gazebo仿真环境
roslaunch ur_gazebo ur10.launch
#启动moveit规划执行文件
roslaunch ur10_moveit_config ur10_moveit_planning_execution.launch sim:=true
#启动rviz
roslaunch ur10_moveit_config moveit_rviz.launch config:=true