https://sdurobotics.gitlab.io/ur_rtde/introduction/introduction.html
sudo add-apt-repository ppa:sdurobotics/ur-rtde
sudo apt-get update
sudo apt install librtde librtde-dev
then will output the hint to install
A C++ interface for sending and receiving data to/from a UR robot using the Real-Time Data Exchange (RTDE) interface of the robot.
更多信息: https://launchpad.net/~sdurobotics/+archive/ubuntu/ur-rtde
按 [ENTER] 继续或 Ctrl-c 取消安装
press [ENTER] to continue or [Ctrl-c] to cancel install
- Boost
- pybind11
The pybind11 dependency is optional and are only required if ur_rtde are to be used with Python. The ur_rtde library depends on Boost for networking and threading.
You can install Boost on Ubuntu using:
sudo apt-get install libboost-all-dev
(Optionally) if you want to use ur_rtde with Python make sure pybind11 is checked out from the submodule before attempting to build using:
git submodule update --init --recursive
git clone https://gitlab.com/sdurobotics/ur_rtde.git
cd ur_rtde
git submodule update --init --recursive
mkdir build
cd build
cmake ..
make
sudo make install
Sometimes, network issues may cause the sudo make install
command to fail when downloading pybind11. In such cases, You can use the compressed package pybind11.zip
or you may need to manually download it using a proxy or other methods.
[submodule "pybind11"]
path = pybind11
url = https://github.com/pybind/pybind11.git
branch = stable
unzip or download this file in ur_rtde library, relative path: UR5_control/ur_rtde/pybind11
import rtde_control
import rtde_receive
# connect to UR5
rtde_c = rtde_control.RTDEControlInterface("192.168.1.254")
rtde_r = rtde_receive.RTDEReceiveInterface("192.168.1.254")
python moveJ.py # joint angle control
python moveL.py # position control
python control_feedback.py # Continuous movement with closed-loop detection of position accuracy
python get_joint.py # obtain UR5 joint
python get_pose.py # obtain 6 Dof pose
python get_tcp.py # obtain TCP pose
python status.py # obtain real-time status of UR5
python teach.py # enable or disable teach mode
python pose2joint.py # inverse kinematics
python object2hand.py # calculate grasping pose based on the object's 6Dof pose
python pick_and_place.py # connected with gripper to pick and place object
python power_off.py # turn off UR5
ur5_merge.py