
ROS驱动实体UR5e机械臂
机械臂UR5e相关的ROS功能包及插件,进行仿真和实物的驱动。
前言
下载机械臂UR5e相关的ROS功能包及插件,进行仿真和实物的驱动
一、ROS功能包
1.在github上直接下载:
下载Universal_Robots_ROS_Driver
https://gitcode.net/mirrors/UniversalRobots/Universal_Robots_ROS_Driver?utm_source=csdn_github_accelerator
下载universal_robot(melodic或melodic-devel)
https://github.com/ros-industrial/universal_robot/tree/melodic-devel
2.通过命令操作克隆下载:
在桌面环境下直接打开一个终端,通过命令建立一个工作空间(我这里命名为catkin_ws),并在这个包里建立一个src文件夹。运行以下命令后,新建的文件夹就在主目录下(新建文件夹不在桌面上)
mkdir -p catkin_ws/src
切换到工作空间环境下,通过以下命令安装几个关键的功能包(后面还需根据编译错误提示下载相关功能包)
cd catkin_ws
#克隆新版驱动功能包
git clone https://github.com/UniversalRobots/Universal_Robots_ROS_Driver.git src/Universal_Robots_ROS_Driver
#克隆主要功能包(fmauch或者melodic)
git clone -b calibration_devel https://github.com/fmauch/universal_robot.git src/fmauch_universal_robot
git clone -b melodic-devel https://github.com/ros-industrial/universal_robot.git
#下载依赖包
sudo apt update -qq
rosdep update
rosdep install --from-paths src --ignore-src -y
#编译
catkin_make
二、控制器插件安装
下载externalcontrol-1.0.urcap插件,并安装到示教器内
https://github.com/UniversalRobots/Universal_Robots_ExternalControl_URCap/releases
三、测试仿真
在工作空间环境内分别运行以下三条命令
source dedevel/setup.bash
roslaunch ur_gazebo ur5e_bringup.launch limited:=true
source dedevel/setup.bash
roslaunch ur5e_moveit_config ur5e_moveit_planning_execution.launch sim:=true limited:=true
source dedevel/setup.bash
roslaunch ur5e_moveit_config moveit_rviz.launch config:=true
此时,Rviz里未显示模型,且有报错。Fixed Frame选择base_link,报错消除;添加RobotModel,出现模型。
这时模型末端没有托球,不能进行拖动示教。添加MotionPlanning,规划组名选择manipulator,托球出现。
四、驱动UR5e前的通讯设置
PC端通讯设置:
地址:192.168.56.3
子网掩码:255.255.0.0
网关:192.168.56.3
在终端下输入ifconfig,查看设置的IP地址
设置ployscope:
网络IP地址要与PC端的IP地址相同
设置External Control的IP地址。这个地址要与PC端的要完全相同,端口号50002默认不变,Host name与PC主机名称同名。
五、ROS驱动实体机械臂
驱动机械臂之前先ping一下,查看PC与UR控制器是否连接。
# 地址是示教器上的IP地址
ping 192.168.56.1
首次使用ROS包驱动机械臂,需要先做标定,保证ROS模型初始位姿与实体机械臂初始位姿一致,IP地址要写对,运行完成后会自动生成对应的yaml文件。
roslaunch ur_calibration calibration_correction.launch robot_ip:=192.168.56.1 target_filename:="$(rospack find ur_robot_driver)/calibration/my_robot_calibration.yaml"
在示教器里新建一个控制程序,点击播放按钮,机械臂只会运行完MoveJ,运行Control by vittore会显示通讯拒绝(还没有与ROS连接,点取消就好,左下角显示“正常”)
先启动driver包里的launch文件,出现如图所示表示运行正常
roslaunch ur_robot_driver ur5e_bringup.launch robot_ip:=192.168.56.1
点击示教器的播放按钮,速度100%(这时候左下角显示“正在运行”),此时控制器已与ROS建立了连接,正等待ROS发布命令
再分别运行以下命令,打开rviz
roslaunch ur5e_moveit_config ur5e_moveit_planning_execution.launch
roslaunch ur5e_moveit_config moveit_rviz.launch
通过编辑关节参数调整机械臂姿态
更多推荐
所有评论(0)