The ROS 2 Editor is a World Editor tool for building per-vehicle ROS 2 sensor configurations inside BeamNG.tech, launching the in-process low-latency native C++ ROS 2 bridge for those vehicles, and saving/loading reusable JSON templates. It complements the external BeamNG–ROS 2 packages
by letting you author and run a vehicle’s published sensor set from the simulation UI.
The bridge runs inside the simulator process: sensor data is published directly from the engine through the loaded ROS 2 shared library, without a Python relay or socket round-trip. That avoids the extra copy/serialisation steps of the external Python integration, so topics stay low-latency and can be published at high rates (subject to each sensor’s update limiter).
ROS 2 Editor with library loaded and sensor type grid
Prerequisites
Compatible native C++ bridge library for the current platform (.dll on Windows under Bin64, .so on Linux under BinLinux). Vehicle and sensor controls stay disabled until it is loaded.
The remote beamng_ros2 Python packages remain available for scenario orchestration; this editor focuses on in-simulator library loading, sensor draft editing, and per-vehicle start/stop.
Opening the editor
- Open the World Editor.
- In the mode bar, select ROS 2 Editor (device-hub icon).
- The ROS 2 Editor window opens.
The mode bar is folded by default, so the
ROS 2 Editor icon may be hidden. See
Showing hidden tools
to reveal it via the
Editor Modes menu.
ROS 2 library
At the top of the window:
- The current library path is shown (green when loaded).
- If nothing is loaded, use Browse… to pick the native C++ bridge library, or Load last used to reload the path stored in editor preferences (
ros2Editor.general.lastRosLibPath).
Until the library loads successfully, the rest of the editor body is disabled. An incompatible library version surfaces an error in this section.
Scene vehicles
The Scene vehicles table lists every active vehicle. Green row tint means ROS is currently running for that vehicle.
Per-row actions:
Choose which vehicle’s sensor draft to edit.
Orbit-focus that vehicle.
Open a JSON sensor template into this vehicle’s draft.
Export this vehicle’s draft as a JSON template.
Start ROS for the vehicle with the merged draft, or re-apply if already running. Requires at least one sensor in the draft.
Tear down the ROS node for that vehicle.
ROS is started per vehicle. You can run several vehicles independently, each with its own sensor draft.
Adding and managing sensors
Below the vehicle table:
Icon grid of supported types from the packaged defaults (rosDefaults.json). Click a type to append a draft sensor with default config and a generated id (TypeName_N).
List of draft sensors for the selected vehicle. Select a row to inspect it; Remove selected sensor deletes it from the draft.
Supported types in the defaults catalogue:
Camera, LiDAR, RADAR, Ultrasonic, Advanced IMU, GPS, Ideal RADAR, Roads, Mesh
Electrics, Powertrain, State, Damage, GForces, Time
Exact availability follows tech/rosDefaults.json shipped with the build (copied to the user tech/ folder on first use when needed).
Sensor inspector
With a sensor selected, the inspector edits the draft before launch.
ROS 2 topic / identity
Unique id within that vehicle’s ROS config. Used for topics and internal routing. Change it before launch if you need stable names across sessions.
Scalar channels
For scalar sensor types (Electrics, State, and similar):
Publish all default signals
When enabled (default), publish every field defined for that type in the defaults document.
When Publish all is off, a filterable table appears. Tick individual fields; All / None shortcuts are available. Only selected fields are kept in the launch config.
Placement (positional sensors)
Sensors with pos / dir / up in their create config show a placement section:
Edit vehicle-space pose numerically, or use the viewport gizmo overlays while the ROS 2 Editor mode is active.
When enabled, gizmo placement snaps to the vehicle surface (optional for RADAR; leave off if snap fails for a pose).
Draw the sensor debug box/frame in the scene when supported.
Rates and publishing
Blob / GPU-backed types expose:
When on, publish at Update rate (Hz); when off (max mode), publishing is not rate-capped by that field.
Target publish rate when the limiter is enabled. Default follows the ROS bridge defaults (typically 60 Hz for blob sensors unless changed).
Sensor parameters
Type-specific controls (examples):
Resolution, FOV, near/far, colour / annotation / depth streams, exposure.
Vertical/horizontal resolution and angles, rotate flag, frequency, range.
Size, FOV, range/velocity binning and related model parameters.
Near/far and range cutoffs.
Reference latitude/longitude for reported positions.
Parameters not given a dedicated control still appear in the generic parameter list when present on the sensor’s default create table.
JSON templates
Save template writes a launch-ready JSON document:
{
"sensors": [
{
"id": "Camera_1",
"type": "Camera",
"config": { "...": "..." },
"fields": [ "optional subset of scalar field names" ]
}
]
}
The export merges each draft sensor with its type defaults (including message metadata from rosDefaults.json). If scalar subset mode is active, only the selected fields are kept.
Load template replaces the selected vehicle’s draft with the file contents. Sensors that already list fields are treated as subset mode on load.
Typical workflow
- Load the ROS 2 library once per editor session (or use Load last used).
- Spawn the ego (and any other) vehicles.
- Select a vehicle in the ROS 2 Editor.
- Add sensor types, set ids, placement, rates, and optional scalar subsets.
- Optionally save a JSON template for CI / reuse.
- Press Launch on the vehicle row.
- Consume topics from your ROS 2 graph; press Stop when finished, or Reload after editing the draft.
Related documentation
- ROS 2 interface overview
— external
beamng-ros2-integration packages and messages.
- ADAS Sensor Configuration Editor
— vehicle-attached sensors for BeamNGpy / co-simulation / VSL (separate from the ROS draft, though many sensor concepts overlap).
- Sensors
— behaviour and parameters of individual BeamNG.tech sensors.