连接新款的e系列ur,需要新版的
Universal_Robots_ROS_Driver
驱动,原来的ur_Robots_Driver和ur_modern_driver不适用e系列。
Universal_Robots_ROS_Driver驱动:
https://github.com/UniversalRobots/Universal_Robots_ROS_Driver
请按照作者提供的详细信息安装驱动。
安装部分为:
# source global ros
$ source /opt/ros/<your_ros_version>/setup.bash
# create a catkin workspace
$ mkdir -p catkin_ws/src && cd catkin_ws
# clone the driver
$ git clone https://github.com/UniversalRobots/Universal_Robots_ROS_Driver.git src/Universal_Robots_ROS_Driver
# clone fork of the description. This is currently necessary, until the changes are merged upstream.
$ git clone -b calibration_devel https://github.com/fmauch/universal_robot.git src/fmauch_universal_robot
# install dependencies
$ sudo apt update -qq
$ rosdep update
$ rosdep install --from-paths src --ignore-src -y
# build the workspace
$ catkin_make
# activate the workspace (ie: source it)
$ source devel/setup.bash
https://scazlab.github.io/ur5e_setup_guide.html
这个文档说明的非常清楚,把需要的依赖项、步骤都告知。
或许是pc端与机械臂的ip设置不正确导致无法连通:
如:pc端的ip地址为192.168.62.128
在ubuntu里使用 ifconfig 查看你的ip。
如果是使用虚拟机,则先将虚拟机的网络适配器设置为桥接模式。
网线连接ur5e后,将ubuntu有线设置ipv4方式设置为手动,地址设置为pc端的ip地址即可。
在ur5e机械臂里,设置通信,设置机械臂静态地址ip与pc的ip在同一频段
在external_control里,设置ip为连接的pc的ip(需要机械臂提前安装external_control)
ping机械臂出现的问题:
若设置桥接模式后,虚拟机不知道桥接哪个网口(连接机械臂的有线、window下的无线),需要提前设置桥接有线连接的网口
若使用特定虚拟网络也需设置识别网口:
add MotionPlanning
在MotionPlanning将Planning Group 从endeffector改为manipulator
1.安装moveit controllersudo apt-get install ros-melodic-ros-control ros-melodic-ros-controllers
注意对应版本为melodic,不同版本更改即可[1]
2.在控制板的external_control程序前,加入机械臂移动控制
[1]https://blog.csdn.net/weixin_45462252/article/details/103845267?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-4.control&dist_request_id=1328642.52327.16157919869816973&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-4.control
python程序[1]
#socket通讯所需的包
import socket
#定义了UR机器人的地址和端口
target_ip = ("192.168.100.2" , 30003)
#建立一个socket对象
sk = socket.socket()
#建立连接
sk.connect(target_ip)
#这是发送给UR机器人的一个脚本指令
send_data1 = '''
def svt():
movej(p[0.4,0.4,0.7,3.14,-1.57,1.57],a=1.4, v=1.05, t=0, r=0)
movej([0,-1.1,0,-1,0,0])
end
'''
#发送指令,并将字符串转变格式
同时注意讲数控版上机械臂的控制模式从本地控制调成远程控制[2]。
参考链接:[1]https://blog.csdn.net/qq_41685265/article/details/104327982
[2]https://www.universal-robots.com/articles/ur/interface-communication/remote-control-via-tcpip/