Skip to content

ZhefeiGong/UR_Robot_Arm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

71 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🦾 UR5e πŸ“

UR5e | Robotiq 2f-85 gripper

βš™οΈ Setting | UR5e

manual-en | manual-zh

πŸ”© Drive with Source Ros ➑️ ur5e_ws

1. Environment

  • UR5e
  • Ubuntu 20.04.6
  • Noetic
  • Python3.8

2. Intall ROS | Noetic | Ubuntu 20.04

Neotic Installation

#
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
# (or maybe we need the following due to the firewall)
# sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.ustc.edu.cn/ros/ubuntu/ `lsb_release -cs` main" > /etc/apt/sources.list.d/ros-latest.list'

#
sudo apt install curl # if you haven't already installed curl
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -

#
sudo apt update

#
sudo apt install ros-noetic-desktop-full

#
sudo apt search ros-noetic

#
source /opt/ros/noetic/setup.bash
echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
source ~/.bashrc

#
sudo apt install python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential
sudo apt install python3-rosdep
sudo rosdep init
rosdep update

3. Install moveit

sudo apt install ros-noetic-moveit

4. Install universal_robots_ros_driver | universal_robot

universal_robots_ros_driver | dirver_intro| universal_robot | real-time / linux

Binary-Version

# we set ${ROS_DISTRO} as noetic
sudo apt install ros-noetic-ur-robot-driver
sudo apt install ros-noetic-ur-calibration
sudo apt-get install ros-noetic-universal-robots
# set the source
source /opt/ros/${ROS_DISTRO}/setup.bash

πŸ”₯Development-VersionπŸ”₯

# source global ros
source /opt/ros/noetic/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 the description. 
git clone -b noetic-devel https://github.com/ros-industrial/universal_robot.git src/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
#@NOTICE : we need use the python/boost/... from ubuntu20.04 rather than anaconda
$ sudo gedit ~/.bashrc
#@NOTICE : remove the initialization of anaconda or any other environments

5. Simulation Test

# simulate the robot and environment in Gazebo
roslaunch ur_gazebo ur5e_bringup.launch
# use MoveIt for motion planning and control
roslaunch ur5e_moveit_config moveit_planning_execution.launch sim:=true
# finally visualize the whole process through RViz
roslaunch ur5e_moveit_config moveit_rviz.launch

6. Install External-Control on robot | link PC and robot through TCP-IP

External-Control | InstallGuide

#### CONNECT ROBOT and PC ####
# the PC IPv4 
address : 192.168.1.10
netmask : 255.255.255.0
gateway : 192.168.1.1
# the robot IPv4
address : 192.168.1.60
netmask : 255.255.255.0
gateway : 192.168.1.1

7. Communicate with the Robot | rs485

rs485 | Communication

# launch the ros score
roslaunch ur_robot_driver ur5e_bringup.launch  use_tool_communication:=true tool_voltage:=24 tool_parity:=0 tool_baud_rate:=115200 tool_stop_bits:=1 tool_rx_idle_chars:=1.5 tool_tx_idle_chars:=3.5 tool_device_name:=/tmp/ttyUR

# test the ttyUR connection
rosrun ur_robot_driver tool_communication

# utilize just like the true serial
rosrun imaginary_drivers rs485_node device:=/tmp/ttyUR

8. Prepare the ROS PC

Extract calibration information

roslaunch ur_calibration calibration_correction.launch robot_ip:=192.168.1.60 target_filename:="home/robot/my_robot_calibration.yaml"

9. Get Start

usage examples

Notice : the version of URSoftware for e-series robots should no less than 5.5.1, if not we can update the software version of the UR pad through updates

  • Starting the driver and visualizing the robot in RViz
  • Control the robot
  • Control the robot using MoveIt
#### Visualizing ####
# launch the driver
roslaunch ur_robot_driver ur5e_bringup.launch robot_ip:=192.168.1.60 kinematics_config:=/home/robot/my_robot_calibration.yaml
# in another terminal run rviz for visualization
roslaunch ur_robot_driver example_rviz.launch

#### Controling ####
rosrun ur_robot_driver test_move

#### Control the robot using Moveit ####
roslaunch ur_robot_driver ur5e_bringup.launch robot_ip:=192.168.1.60 kinematics_config:=/home/robot/my_robot_calibration.yaml

roslaunch ur5e_moveit_config moveit_planning_execution.launch

roslaunch ur5e_moveit_config moveit_rviz.launch rviz_config:=/home/robot/ur5e_ws/src/universal_robot/ur5e_moveit_config/launch/moveit.rviz

πŸ”© Drive with Python-urx

pythonb-urx | guideline-zh

πŸ”© Drive with ur_rtde ➑️ tele_ws

python-api | guideline

🀏 Setting | Gripper | Robotiq-2f-85

manual | through ur-ros

1. Robotiq Environment

github

# # official - only support until Melodic
# git clone https://github.com/ros-industrial/robotiq.git src/robotiq

# support for Noetic
git clone https://github.com/jr-robotics/robotiq.git src/robotiq

# 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

2. Connection

πŸ”₯Method-1πŸ”₯ : 2f-85 $\rightarrow$ rs485 $\rightarrow$ usb $\leftarrow$ computer csdn | ros_tutorial

Method-2 : 2f-85 $\rightarrow$ rs485 $\rightarrow$ tool communication $\leftarrow$ computer issue-1 | issue-2 | tool_communication

πŸ”₯Method-3πŸ”₯ : 2f-85 $\rightarrow$ rs485 $\rightarrow$ usb $\rightarrow$ pendant $\leftarrow$ 65332 $\leftarrow$ computer issue-1 | code

3. Run

# test the conection by Method-1
sudo usermod -a -G dialout $USER
dmesg | grep tty

# 
roscore

# run the node
rosrun robotiq_2f_gripper_control Robotiq2FGripperRtuNode.py /dev/ttyUSB0

# run the controller
rosrun robotiq_2f_gripper_control Robotiq2FGripperSimpleController.py

# run the listener 
rosrun robotiq_2f_gripper_control Robotiq2FGripperStatusListener.py

πŸ–²οΈ Setting | Teleoperation | 3D Connexion

refer to UR-Teleop | DiffsuionPolicy | through ur_rtde

1. Env Setting

  • ur_rtde
  • spnav
  • robotiq gripper | 3D Connexion spacemouse | ur5e

2. Build

  • download dependencies of spacemouse
sudo apt install libspnav-dev spacenavd; sudo systemctl start spacenavd
pip install spnav
  • check if spacemouse is connected to workstation
lsusb
  • download RTDE library
pip install ur_rtde

In the spnav library, PyCObject_AsVoidPtr is deprecated. find . -name spnav on terminal to find spnav folder. Replace all instances of PyCObject_AsVoidPtr with PyCapsule_GetPointer inΒ init.py

πŸ’» Coding

ROS | Robotics Operating System | tutorial

πŸ”§ Rospy Intro From GPT

  1. Initialize a ros Node rospy.init_node('node_name', anonymous=True)
  2. Publish the msg rospy.Publisher('chatter', String, queue_size=10)
  3. Subscribe the msg rospy.Subscriber('chatter', String, callback)
  4. Utilize the service
    • Server side rospy.Service('add_two_ints', AddTwoInts, handle_add_two_ints)
    • Client side rospy.wait_for_service('add_two_ints') rospy.ServiceProxy('add_two_ints', AddTwoInts)

πŸ”§ Debug

# show all of the topic we can use
rostopic list

# show a specific topic
rostopic info /topic_name
rostopic echo /topic_name
rostopic type /topic_name

# show the communication graph
rqtgraph

πŸ“– Reference

πŸ”© Drive with ur-ros ➑️ ur5e_ws

πŸ”© Drive with python-urx

πŸ”© Drive with ur_rtde ➑️ tele_ws

About

Deployment | UR5e | Robotiq 2f-85 gripper

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published