AUV Interface
The AUV wrapper provides a research-friendly API on top of OceanSimClient. It hides raw protocol envelopes for common state, control, sensor, map, agent, overlay, dataset, and Gym-style workflows.
AUVState
- class AUVState(data)
Typed view of an OceanSim state dictionary.
Attribute
Meaning
positionOceanSim / ROS ENU position as a NumPy vector.
position_godot_xyzConverted Godot world position.
position_ros_enu,position_ros_nedROS-compatible frame conversions.
velocityOceanSim velocity vector.
depth,speed,headingScalar navigation values.
lidar_2d,lidar_3d,dvl,cameraEmbedded sensor payloads from the state response.
- property x
X coordinate in OceanSim user frame.
- property y
Y coordinate in OceanSim user frame.
- property z
Z coordinate in OceanSim user frame.
AUV
- class AUV(host='localhost', port=9876, auto_launch=False, exe_path=None, timeout=5.0)
High-level AUV controller and data access object.
- Parameters:
host (str) – simulator hostname.
port (int) – simulator TCP port.
auto_launch (bool) – launch a packaged executable before connecting.
exe_path (str) – optional packaged simulator executable path.
timeout (float) – response timeout in seconds.
Connection
- AUV.connect(**kwargs)
Connect to the simulator. Extra keyword arguments are forwarded to
OceanSimClient.connect.
- AUV.disconnect()
Disconnect the underlying TCP client.
Control
Method |
Description |
|---|---|
|
Compatibility alias for world-frame force control. |
|
Apply force in OceanSim world/user coordinates. |
|
Apply force in the AUV body frame. |
|
Apply body-frame force and torque. |
|
Set body-frame linear and angular velocity targets. |
|
Move forward using a positive y force. |
|
Move laterally using an x force. |
|
Move vertically using a z force. |
|
Apply a zero force. |
|
Reset AUV pose and clear velocities. |
|
One PD depth-hold control step. |
|
One heading correction step. |
|
One force-control waypoint tracking step. |
|
Gym-style step returning observation, reward, done, and info. |
- AUV.set_force(fx, fy, fz=0.0)
Compatibility alias for
set_force_worldwith force vector[fx, fy, fz]. Use this for MPC, scripted navigation, and continuous-control experiments that operate in the world frame.- Returns:
raw protocol response dictionary.
- AUV.set_force_world(fx, fy, fz=0.0)
Send
set_force_worldwith a world-frame force vector.
- AUV.set_force_body(fx, fy, fz=0.0)
Send
set_force_bodywith a body-frame force vector.
- AUV.set_body_wrench(fx, fy, fz, tx, ty, tz)
Send
set_body_wrenchwith body-frame force and torque.
- AUV.set_body_velocity(u, v, w, p, q, r)
Send
set_body_velocitywith body-frame linear and angular velocity components.
- AUV.hold_depth_step(target_depth, forward_force=0.0, kp=70.0, kd=25.0, max_vertical_force=180.0)
Read current state, compute a bounded vertical force from depth error and depth rate, send force control, and annotate the response with control diagnostics.
- AUV.track_waypoint_step(world_x, world_z, nav_depth=None, force_power=120.0, depth_power=60.0, arrival_dist=1.0)
Compute one normalized force command toward a Godot X/Z map-plane waypoint. The returned protocol response includes a
controldictionary withmode="waypoint_pid",error,integral,saturation,target,force, anddt.- Returns:
(arrived, response).
State and sensors
Method |
Sensor or state |
|---|---|
|
Current |
|
2D planar scan payload. |
|
Structured 3D lidar point cloud. |
|
Doppler velocity log payload. |
|
Forward-looking imaging sonar payload. |
|
Multibeam sonar payload. |
|
Side-scan sonar payload. |
|
RGB-D dense point-cloud payload. |
|
Camera RGB/depth/segmentation-like payload from latest state. |
|
Full sensor dictionary with schema validation by default. |
- AUV.get_sensors(validate=True)
Request all active sensors and validate every payload through
validate_sensor_setunless validation is disabled.- Returns:
Dict[str, Dict[str, Any]]keyed by sensor name.
Maps, agents, and overlays
Method |
Description |
|---|---|
|
Load a named map scenario. |
|
Return terrain and scenario metadata. |
|
Return 2D occupancy grid for planners. |
|
Create a static obstacle. |
|
Create a dynamic AUV-like agent. |
|
Externally drive a proxy agent. |
|
Queue a simulated acoustic message. |
|
Display a planned path on the 2D/3D map overlays. |
|
Display one target waypoint. |
|
Display a predicted trajectory such as an MPC horizon. |
|
Clear all overlay planning graphics. |