参考连接:
https://blog.csdn.net/qq_33007107/article/details/96170248
问题
- 在参考连接中连接USB前需要激活USB
sudo chmod 777 /dev/ttyUSB0
- robotiq 硬件连接24V电
可直接与UR控制柜连接参考视频:
https://youtu.be/a48ZACSJqX0
一、安装
1. 工作空间
工作空间为catkin_ws
cd ~/taoxiantong/catkin_ws/src/
git clone https://github.com/ros-industrial/robotiq.git
rosdep install robotiq_modbus_rtu//该命令会查找安装robotiq_modbus_rtu包所需要的相关依赖
cd ~/taoxiantong/catkin_ws
catkin_make
遇到报错,按报错安装依赖。直至编译全部成功即可
一般为以下两个依赖
sudo apt-get install ros-kinetic-soem
sudo apt-get install ros-kinetic-socketcan-interface
2.串口配置
- 提供权限
sudo usermod -a -G dialout YOURUSERNAME
最后为自己使用者的名字
- 找出连接端口
sdmesg | grep tty
一般为ttyUSB0
- 给于权限
sudo chmod 777 /dev/ttyUSB0
二、使用
- 运行ROS服务
roscore
- 启动驱动话题
rosrun robotiq_2f_gripper_control Robotiq2FGripperRtuNode.py /dev/ttyUSB0
- 启动控制话题
rosrun robotiq_2f_gripper_control Robotiq2FGripperSimpleController.py
注:输入a激活夹爪。之后输入【0-255】间数字代表夹爪开合度。255为完全闭合。