ROS 2 (rosbridge)
Beta
Overview
Section titled “Overview”Talks to ROS 2 through rosbridge (WebSocket and JSON). Topic fields become ordinary CONNECT signals. Beta; needs CONNECT 1.11 or newer.
CONNECT reaches ROS 2 like this.
Set up and parameters
Section titled “Set up and parameters”CONNECT talks to ROS 2 through rosbridge (WebSocket and JSON). Topic fields become ordinary CONNECT signals, so forcing, recording and binding work as for any other interface. Nothing from ROS has to be installed on the CONNECT computer, and the interface runs on Windows and Linux.
On the ROS computer, install rosbridge_suite and start the server. The reference setup is ROS 2 Jazzy with rosbridge 2.7.1:
sudo apt install ros-jazzy-rosbridge-suiteros2 launch rosbridge_server rosbridge_websocket_launch.xml| Parameter | Default | Meaning |
|---|---|---|
| URL | ws://localhost:9090 | rosbridge WebSocket, ws:// or wss:// |
| Token | Empty | Stored like every interface password. CONNECT does not send it to rosbridge yet, so it does not authenticate the connection. |
| AxisCount | 0 | Number of joints published as <interface>.axis1 … axisN in JointState mode |
| Topics | Empty | One row per topic with message type, mode and the settings below |
| Services | Empty | One row per service with service name and type |
Each topic row has these settings:
| Setting | Default | Meaning |
|---|---|---|
| Topic | Empty | Topic name starting with /, for example /cmd_vel |
| MessageType | Empty | For example geometry_msgs/msg/Twist. Needed to publish; signals that only read can do without |
| Mode | Fields | Fields, JointState, Pose or Twist, see below |
| UnitMode | Si | Si converts to millimetres and degrees, Raw keeps the ROS values |
| JointNames | Empty | Optional joint order by name for JointState mode |
| ThrottleRateMs | 0 | Asks rosbridge to send at most one message per this many milliseconds |
| QueueLength | 1 | Subscription queue. Keep 1; larger queues built up a backlog in measurements |
| PublishIntervalMs | 100 | Cycle of outgoing messages, 20…60000 ms |
| PublishOnChange | off | Also sends changed values on the next cycle; the cyclic publish continues |
Addresses
Section titled “Addresses”Signals are addressed as <topic>#<field path>:
| Address | Value |
|---|---|
/cmd_vel#linear.x | Nested field of a message |
/joint_states#position[2] | Third element of an array (zero-based) |
/chatter#data | Text payload |
Use dots for nested fields and one fixed, non-negative index for an array element. The topic is part of the address, so /a#data and /b#data stay distinct. Wildcards, whole arrays and empty segments are rejected.
Direction
Section titled “Direction”The direction follows the PLC convention. A PLCOutput signal is read: CONNECT subscribes to the topic. A PLCInput signal is written: CONNECT advertises the topic and publishes it. Keep all signals of one topic in the same direction; a mix is reported as a signal issue.
Publishing always sends the complete message: bound fields carry their latest values, unbound fields their defaults. One invalid value pauses that topic until it is corrected. Writing needs Allow web to PLC, and a write hold blocks it too. A change made while writing is blocked is held and sent when writing is released.
Units and conventions
Section titled “Units and conventions”With Si, CONNECT converts the values of built-in robot messages: metres to millimetres, metres per second to millimetres per second, radians to degrees and radians per second to degrees per second. Writes reverse the conversion. Time and duration values are seconds. Types that were only learned through discovery are never converted. Float signals have 32-bit precision, also for ROS float64.
Poses use REP-103 roll-pitch-yaw: rx is roll about X, ry pitch about Y and rz yaw about Z, in degrees in both unit modes.
Robot shapes
Section titled “Robot shapes”- Fields binds individual scalar fields. Use it for quaternion components and for joint commands.
- JointState reads one
sensor_msgs/msg/JointStatetopic per interface and creates<interface>.axis1…axisN. With JointNames set, axes are matched by name even if the order of the message changes. It does not write. - Pose reads or writes one Pose, PoseStamped, Transform, TransformStamped or Odometry topic per interface and creates
<interface>.pose.x,.y,.z,.rx,.ry,.rz. - Twist binds
linear.x/y/zandangular.x/y/zof a Twist (prefixtwist.for TwistStamped) and publishes them together.
Services
Section titled “Services”Add a service with its type: std_srvs/srv/Trigger, SetBool or Empty. For interface robot and service /enable, CONNECT creates robot.srv.enable.cmd (PLC input) and .busy, .done, .error (PLC outputs); Trigger and SetBool also give .message. Bind request fields as inputs (/enable#request.data) and response fields as outputs (/enable#response.success).
Set the request values, then switch .cmd from false to true: this calls the service once with the values at that moment. Holding .cmd true does not repeat the call, a call is never repeated after a reconnect, and a blocked write discards it. No answer within 30 seconds, or a failed call, sets .error. .done only confirms a valid response; read success for the result of the service itself.
Discovery
Section titled “Discovery”Browse asks rosapi (part of rosbridge_suite) for the topics of the ROS graph and proposes one signal per scalar field, with data type and direction: a topic with a publisher is proposed as an output, a topic with subscribers only as an input. Review the proposals before you add them. Browse does not need write access. Without rosapi, add topics and signals manually.
Limits
Section titled “Limits”- Images, camera information, point clouds, laser scans and maps are rejected as unsupported. They do not fit a signal bridge.
- ROS actions are not supported.
- Unbounded arrays and fixed arrays above 16 elements are not proposed by Browse. Add single elements by hand or use JointState mode.
- Publishing needs a known message type, built in or learned through Browse.
- A connected socket proves neither that a topic exists nor that values arrive. rosbridge accepts a subscription to a missing topic without an error, so check the interface’s read health and signal issues.
Create or import signals
Section titled “Create or import signals”- Manually. Add a topic row, then address fields as
<topic>#<field path>:/cmd_vel#linear.x,/joint_states#position[2],/chatter#data. In Pose mode the components are addressed as/pose#x…/pose#rz(see Robot shapes above). - Browse. Yes. Browse asks
rosapifor the topics of the ROS graph and proposes one signal per scalar field with data type and direction (a topic with a publisher is proposed as output, one with subscribers only as input). Review the proposals before adding. Withoutrosapi, add topics and signals manually. - File import. No protocol-specific file import.
- From the model. When the model already has its PLC signals, Addresses → Fill from controller… in the signal-mapping section of the CONNECT panel previews matches by exact name against what Browse finds and then writes the addresses. Addresses → Import address table… takes a CSV or TSV with
name;address[;dataType[;topic]]rows. New signals take direction and type from the same-named model signal; signals that already exist keep their configured type. See Configuring interfaces.
How direction, data types and write access are decided is explained in Common concepts and Configuring interfaces.
Example: UR10e packing cell
Section titled “Example: UR10e packing cell”A UR10e packs chocolate bars into a display carton. The sequence runs either in the model’s built-in Structured Text programs (Simulation) or in ROS 2: a sequencer node sends FollowJointTrajectory goals to the Universal Robots driver, and CONNECT carries the joint angles and the cell signals. No robot is needed, the driver runs with mock hardware.

Download the ROS 2 package (ZIP, 10 KB): setup, start and stop scripts, the sequencer node, the joint poses and the CONNECT configuration of the interface.
Start the ROS side
Section titled “Start the ROS side”On the ROS computer (Ubuntu 24.04 natively, in a VM or in a WSL2 distro):
sudo bash setup-ros-jazzy-ur.sh # once: ROS 2 Jazzy, UR driver, rosbridge_suitebash start-workcell.sh # UR10e driver (mock hardware), rosbridge on port 9090, sequencerbash stop-workcell.shstart-workcell.sh ends with sequencer ready: variant packing, 27 poses. The scripts use ROS_DOMAIN_ID=42; logs are in /tmp/rv-ur10e/.
The CONNECT interface
Section titled “The CONNECT interface”One interface of type ROS 2 with Url ws://<ROS computer>:9090. UR10e-ChocolatePacking.connect.json in the download holds the complete configuration with these topics:
| Topic | Type | Direction | Signals |
|---|---|---|---|
/joint_states | sensor_msgs/msg/JointState, mode JointState, units Si | ROS to CONNECT | rUR_ShoulderPan, rUR_ShoulderLift, rUR_Elbow, rUR_Wrist1, rUR_Wrist2, rUR_Wrist3 (degrees) |
/rv/cell/start, /stop, /reset, /estop | std_msgs/msg/Bool | CONNECT to ROS | Operator panel |
/rv/cell/part_present | std_msgs/msg/Bool | CONNECT to ROS | Photo eye at the feed tray |
/rv/cell/vacuum, /auto, /conveyor, /clear_carton, /lamp_green, /lamp_white, /lamp_red, /lamp_orange | std_msgs/msg/Bool | ROS to CONNECT | Vacuum, mode, conveyor, carton exchange, stack light |
/rv/cell/parts, /cartons, /slot, /step | std_msgs/msg/Int32 | ROS to CONNECT | Counters and sequence step |
/rv/cell/cycle_time | std_msgs/msg/Float64 | ROS to CONNECT | Cycle time of the last bar in seconds |
The joints are matched by name (shoulder_pan_joint … wrist_3_joint), because the driver publishes them in a different order. Only plain std_msgs and sensor_msgs are used, so no custom message types are needed.
Switch between Simulation and ROS
Section titled “Switch between Simulation and ROS”- While the interface is enabled and connected, ROS drives the cell: the viewer shows PLC and the built-in programs write nothing.
- After ROS moved the robot, the cell stops with ROBOT MOVED EXTERNALLY - PRESS ACKNOWLEDGE (RESET). Acknowledge on the operator panel lifts the robot, moves it home and continues.
See also
Section titled “See also”- Common concepts — text signals, direction, write access, tracking signals
- Configuring interfaces — adding signals, direction and write access
- All supported interfaces
- Troubleshooting — connection and signal problems