Mock or real: a UR arm
In this exercise, you repeat the steps of Mock hardware: two FR3 arms with a UR arm: you will start a UR cell, inspect its joint states, plot one joint in PlotJuggler, and send a small joint trajectory from Python. The same steps work with mock hardware or a real UR10. Use separate terminals for bringup, observation, and commands.
Before you start
Use a ROS 2 Jazzy workspace containing
simple_ur_cell_bringupandros2_control_python_capabilities_demo.Build the example package once from the workspace root:
source /opt/ros/jazzy/setup.bash colcon build --packages-select ros2_control_python_capabilities_demo source install/setup.bash
In each new terminal, run
source install/setup.bashfrom the root of your workspace before the ROS commands below.For a real robot, use a clear workspace and choose target angles from that robot’s current joint positions. Do not copy someone else’s target angles onto your robot.
1. Start the cell
In terminal A, start one of these bringups. Start only one at a time.
Mock hardware (no robot required):
ros2 launch simple_ur_cell_bringup start_cell.launch.py use_mock_hardware:=true
Real UR10 (replace the example IP with your robot’s IP):
ros2 launch simple_ur_cell_bringup start_cell.launch.py \
robot_ip:=192.168.56.5 ur_type:=ur10
The launch file also opens RViz. The image below shows an example cell; its pictured robot may differ from the UR10 used in this exercise.

On the real robot, start the pendant program containing the External Control node. Wait for the driver log message Robot connected to reverse interface. Ready to receive control commands. The robot can publish joint states before this motion connection is ready, so seeing the model in RViz is not enough to confirm that commands can move it. See the UR driver operation modes for pendant setup.
2. Inspect the controller and joint states
In terminal B, check the controllers and read one joint-state message:
source install/setup.bash
ros2 control list_controllers
ros2 topic echo --once /joint_states
Look for scaled_joint_trajectory_controller in the active state. /joint_states contains matching name and position arrays: each position belongs to the name at the same index. Do not assume the message uses the trajectory controller’s joint order.
For example, one /joint_states message from the UR10 listed its joints in this order:
Index in |
Joint |
Example position (rad) |
|---|---|---|
0 |
|
−1.5621 |
1 |
|
−1.4621 |
2 |
|
+0.2437 |
3 |
|
−2.3909 |
4 |
|
+0.0920 |
5 |
|
−2.2936 |
The Python trajectory example expects shoulder pan, shoulder lift, elbow, wrist 1, wrist 2, wrist 3. Match positions by name when you build a target list. The example numbers above are for illustrating the mapping; read your own robot’s values before commanding it.
3. Plot a joint position
In terminal C, start PlotJuggler:
source install/setup.bash
ros2 run plotjuggler plotjuggler
In PlotJuggler, select ROS2 Topic Subscriber under Streaming, open its topic selector, choose /joint_states, and click Start. Expand joint_states in the Timeseries List, then drag wrist_3_joint → position onto the plot. You should see its measured angle in radians. A stationary joint will show a nearly flat trace with small measurement noise.

Leave PlotJuggler open for the next step so you can see the change when the robot moves.
4. Send a small absolute joint target
Read /joint_states again just before choosing a target. Copy the six current angles into controller order: pan, lift, elbow, wrist 1, wrist 2, wrist 3. Change only one value by a small amount. For instance, if wrist 3 is at -2.2936 rad, a target of -2.3936 rad requests a −0.1000 rad wrist move; the other five target values remain at their current angles.
In terminal B, replace all six capitalized placeholders below with your chosen numeric target angles:
ros2 run ros2_control_python_capabilities_demo safe_send_trajectory \
--positions PAN LIFT ELBOW WRIST_1 WRIST_2 WRIST_3 \
--duration 10
--positions contains absolute angles in radians, not relative offsets. The script prints each current angle, target angle, and requested change before sending the goal. It refuses to send if any change exceeds 0.25 rad by default. After the controller returns, it reads fresh joint states and checks that every joint reached its target within 0.05 rad.
Watch the physical robot and the PlotJuggler trace. Once the command finishes, read the joint states again:
ros2 topic echo --once /joint_states
Find the joint you changed by name and compare its final angle with the target. For a closer view of controller tracking, ros2 topic echo --once /scaled_joint_trajectory_controller/controller_state shows the controller’s reference, measured feedback, and error.
5. Interpret the result
What you see |
What to check |
|---|---|
No |
Check that bringup is running and that the robot or mock hardware initialized. |
Trajectory action server unavailable or controller inactive |
Check |
|
Check the reverse control connection, not just the pendant’s play indicator. The driver should log |
|
The measured position fell too far behind the planned path. The controller log identifies the joint and error. Verify the control connection and use a reachable, slower, smaller movement before considering tolerance changes. |
The controller reports success but |
The controller’s configured goal tolerance can be larger than the requested movement. The script’s final joint-state check caught motion that did not actually finish. |
On this cell, the scaled controller’s goal tolerance is 0.2 rad per joint. A requested 0.1 rad move could therefore be reported as successful by the controller even if the arm stayed still. The Python script checks the measured final positions against its stricter 0.05 rad threshold.
Optional: try the GUI controller
rqt_joint_trajectory_controller sends trajectories through the same controller. It is useful for exploring the interface, but it still needs the robot’s External Control connection:
ros2 run rqt_joint_trajectory_controller rqt_joint_trajectory_controller
The main distinction to remember is that a ROS goal being accepted means the controller received it; only the measured joint states show what the robot did.