This is a template control package for sas_robot_driver_ur.
If you create a template of this repository, it will not automatically be up to date with the latest information. See https://github.com/MarinhoLab/sas_ur_control_template for the latest instructions.
Follow the installation requirements defined in the Pre-Requisites @ 📑 Wiki.
Clone SAS RO2 with Cloning Instructions @ 📑 Wiki.
cd ~/ros2_ws
colcon build
source install/setup.bash
Supposing that you created a repository called https://github.com/YOUR_USER/sas_ur_control_template.git based on this template, do
❗ If you're cloning a repository to push changes to Github, remember to set your ssh keys on Github. Otherwise the step below will not work.
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/src
git clone git@github.com:YOUR_USER/sas_ur_control_template.git
❗ This repository is a ROS2 package. If you change the name of the folder, you must remember to change the name on the package.xml and CMakeLists.txt otherwise colcon might misbehave.
- Open the scene
scenes/UR3_470rev4.ttton CoppeliaSim. Please be attentive of the version. - Start the simulation by clicking the start button.
ros2 launch sas_ur_control_template dummy_move_in_coppeliasim_example_cpp_launch.py
The robot should move as shown below.
ur3e_jointspace_sim.mp4
For using the real robot, you must have the risk assessments in place. This guide is meant to be helpful but holds absolutely no liability whatsoever. More details are available in the software license.
This code will move the robot. Be sure that the workspace is free and safe for operation. :exclamation: Be sure that the robot is in a joint configuration in which it will not hit itself or anything around it. Example picture:
- Be sure that the teaching pendant is in
Remove Controlmode. - Split the terminator into four screens. Now, the order matters.
a |
b |
|---|---|
c |
d |
- In
a, run the CoppeliaSim scenescenes/UR3_470rev4.tttand start the simulation. - In
b, runros2 launch sas_ur_control_template real_robot_launch.py- The emergency button must be held at all times.
- After some seconds of initialization, the robot will be active.
- In
c, runros2 launch sas_ur_control_template compose_with_coppeliasim_launch.py. This will connect the CoppeliaSim scene with the ros2 code. - In
d, runros2 run sas_ur_control_template joint_interface_example.py. The robot will move in a sine wave in joint space, with respect to its initial joint values.