Skip to main content
Version: 9

Legacy Websocket Compatibility (rosbridge)

Recommended path is native ROS 2

The recommended way to drive MoveIt Pro programmatically within a firewall is the Native ROS 2 Client Library API (rclpy, rclcpp). Starting in v9.4, the MoveIt Pro Desktop App no longer uses rosbridge_server; it uses the MoveIt Pro Web Bridge on default port 3201 with a binary CDR wire format.

This page is for customers with existing investment in rosbridge-protocol clients (roslibpy, roslibjs, rossharp, roslibrust, jrosbridge) who need a migration ramp.

Requires MoveIt Pro 9.4 or later

The MoveIt Pro migration from rosbridge to the Web Bridge using the Foxglove protocol on default port 3201 and the opt-in --enable-rosbridge on default port 3204 described here were introduced in MoveIt Pro 9.4. In earlier versions the Desktop App uses rosbridge_server on port 3201 directly and no --enable-rosbridge flag exists.

Prefer the Foxglove protocol in 9.4

Applications that can migrate should connect directly to the 9.4 Web Bridge at ws://<runtime-host>:<web-bridge-port>. The Web Bridge port defaults to 3201; use the value passed to --web-bridge-port when it was overridden.

Existing clientWeb Bridge replacement
roslibjs / standalone JavaScriptfoxglove-ros-adapter
roslibpyfoxglove-ros-client-py
ROS# / rossharpfoxglove-ros-sharp

These clients use the bridge's binary CDR transport and its hidden action endpoints. See Run an Existing Objective for the equivalent Objective examples in tabs. Keep the sidecar instructions below only for applications that must continue speaking rosbridge JSON.

Keep unauthenticated WebSockets private

Both the 9.4 Web Bridge and the optional rosbridge sidecar expose Runtime control without client authentication. Keep their ports on a trusted network or behind a firewall or VPN. Never expose them directly to the public internet.

When to use this

Use the legacy compatibility bridge when:

  • You have host scripts that must continue speaking the rosbridge JSON protocol during migration.
  • Your application uses roslibrust, jrosbridge, or another rosbridge client without a supported Web Bridge replacement.
  • A temporary port-only change is preferable to rewriting an existing rosbridge integration.

For Custom View Panes embedded in MoveIt Pro, prefer IframeROSClient instead of this sidecar. IframeROSClient routes ROS traffic through the parent-frame Web Bridge, so pane code avoids the rosbridge JSON protocol break on port 3201.

If none of those apply, prefer the native client libraries; they are faster on the wire and require no extra process on the robot.

1. Enable the legacy rosbridge server

The legacy bridge is off by default. Enable it at robot launch:

moveit_pro run -c <your_config> --enable-rosbridge

This starts rosbridge_server in addition to the always-on MoveIt Pro Web Bridge. The Web Bridge continues running on its configured port (3201 by default) to service the UI. rosbridge_server will bind by default to port 3204, not 3201. Override if the default conflicts with something else on the host:

moveit_pro run -c <your_config> --enable-rosbridge --rosbridge-port=9999

Why 3204 and not 9090? 9090 is rosbridge_server's upstream default and frequently clashes with developer rosbridge installs. 3204 keeps the sidecar cleanly separated from both the MoveIt Pro Web Bridge (3201) and any external rosbridge already running on the host. Note the change from earlier releases: MoveIt Pro 9.3 and earlier ran rosbridge_server on 3201, but in 9.4 that port belongs to the always-on Web Bridge, so the opt-in sidecar defaults to 3204 instead.

Preserve the pre-9.4 port

Required Version
This feature requires MoveIt Pro version 9.4.2 or newer.

Clients that cannot be repointed — including any that hard-code 3201 — can keep rosbridge on that port. Move the Web Bridge to the otherwise-free 3204, then return 3201 to rosbridge:

moveit_pro run -c <your_config> \
--web-bridge-port=3204 \
--enable-rosbridge \
--rosbridge-port=3201

MoveIt Pro continues to reach the Web Bridge through its /ros proxy, so nothing else needs a separate configuration change.

This swap assumes host networking, the default for moveit_pro run and production deployments. If your Compose deployment publishes an explicit port list instead, it publishes only the Web Bridge port — add a mapping for the rosbridge port there.

Only --web-bridge-port is also readable from the environment, as MOVEIT_PRO_WEB_BRIDGE_PORT. --enable-rosbridge and --rosbridge-port must be passed as flags, so a deployment that starts MoveIt Pro from a service manager has to put them on its launch command.

Keep high-bandwidth topics off rosbridge

rosbridge serializes every message as JSON, which is roughly an order of magnitude slower per message than the Web Bridge's binary CDR wire format. Streaming cameras, point clouds, or planning-scene bursts over the legacy bridge can saturate the network and starve other UI traffic. Keep those topics on the Web Bridge and only route control-plane traffic (action goals, services, low-rate state) over the legacy bridge.

2. Connect a legacy rosbridge client with an updated port

The rosbridge protocol surface is unchanged from previous releases; only the port differs. Point the client at the configured port:

import roslibpy
from roslibpy import ActionClient

# Default sidecar port is 3204; replace if you passed --rosbridge-port.
client = roslibpy.Ros(host="localhost", port=3204)
client.run()

action = ActionClient(
client,
"/do_objective",
"moveit_studio_sdk_msgs/action/DoObjectiveSequence",
)
action.send_goal({"objective_name": "Close Gripper"}, on_result, on_feedback, on_error)

roslibpy's ROS 2 action support is on the GitHub main branch as of this writing:

pip install git+https://github.com/RobotWebTools/roslibpy.git@main

For action / service / topic semantics (including cancellation and parameter_overrides), the API matches the native Run an Existing Objective, Run an Objective from a Custom Behavior Tree XML, and Passing Parameters to Objectives at Runtime guides; the payload shapes are identical, only the transport differs.