Agents and Runtime
OceanSim agents are runtime-controlled participants in a marine scenario. The main AUV is a physical vehicle with thrusters, buoyancy, hydrodynamic terms, and onboard sensors. Dynamic proxy agents are lightweight moving participants used for obstacle-avoidance, communication, tracking, and multi-target experiments.
The goal is to keep experiment setup explicit: scenario files describe the map, vehicle roles, initial placement, motion policy, and sensor expectations; Python code controls the run through typed wrappers and protocol actions.
Agent roles
Role |
Description |
|---|---|
|
The controllable physical AUV. It owns the primary state, sensors, force control, thruster control, dataset export hooks, and navigation overlays. |
|
A lightweight dynamic participant. It can move autonomously or accept an external velocity command and is included in occupancy grids and agent summaries. |
|
Non-moving map geometry managed by the obstacle system rather than the agent system. |
Control contracts
OceanSim documents each control mode as an action contract. The contract names the vector fields, units, and coordinate frame so controllers, RL policies, and dataset replays can be compared without reading simulator internals.
Control scheme |
Action vector |
Use |
|---|---|---|
|
|
Main AUV force control through the world-frame |
|
|
Main AUV force control through the body-frame |
|
|
Direct actuator experiments using vehicle-profile ordering. |
|
|
Proxy AUV motion in the Godot world frame. |
|
|
High-level target tracking through Python control utilities. |
|
|
Body-frame force/torque contract for six-degree controller research. |
|
|
Body-frame linear/angular velocity contract. |
|
|
Reserved for model-driven six-degree dynamics research. |
Python example
from oceansim_client import AUV, AgentDefinition, AgentFactory
with AUV() as auv:
main = AgentFactory.build_agent(
auv,
AgentDefinition(agent_name="auv/main", control_scheme="force_3d"),
spawn=False,
)
main.act([0.0, 120.0, 0.0])
target = AgentFactory.build_agent(
auv,
{
"agent_name": "target_01",
"agent_type": "proxy_auv",
"is_main_agent": False,
"location": [4.0, -7.0, 6.0],
"control_scheme": "external_velocity",
"metadata": {"role": "moving_target"},
},
)
target.act([0.2, 0.0, -0.1])
Scenario definition
Scenario files keep agent configuration explicit and versioned. Every public
scenario declares the main AUV in an agents array; dynamic proxy agents can
be added with the same shape and are spawned by the scenario loader when
is_main_agent is false.
{
"schema_version": 1,
"id": "Dynamic_Map",
"display_name": "Dynamic Obstacle Benchmark Field",
"generator": "benchmark_dynamic_field",
"map_size_m": [40.0, 40.0],
"agents": [
{
"schema_version": 1,
"agent_name": "auv/main",
"agent_type": "main_auv",
"is_main_agent": true,
"profile": "oceansim_torpedo_auv",
"location": [0.0, -6.0, -17.0],
"rotation": [0.0, 0.0, 0.0],
"control_scheme": "force_3d",
"sensors": [
"depth",
"imu",
"dvl",
"camera",
"rgbd_dense_cloud",
"lidar_2d",
"lidar_3d",
"imaging_sonar",
"multibeam_sonar",
"side_scan_sonar"
],
"metadata": {
"role": "ego_vehicle",
"semantic_label": "auv",
"tags": ["main", "controlled", "dynamic_benchmark"]
}
},
{
"schema_version": 1,
"agent_name": "target_01",
"agent_type": "proxy_auv",
"is_main_agent": false,
"location": [4.0, -7.0, 6.0],
"rotation": [0.0, 0.0, 0.0],
"control_scheme": "external_velocity",
"metadata": {
"role": "moving_target",
"semantic_label": "auv",
"tags": ["dynamic", "vehicle"]
}
}
]
}
Scenario agent fields
Field |
Meaning |
|---|---|
|
Version of the agent definition format. |
|
Stable runtime identifier, for example |
|
Logical role such as |
|
|
|
Vehicle or runtime profile name. |
|
Initial pose fields in Godot-world coordinates and degrees. |
|
Action contract used by the agent. |
|
Sensor names or typed sensor declaration dictionaries. |
|
Role, semantic label, tags, and experiment annotations. |
Runtime state fields
get_agents exposes a versioned runtime summary. Dynamic proxy agents are
reported by the agent manager; the main AUV can be represented with the same
field names for replay and dataset tooling.
Field |
Meaning |
|---|---|
|
Runtime state schema version. |
|
Stable runtime identifier. |
|
Logical role and vehicle/runtime profile. |
|
Visualization shape, semantic class, and grouping labels. |
|
Runtime pose in the simulator frame. |
|
Optional quaternion rotation, currently provided by the main AUV. |
|
Linear velocity summary and optional body angular velocity. |
|
Motion mode and scalar speed summary. |
|
Runtime footprint and whether the entry is a lightweight proxy. |
|
Active control contract. |
|
Machine-readable shape, fields, units, frame, optional bounds, and main AUV alternatives. |
|
Sensor declarations or sensor summaries associated with the agent. |
|
Runtime diagnostics for replay and debugging. |
|
Recordable controller diagnostics such as waypoint error, integral, target, and saturation flags. |
|
Optional proxy-agent depth limits. |
|
Role, tags, semantic label, and experiment-specific annotations. |
Export trace fields
agent_timeline.jsonl links each agent sample to the frame-level state,
command, sensor summary, and frame identifiers used by replay tools.
Field |
Meaning |
|---|---|
|
Full agent state snapshot for that timeline row. |
|
Last recorded command envelope, including the command frame when present. |
|
Per-agent sensor declarations or main-AUV sensor sequence summaries. |
|
|
Multi-agent workflow
The recommended workflow keeps configuration, launch, control, recording, and replay separated:
Configure the scenario JSON with the main AUV and any proxy agents needed by the experiment.
Start OceanSim and select the scenario through
set_scenarioor the UI.Use
AgentFactory.build_agentfor typed Python bindings.Send actions through
OceanSimAgent.actso vector length and bounds are checked before TCP dispatch.Record the run with the dataset tools when sensor payloads, commands, and replay metadata are needed.
Re-open the export with
OceanSimRunReplayfor offline inspection.
Recommended release checks
Verify that
get_agentsreturns every dynamic agent with position, mode, size, role metadata, action space, and control scheme.Verify that each documented action vector is accepted or rejected according to its
ActionSpace.Verify that
python tools\scenario_agent_schema_smoke.pyaccepts every scenario JSON file.Verify that dynamic agents appear in occupancy grids when
include_dynamic_agentsis enabled.Verify that acoustic communication tests cover latency, range, bandwidth, and packet-drop settings.