Skip to content

Commit d774303

Browse files
author
Felix Exner (fexner)
authored
Update and thin down README (#494)
Avoid duplication between README and package doc. * Updated documentation about fake_hardware and MoveIt! * Remove trailing WS * [documentation] do not suggest -r for rosdep install * Added note about tool0_controller to docs. * Add additional part about calibration to toplevel README. * Added note about sourcing ROS in build instructions
1 parent 60c0509 commit d774303

File tree

3 files changed

+81
-216
lines changed

3 files changed

+81
-216
lines changed

README.md

Lines changed: 62 additions & 173 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ Check also [presentations and videos](ur_robot_driver/doc/resources/README.md) a
117117

118118
**NOTE**: There are three build stages checking current and future compatibility of the driver.
119119

120-
1. Binary builds - against released packages (main and testing) in ROS distributions. Shows that direct local build is possible.
120+
1. Binary builds - against released packages (main and testing) in ROS distributions. Shows that
121+
direct local build is possible and is the most relevant workflow for users.
121122

122123
Uses repos file: `src/Universal_Robots_ROS2_Driver/Universal_Robots_ROS2_Driver-not-released.<ros-distro>.repos`
123124

@@ -143,35 +144,85 @@ Deprecation: The `ur_bringup` package is deprecated and will be removed from Iro
143144

144145
## Getting Started
145146

146-
1. [Install ROS2 Rolling](https://docs.ros.org/en/rolling/Installation/Ubuntu-Install-Debians.html).
147+
For getting started, you'll basically need three steps:
148+
149+
1. **Install the driver** (see below). You can either install this driver from binary packages or build it from source. We recommend a
150+
binary package installation unless you want to join development and submit changes.
151+
152+
2. **Start & Setup the robot**. Once you've installed the driver, [setup the
153+
robot](https://docs.ros.org/en/ros2_packages/rolling/api/ur_robot_driver/installation/robot_setup.html)
154+
155+
Please do this step carefully and extract the calibration as explained
156+
[here](https://docs.ros.org/en/ros2_packages/rolling/api/ur_robot_driver/installation/robot_setup.html#extract-calibration-information).
157+
Otherwise the TCP's pose will not be correct inside the ROS ecosystem.
158+
159+
If no real robot is required, you can [use a simulated
160+
robot](https://docs.ros.org/en/ros2_packages/rolling/api/ur_robot_driver/usage.html#usage-with-official-ur-simulator)
161+
that will behave almost exactly like the real robot.
162+
163+
164+
3. **Start the driver**. See the [usage
165+
documentation](https://docs.ros.org/en/ros2_packages/rolling/api/ur_robot_driver/usage.html) for
166+
details.
167+
168+
### Install from binary packages
169+
1. [Install ROS2](https://docs.ros.org/en/rolling/Installation/Ubuntu-Install-Debians.html). This
170+
branch supports only ROS2 Humble and Rolling. For other ROS2 versions, please see the respective
171+
branches.
172+
2. Install the driver using
173+
```
174+
sudo apt-get install ros-${ROS_DISTRO}-ur-robot-driver
175+
```
176+
177+
### Build from source
178+
Before building from source please make sure that you actually need to do that. Building from source
179+
might require some special treatment, especially when it comes to dependency management.
180+
Dependencies might change from time to time. Upstream packages (such as the library) might change
181+
their features / API which require changes in this repo. Therefore, this repo's source builds might
182+
require upstream repositories to be present in a certain version as otherwise builds might fail.
183+
Starting from scratch following exactly the steps below should always work, but simply pulling and
184+
building might fail occasionally.
185+
186+
1. [Install ROS2](https://docs.ros.org/en/rolling/Installation/Ubuntu-Install-Debians.html).
147187
For using this driver with ROS2 `foxy`. Checkout [foxy
148188
branch](https://github.com/UniversalRobots/Universal_Robots_ROS2_Driver/tree/foxy), for using it
149189
with ROS2 ``galactic``, use the [galactic branch](https://github.com/UniversalRobots/Universal_Robots_ROS2_Driver/tree/galactic), for using it
150190
with ROS2 ``humble``, use the [galactic branch](https://github.com/UniversalRobots/Universal_Robots_ROS2_Driver/tree/humble).
151191

152-
2. Make sure that `colcon`, its extensions and `vcs` are installed:
192+
Once installed, please make sure to actually [source ROS2](https://docs.ros.org/en/rolling/Tutorials/Beginner-CLI-Tools/Configuring-ROS2-Environment.html#source-the-setup-files) before proceeding.
193+
194+
3. Make sure that `colcon`, its extensions and `vcs` are installed:
153195
```
154196
sudo apt install python3-colcon-common-extensions python3-vcstool
155197
```
156198

157-
3. Create a new ROS2 workspace:
199+
4. Create a new ROS2 workspace:
158200
```
159201
export COLCON_WS=~/workspace/ros_ur_driver
160202
mkdir -p $COLCON_WS/src
161203
```
162204

163-
4. Pull relevant packages, install dependencies, compile, and source the workspace by using:
205+
5. Clone relevant packages, install dependencies, compile, and source the workspace by using:
164206
```
165207
cd $COLCON_WS
166208
git clone https://github.com/UniversalRobots/Universal_Robots_ROS2_Driver.git src/Universal_Robots_ROS2_Driver
167209
vcs import src --skip-existing --input src/Universal_Robots_ROS2_Driver/Universal_Robots_ROS2_Driver-not-released.${ROS_DISTRO}.repos
168210
rosdep update
169-
rosdep install --ignore-src --from-paths src -y -r
211+
rosdep install --ignore-src --from-paths src -y
170212
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
171213
source install/setup.bash
172214
```
173215

174-
## Using MoveIt
216+
6. When consecutive pulls leads to build errors, please make sure to update the upstream packages before
217+
filing an issue:
218+
```
219+
cd $COLCON_WS
220+
vcs import src --skip-existing --input src/Universal_Robots_ROS2_Driver/Universal_Robots_ROS2_Driver-not-released.${ROS_DISTRO}.repos
221+
rosdep update
222+
rosdep install --ignore-src --from-paths src -y
223+
```
224+
225+
## MoveIt! support
175226

176227
[MoveIt!](https://moveit.ros.org) support is built-in into this driver already.
177228
Watch MoveIt in action with the Universal Robots ROS2 driver:
@@ -180,161 +231,10 @@ Watch MoveIt in action with the Universal Robots ROS2 driver:
180231

181232
*The video shows free-space trajectory planning around a modeled collision scene object using the MoveIt2 MotionPlanning widget for Rviz2.*
182233

183-
184-
### Real robot / URSim
185-
To test the driver with the example MoveIt-setup, first start the driver as described
186-
[below](#connect-to-external-control-via-urcap).
187-
```
188-
ros2 launch ur_moveit_config ur_moveit.launch.py ur_type:=ur5e launch_rviz:=true
189-
```
190-
Now you should be able to use the MoveIt Plugin in rviz2 to plan and execute trajectories with the
191-
robot as explained [here](https://moveit.picknik.ai/galactic/doc/tutorials/quickstart_in_rviz/quickstart_in_rviz_tutorial.html).
192-
193-
## Network Setup
194-
195-
There are many possible ways to connect a UR robot. This section describes a good example using static IP addresses and a direct connection from the PC to the Robot to minimize latency introduced by network hardware. Though a good network switch usually works fine, as well.
196-
197-
1. Connect the UR control box directly to the remote PC with an ethernet cable.
198-
199-
2. Open the network settings from the UR teach pendant (Setup Robot -> Network) and enter these settings:
200-
201-
```
202-
IP address: 192.168.1.102
203-
Subnet mask: 255.255.255.0
204-
Default gateway: 192.168.1.1
205-
Preferred DNS server: 192.168.1.1
206-
Alternative DNS server: 0.0.0.0
207-
```
208-
209-
3. On the remote PC, turn off all network devices except the "wired connection", e.g. turn off wifi.
210-
211-
4. Open Network Settings and create a new Wired connection with these settings. You may want to name this new connection `UR` or something similar:
212-
213-
```
214-
IPv4
215-
Manual
216-
Address: 192.168.1.101
217-
Netmask: 255.255.255.0
218-
Gateway: 192.168.1.1
219-
```
220-
221-
5. Verify the connection from the PC with e.g. ping.
222-
223-
```
224-
ping 192.168.1.102
225-
```
226-
227-
## Connect to External Control via URCap
228-
229-
This section describes installation and launching of the URCap program from the pendant. It allows ROS to control the robot externally. Generally, you will launch the driver via ROS then start URCap from the pendant.
230-
231-
1. To enable external control of the UR robot from a remote PC you need to install the [**externalcontrol-1.0.5.urcap**](/ur_robot_driver/resources) which can be downloaded from [Universal_Robots_ExternalControl_URCap](https://github.com/UniversalRobots/Universal_Robots_ExternalControl_URCap/releases).
232-
233-
**Note:** For installing this URCap a minimal PolyScope version of 3.7 or 5.1 (in case of e-Series) is necessary.
234-
235-
2. For installing the necessary URCap and creating a program, please see the individual tutorial on how to [setup a CB3 robot](/ur_robot_driver/doc/installation/install_urcap_cb3.rst) or how to [setup an e-Series robot](/ur_robot_driver/doc/installation/install_urcap_e_series.rst)
236-
237-
3. On the remote PC, launch the suitable launch file which starts the robot driver and controllers (see details in [Usage](#usage) section).
238-
239-
4. From the Program Robot tab of the teach pendant, load `external_control.urp`. Click on the "Control by..." section of the program to check the Host IP of the external PC. If it needs to be modified, make the modification under the Installation tab (as prompted on screen). You do not need to modify the Custom Port.
240-
241-
5. When the Host IP is correct, click the play button to connect with the external PC.
242-
243-
## Usage
244-
245-
For starting the driver there are two main launch files in the `ur_robot_driver` package.
246-
247-
- `ur_control.launch.py` - starts ros2_control node including hardware interface, joint state broadcaster and a controller. This launch file also starts `dashboard_client` if real robot is used.
248-
- `ur_dashboard_client.launch.py` - start the dashboard client for UR robots.
249-
250-
Also, there are predefined launch files for all supported types of UR robots.
251-
252-
The arguments for launch files can be listed using `ros2 launch ur_robot_driver <launch_file_name>.launch.py --show-args`.
253-
The most relevant arguments are the following:
254-
255-
- `ur_type` (*mandatory*) - a type of used UR robot (*ur3*, *ur3e*, *ur5*, *ur5e*, *ur10*, *ur10e*, or *ur16e*).
256-
- `robot_ip` (*mandatory*) - IP address by which the root can be reached.
257-
- `use_fake_hardware` (default: *false*) - use simple hardware emulator from ros2_control.
258-
Useful for testing launch files, descriptions, etc. See explanation below.
259-
- `initial_positions` (default: dictionary with all joint values set to 0) - Allows passing a dictionary to set the initial joint values for the fake hardware from [ros2_control](http://control.ros.org/). It can also be set from a yaml file with the `load_yaml` commands as follows:
260-
```
261-
<xacro:property name="initial_positions" value="${load_yaml(initial_positions_file)}"/>
262-
```
263-
In this example, the **initial_positions_file** is a xacro argument that contains the absolute path to a yaml file. An example of the initial positions yaml file is as follows:
264-
```
265-
elbow_joint: 1.158
266-
shoulder_lift_joint: -0.953
267-
shoulder_pan_joint: 1.906
268-
wrist_1_joint: -1.912
269-
wrist_2_joint: -1.765
270-
wrist_3_joint: 0.0
271-
```
272-
273-
- `fake_sensor_commands` (default: *false*) - enables setting sensor values for the hardware emulators.
274-
Useful for offline testing of controllers.
275-
- `robot_controller` (default: *joint_trajectory_controller*) - controller for robot joints to be started.
276-
Available controllers: *joint_trajectory_controller*, *scaled_joint_trajectory_controller*.
277-
Note: *joint_state_broadcaster*, *speed_scaling_state_broadcaster*, *force_torque_sensor_broadcaster*, and *io_and_status_controller* will always start.
278-
279-
*HINT*: list all loaded controllers using `ros2 control list_controllers` command.
280-
281-
**NOTE**: The package can simulate hardware with the ros2_control `FakeSystem`. This emulator enables an environment for testing of "piping" of hardware and controllers, as well as testing robot's descriptions. For more details see [ros2_control documentation](https://ros-controls.github.io/control.ros.org/) for more details.
282-
283-
### Example Commands for Testing the Driver
284-
285-
Allowed UR-Type strings: `ur3`, `ur3e`, `ur5`, `ur5e`, `ur10`, `ur10e`, `ur16e`.
286-
287-
##### 1. Start hardware, simulator or mockup
288-
289-
- To do test with hardware, use:
290-
```
291-
ros2 launch ur_robot_driver ur_control.launch.py ur_type:=<UR_TYPE> robot_ip:=<IP_OF_THE_ROBOT> launch_rviz:=true
292-
```
293-
For more details check the argument documentation with `ros2 launch ur_robot_driver ur_control.launch.py --show-arguments`
294-
295-
After starting the launch file start the external_control URCap program from the pendant, as described above.
296-
297-
- To do an offline test with URSim check details about it in [this section](#usage-with-official-ur-simulator)
298-
299-
- To use mocked hardware (capability of ros2_control), use `use_fake_hardware` argument, like:
300-
```
301-
ros2 launch ur_robot_driver ur_control.launch.py ur_type:=ur5e robot_ip:=yyy.yyy.yyy.yyy use_fake_hardware:=true launch_rviz:=true
302-
```
303-
304-
**NOTE**: Instead of using the global launch file for control stack, there are also prepeared launch files for each type of UR robots named. They accept the same arguments are the global one and are used by:
305-
```
306-
ros2 launch ur_robot_driver <ur_type>.launch.py
307-
```
308-
309-
##### 2. Sending commands to controllers
310-
311-
Before running any commands, first check the controllers' state using `ros2 control list_controllers`.
312-
313-
- Send some goal to the Joint Trajectory Controller by using a demo node from [ros2_control_demos](https://github.com/ros-controls/ros2_control_demos) package by starting the following command in another terminal:
314-
```
315-
ros2 launch ur_robot_driver test_joint_trajectory_controller.launch.py
316-
```
317-
After a few seconds the robot should move.
318-
319-
- To test another controller, simply define it using `initial_joint_controller` argument, for example when using fake hardware:
320-
```
321-
ros2 launch ur_robot_driver ur_control.launch.py ur_type:=ur5e robot_ip:=yyy.yyy.yyy.yyy initial_joint_controller:=joint_trajectory_controller use_fake_hardware:=true launch_rviz:=true
322-
```
323-
And send the command using demo node:
324-
```
325-
ros2 launch ur_robot_driver test_scaled_joint_trajectory_controller.launch.py
326-
```
327-
After a few seconds the robot should move (or jump when using emulation).
328-
329-
330-
##### 3. Using only robot description
331-
332-
If you just want to test description of the UR robots, e.g., after changes you can use the following command:
333-
```
334-
ros2 launch ur_description view_ur.launch.py ur_type:=ur5e
335-
```
336-
## Usage with official UR simulator
337-
For using the driver with the URSim docker image please follow instructions [here](https://docs.ros.org/en/ros2_packages/rolling/api/ur_robot_driver/usage.html#usage-with-official-ur-simulator).
234+
See the [MoveIt!
235+
section](https://docs.ros.org/en/ros2_packages/rolling/api/ur_robot_driver/usage.html#using-moveit)
236+
of the [Usage
237+
guide](https://docs.ros.org/en/ros2_packages/rolling/api/ur_robot_driver/usage.html) for details.
338238

339239
## Expected Changes in the Near Future
340240

@@ -352,14 +252,3 @@ Prepare the pre-commit formatting to run like this:
352252
```
353253
pre-commit install`
354254
```
355-
356-
## CI setup
357-
358-
There are three build stages checking current and future compatibility of the driver.
359-
360-
1. Binary builds - against released packages (main and testing) in ROS distributions. Shows that direct local build is possible.
361-
362-
1. Semi-binary builds - against released core ROS packages (main and testing), but the immediate dependencies are pulled from source.
363-
Shows that local build with dependencies is possible and if fails there we can expect that after the next package sync we will not be able to build.
364-
365-
1. Source build - also core ROS packages are build from source. It shows potential issues in the mid future.

ur_robot_driver/doc/installation/robot_setup.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ inside a colcon workspace).
7171
Extract calibration information
7272
-------------------------------
7373

74+
.. _calibration_extraction:
75+
7476
Each UR robot is calibrated inside the factory giving exact forward and inverse kinematics. To also
7577
make use of this in ROS, you first have to extract the calibration information from the robot.
7678

ur_robot_driver/doc/usage.rst

Lines changed: 17 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -191,52 +191,26 @@ To test the driver with the example MoveIt-setup, first start the driver as desc
191191
Now you should be able to use the MoveIt Plugin in rviz2 to plan and execute trajectories with the
192192
robot as explained `here <https://moveit.picknik.ai/galactic/doc/tutorials/quickstart_in_rviz/quickstart_in_rviz_tutorial.html>`_.
193193

194-
Fake hardware on ROS2 Galactic
195-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
194+
Fake hardware
195+
^^^^^^^^^^^^^
196196

197-
Currently, the ``scaled_joint_trajectory_controller`` does not work on ROS2 Galactic. There is an
198-
`upstream Merge-Request <https://github.com/ros-controls/ros2_control/pull/635>`_ pending to fix that. Until this is merged and released, please change the
199-
default controller in the `controllers.yaml <ur_moveit_config/config/controllers.yaml>`_ file. Make
200-
sure that the ``default`` field is assigned ``true`` for the ``joint_trajectory_controller`` and ``false``
201-
for the
202-
``scaled_joint_trajectory_controller``.
203-
204-
.. code-block::
205-
206-
controller_names:
207-
- scaled_joint_trajectory_controller
208-
- joint_trajectory_controller
209-
210-
211-
scaled_joint_trajectory_controller:
212-
action_ns: follow_joint_trajectory
213-
type: FollowJointTrajectory
214-
default: false
215-
joints:
216-
- shoulder_pan_joint
217-
- shoulder_lift_joint
218-
- elbow_joint
219-
- wrist_1_joint
220-
- wrist_2_joint
221-
- wrist_3_joint
222-
223-
224-
joint_trajectory_controller:
225-
action_ns: follow_joint_trajectory
226-
type: FollowJointTrajectory
227-
default: true
228-
joints:
229-
- shoulder_pan_joint
230-
- shoulder_lift_joint
231-
- elbow_joint
232-
- wrist_1_joint
233-
- wrist_2_joint
234-
- wrist_3_joint
235-
236-
Then start
197+
Currently, the ``scaled_joint_trajectory_controller`` does not work with ros2_control fake_hardware. There is an
198+
`upstream Merge-Request <https://github.com/ros-controls/ros2_control/pull/822>`_ pending to fix that. Until this is merged and released, you'll have to fallback to the ``joint_trajectory_controller`` by passing ``initial_controller:=joint_trajectory_controller`` to the driver's startup. Also, you'll have to tell MoveIt! that you're using fake_hardware as it then has to map to the other controller:
237199

238200
.. code-block::
239201
240202
ros2 launch ur_robot_driver ur_control.launch.py ur_type:=ur5e robot_ip:=yyy.yyy.yyy.yyy use_fake_hardware:=true launch_rviz:=false initial_joint_controller:=joint_trajectory_controller
241203
# and in another shell
242-
ros2 launch ur_moveit_config ur_moveit.launch.py ur_type:=ur5e launch_rviz:=true
204+
ros2 launch ur_moveit_config ur_moveit.launch.py ur_type:=ur5e launch_rviz:=true use_fake_hardware:=true
205+
206+
Robot frames
207+
------------
208+
209+
While most tf frames come from the URDF and are published from the ``robot_state_publisher``, there
210+
are a couple of things to know:
211+
212+
- The ``base`` frame is the robot's base as the robot controller sees it.
213+
- The ``tool0_controller`` is the tool frame as published from the robot controller. If there is no
214+
additional tool configured on the Teach pendant (TP), this should be equivalent to ``tool0`` given that
215+
the URDF uses the specific robot's :ref:`calibration <calibration_extraction>`. If a tool is
216+
configured on the TP, then the additional transformation will show in ``base`` -> ``tool0``.

0 commit comments

Comments
 (0)