Example for using UR5e@ULFE with Pilz motion planner.
https://github.com/UniversalRobots/Universal_Robots_ROS_Driver
$ sudo apt install ros-melodic-moveit
http://wiki.ros.org/pilz_robots/Tutorials/MoveRobotWithPilzCommand_planner
$ sudo apt install ros-melodic-pilz-robots
Get calibration data from real robot.
$ roslaunch ur_calibration calibration_correction.launch robot_ip:=192.168.65.244 target_filename:="${HOME}/catkin_ws_ur5e/src/ur/ur5e_fe/calib/ur5e_1_calibration.yaml"
Launch robot ROS driver.
$ roslaunch ur_robot_driver ur5e_bringup.launch robot_ip:=192.168.65.244 kinematics_config:=$(rospack find ur5e_fe)/calib/ur5e_1_calibration.yaml
Load and run script on UR5e robot
feros/ros_connect.urp
Load and run Moveit with Pilz motion controller. At the same time Rviz is opened for moving the robot via GUI.
$ roslaunch ur5e_fe pilz_real_robot_ur5e.launch
Use python moveit interface to plan robot application
MoveIt help:
class MoveGroupCommander:
Check example:
$ roscd ur5e_fe
$ code ./scripts/main_ur5e.py
States of inputs are published on topic /ur_hardware_interface/io_states
$ rostopic echo /ur_hardware_interface/io_states
Tool inputs are numbered DI16 and DI17.
Outputs can be set via service /ur_hardware_interface/set_io
$ rosservice call /ur_hardware_interface/set_io "fun: 0 pin: 0 state: 0.0"
Service use ur_msgs/SetIO Service
(check documentation https://docs.ros.org/en/noetic/api/ur_msgs/html/srv/SetIO.html). Tool outputs are numbered DO16 and DO17.
To use in python a correct srv type needs to be imported:
from ur_msgs.srv import SetIO, SetIORequest
...
io_service = rospy.ServiceProxy('/ur_hardware_interface/set_io', SetIO)
...
msg = SetIORequest()
msg.fun = 1
msg.pin = 0
msg.state = 1.0
...
resp = io_service(msg)