Simulation, rendering & sensors
WWW-POSIM coordinates the workspace. POSIM and Gazebo compute physics and sensors; the browser or native viewer displays their outputs.
Processing flow
- 1. Verify terrain and prepare the session
Check schema, engine/library compatibility and required assets. Transform the spawn position, validate it and prepare a session-specific world and robot SDF. A session nonce identifies the instance.
- 2. Start Gazebo and the controller
Load model mass, inertia, collisions, joints and environmental systems. Select the ArduPilot, ROS 2 direct-control or automatic-voyage command path.
- 3. Commands → physical integration
Apply actuator forces, buoyancy, hydrodynamics, waves and contacts. Gazebo advances simulation time and produces measured pose and velocity; display animation does not drive physics.
- 4. State → sensors and ROS 2
Generate configured sensor messages and expose state through bridges and application services. Camera and GPU LiDAR rendering still depend on Gazebo and its graphics environment.
- 5. Render the workspace and RViz
Browser rendering draws engine state and terrain; Gazebo mode delivers engine-rendered images. RViz Web opens Lichtblick with a session-specific ROS connection and layout; the installed app launches bundled native RViz.
- 6. Monitor → extend coverage or recover
Track startup, topics/TF, scene frames and progress separately. Load verified terrain ahead of movement. Floating-origin shifts transform navigation and follower trails consistently while preserving physical velocities.
Technology map
| Technology | Responsibility and interface | Detailed catalogue |
|---|---|---|
| POSIM-Terrain / geographic libraries | WGS 84 and projected numeric terrain, raster/shoreline integration, meshes and provenance. | Terrain generation algorithms |
| Gazebo + Wave Sim | Rigid bodies, contacts, actuator forces, buoyancy, drag and periodic waves. | Marine dynamics & rendering |
| POSIM and Gazebo sensors | Rendering, kinematic measurement, acoustic computation, calibrated frames and validity. | Sensor models & parameters |
| POSIM-Routing / POSIM-Control | Terrain clearance, bounded planning, native voyage propulsion and motion policies. | Route planning & control |
| ArduPilot SITL / MAVROS | Flight-controller modes and navigation estimates, MAVLink/ROS conversion, actuator interface. | GNSS & navigation, Control an installed workspace |
| Ogre2 / Three.js | Engine scene and sensor rendering / browser scene rendering. Both consume simulation state, with different rendering paths. | Underwater rendering, transport below |
| POSIM-SLAM | Sensor-based estimation/mapping components requiring the selected inputs, extrinsics and provider. | Odometry, truth and research records, public library |
| WWW-POSIM wrapper | Accounts, sessions, world assembly, capability grants, tile lifecycle, viewer UI and installed-app delivery. | Components & libraries |
The public library catalogues describe reusable implementations. A working application configuration additionally needs the chosen plugin binaries, matching SDK, model composition and message connections. A sensor-selection contract or recorded SLAM demonstration alone does not establish an estimator running in every installed package.
Clocks, frames and data identity
| Contract | Why it matters |
|---|---|
| Simulation clock / wall clock | Physics and sensor acquisition use simulation time. Admission, connection expiry and some watchdogs use elapsed real time. Record both when measuring throughput or delay. |
Terrain map / body FLU |
Geographic terrain is projected into a local metric frame. Body axes are forward/left/up; sensor extrinsics map the mount into this frame. |
| Camera optical / FCU frames | Camera images use right/down/forward axes. ArduPilot interfaces convert ENU/FLU to NED/FRD; GNSS navigation uses a separate FCU map origin. Preserve these transforms rather than relabelling axes. |
| Session / configuration identity | Session nonces distinguish runs; saved sensor manifests, terrain identities and library revisions distinguish configurations. Reconnecting to a new run requires its current topics and grants. |
| Reset / floating origin | Reset changes a measurement timeline. Floating-origin translation changes coordinates while preserving physical velocity. Both must be identifiable in research logs. |
| Truth / observation / estimate | Gazebo pose is a reference; camera/GNSS/DVL are measurements; FCU or SLAM pose is an estimate. Keep separate topic provenance and do not score an estimator against a signal it directly consumes as truth. |
Rendering and measurement boundaries
A Browser scene draws terrain and vehicle state with Three.js; selecting it does not move camera or GPU LiDAR generation out of Gazebo. Ogre2 renders the engine view and rendering-based sensors. Terrain visual LOD, sensor visibility masks, lens placement, water materials and clipping can therefore change observations even when collision geometry is unchanged.
Sonar ray geometry, RGB colour and depth are separate outputs. RGB-only overlays can be excluded from acoustic geometry. A displayed point cloud may be a single ray/depth observation; accumulation and pose correction require an explicitly running mapping process. Acoustic processing catalogue and Sensor models & parameters identify those outputs.
Video and sensor transport
- Gazebo → measurements and rendering
The engine host produces physical state, sensor messages and camera pixels. The Browser scene separately renders the received state.
- Application → connection grant → simulator gateway
The website prepares account/session access and connection addresses. Public demo data travels directly through a separate simulator origin. Private images and RViz use scoped temporary grants when the host advertises direct transport.
- Viewer → buffering and sample age → display
Video uses a playback buffer; messages retain topic timestamps and reception status. Distinguish Connecting from Stale, and check sensor time and physical RTF.
| View or interface | Format and behaviour |
|---|---|
| Public LIVE / Hong Kong demo Gazebo scenes | Shared H.264 HLS video. Short segments come directly from the media server and use a playback buffer. |
| Hong Kong demo RGB sensor | Shared H.264 HLS; Connecting appears until the initial buffer can play. |
| Personal scene / camera panels | Gazebo JPEG frame requests. Capable hosts use scoped direct access; the installed app uses its local service. |
| ROS compressed camera | JPEG CompressedImage, up to 1 Hz in simulation time in the standard connector; separate from HLS video. |
| RViz Web / external ROS viewer | ROS messages over WebSocket. RViz Web is read-only with Control an installed workspace. |
Vercel can serve the web interface and short connection-setup requests; ongoing public demo video and topic streams bypass Vercel functions. Private-workspace direct transport follows the host's advertised capabilities. Keep temporary connection addresses private. Video buffering and sensor acquisition time differ, so a displayed frame alone cannot measure control latency.
Public LIVE is a read-only broadcast with one shared encoder process for each requested view. Viewer requests renew a five-second lease. When a view has no requests, its encoder stops. Unwatched scene cameras release their Gazebo subscriptions; scheduled arrival photographs can request brief captures independently. Physics, navigation and vehicle sensors continue.
| Stream | Shared video target |
|---|---|
| Scene, lower quality | 15 FPS, up to 640 × 360, 0.6 Mbit/s |
| Scene, higher quality | 15 FPS, up to 960 × 540, 1.2 Mbit/s |
| Selected vehicle camera | 5 FPS, up to 640 pixels wide, 0.4 Mbit/s |
| Unwatched view | Encoder off after the five-second lease expires |
A requested scene produces both video qualities from the same captured frames. The player selects a quality according to available bandwidth. It can use the lower quality on a slow connection while retaining 15 FPS. The vehicle camera and interactive demo use their separate video settings.
Anyone can watch the LIVE voyage from the sign-in page. The selected scene stays connected while any part of the voyage view is visible, including its maps and vehicle data. After opening the voyage fullscreen, returning to sign-in keeps the same scene connected. Pausing, hiding or closing the tab, or opening Live Demo or the web workspace stops the sign-in stream. An open, visible sensor camera renews its own lease. Video and live metadata come directly from the server. LIVE has no viewer-slot limit. The interactive demo has a separate two-viewer limit.
While the first video buffer loads, the browser reads one cached JPEG for the selected scene directly from the server. A connecting message and animated bar appear in the centre of the scene, below the visible voyage status, destination, real-time factor and speed panels. The first request reads an existing capture before full voyage metadata arrives. Its response identifies the native world, and later metadata must match that nonce. The connecting bar shows an approximate five-second wait. Failed broadcast connections retry automatically, including when the network returns. Changing the world or view discards the previous preview; hidden or off-screen scenes suspend requests. The first playing event removes the preview. A later playback interruption keeps the last decoded video frame and shows the reconnecting message and bar.
Scene subscriptions wait for fresh native telemetry. Terrain preparation can run without waking the full-size scene cameras.
The two scene qualities are each encoded once for all readers. Network traffic still grows with the audience. Forty viewers watching a scene and camera together have a combined target video bitrate of 40–64 Mbit/s according to scene quality, before transport overhead. Available server uplink and rendering performance determine the practical capacity. Viewer count alone does not lower the frame-rate target.
LIVE starts with a 3-second playback target behind the HLS live edge. A playback stall can increase this to 12 seconds. A newly requested LIVE stream is advertised as ready after two 2-second segments and capture-clock calibration, requiring about 4 seconds plus capture and encoder startup. The interactive demo also starts with a 3-second target. Scene instruments and camera panels follow the video presentation clock. Capture-to-display delay also includes encoding and segment availability.
Camera acquisition uses simulation time. Physical real-time factor and capture stalls can reduce distinct frames per wall-clock second. Stream metadata reports source_fps, source_frames and max_source_gap_seconds from source submissions. An HLS decoder reporting 15 FPS can include repeated frames and does not establish 15 distinct camera captures per second.
Interpretation
A ready terrain, running session and live camera are separate states. Background imagery refreshes do not rewrite running collision data. Mesh elevations govern collisions; satellite, sand, water and map overlays are visual layers. Real-time factor compares simulation time with wall time.
Related documentation and implementation
Components & libraries · Terrain generation algorithms · Route planning & control · Custom worlds
POSIM engine and library guide. WWW-POSIM owns session lifecycle, transport and viewer launch; Terrain, Routing and Control own their corresponding algorithms.
Sonar preview
See the Physics-based sonar preview for a recorded three-object experiment and how to read its range-and-bearing comparison.