ROS 中仿真 UR 机械臂

本文参考:UR5机械臂+ROS noetic+Ubuntu20.04+moveit实物和仿真驱动_little蔡的博客-CSDN博客

仿真环境:

本文使用的Ubantu版本:Ubuntu20.04

ros版本:ros-noetic-desktop-full,安装此版本ros无需再安装moveit运动规划库

创建工作空:

创建工作空间

进入工作空间并进行编译

mkdir -p ~/ur_ws/src
cd ~/ur_ws/
catkin_make

安装ur机械臂:

进入工作空间下载ur驱动

cd ~/catkin_ws/
git clone https://github.com/UniversalRobots/Universal_Robots_ROS_Driver.git src/Universal_Robots_ROS_Driver
git clone -b calibration_devel https://github.com/fmauch/universal_robot.git src/fmauch_universal_robot
git clone https://github.com/ros-industrial/ur_msgs.git src/ur_msgs
rosdep update
rosdep install --from-paths src --ignore-src -y

在使用rosdep install --from-paths src --ignore-src -y报错

 换一个指令执行:rosdep install --from-paths src --ignore-src -r -y

下载后进行编译

catkin_make

若缺少依赖项,需要安装相关依赖项(缺少啥安装啥),例如:

注意:需要将“_”改成“-”

 sudo apt install ros-noetic-scaled-joint-trajectory-controler

终端测试:

先 source 一下环境变量

source ./devel/setup.bash 

运行 Gazebo中的仿真模型

roslaunch ur_gazebo ur5_bringup.launch

 运行moveit运动规划

roslaunch ur5_moveit_config ur5_moveit_planning_execution.launch sim:=true

运行rviz并进行轨迹规划

roslaunch ur5_moveit_config moveit_rviz.launch config:=true

选择参考坐标系为base

 添加RobotModel和MotionPlanning

 

这时候在rviz中就能看到ur机械臂了

 在planning中选择manipulator,然后点击Plan和Execute可以拖动轨迹球让机械臂动起来

 ​​​

 同时可以看到Gazebo中的ur机械臂也动起来了

 

 

 

 

 

评论 10
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值