Launch files, world and services
Launch files
kai_bringup simulation.launch.xml
The simulation part: Gazebo on the ocean, the GUI, and a bridge for
/clock. Names no vehicle.
Argument |
Default |
Description |
|---|---|---|
|
|
World file, by name on |
|
|
Start the Gazebo GUI. |
|
|
Run the Gazebo server and the bridge as composable nodes in |
kai_bringup spawn_vehicle.launch.xml
The spawn part for one instance of any vehicle: renders its files for the
name, spawns it, bridges its topics in its namespace and runs its
robot_state_publisher with its frame prefix. Run once per instance while
the simulation runs.
Argument |
Default |
Description |
|---|---|---|
|
Instance name: model name, topic prefix, ROS namespace and TF prefix. Letters, digits and underscores, starting with a letter. |
|
|
Model xacro, rendered with |
|
|
Bridge config template with |
|
|
URDF, xacro or plain, for |
|
|
Instead of |
|
|
empty |
List of models to mount on the vehicle’s frames; see Mount an accessory. |
|
|
Spawn position [m]; z = 0 is the waterline. |
|
|
Spawn orientation [rad]. |
|
empty |
Name of the world to spawn into; empty picks the one running. |
|
|
Where the instance’s files are written; |
|
|
Load the bridge and state publisher into |
|
|
The simulation launch’s container. |
kai_bringup multi_vehicle_demo.launch.py
The simulation part plus one vehicle of each type through their own generators: a BlueBoat, a BlueROV2 six metres ahead and one metre down, an X500 on the landing pad. Needs bluerobotics_models and holybro_models in the workspace. Several vehicles on one ocean walks through it.
Argument |
Default |
Description |
|---|---|---|
|
|
World file, as for the simulation launch, among those the demo has poses for: |
|
|
Start the Gazebo GUI. |
|
|
Run Gazebo, the bridges and the state publishers in one container. |
kai_bringup robotx_2026.launch.py
The RobotX 2026 world plus a BlueBoat, a BlueROV2 Heavy and an X500 at the
pontoon of a course, with the sensors teams fielded: each vehicle from its
own generator and config/robotx_2026/<vehicle>.yaml, the boat’s and the
X500’s accessories from config/robotx_2026/<vehicle>_accessories.yaml.
Needs bluerobotics_models and holybro_models in the workspace.
RobotX 2026 lists what each carries.
Argument |
Default |
Description |
|---|---|---|
|
|
The course whose pontoon the vehicles start at: |
|
|
Start the Gazebo GUI. |
|
|
Run Gazebo, the bridges and the state publishers in one container. |
kai_custom_vehicle sim.launch.xml
The simulation part plus one spawn of the custom USV, from the package’s
own model xacro, bridge template and URDF. Takes the simulation part’s
arguments, name (default custom_usv) and x, y, z, roll, pitch,
yaw.
kai_custom_vehicle rviz.launch.xml
RViz on one instance in a running simulation: the fixed frame, the description topic and the RobotModel display’s TF Prefix all set to the instance, with simulation time.
Argument |
Default |
Description |
|---|---|---|
|
|
Instance to look at. |
|
|
Where the config is written, next to the instance’s other files. |
kai_custom_vehicle display.launch.xml
Shows the custom USV’s URDF in RViz, with no Gazebo and no frame prefix.
Argument |
Default |
Description |
|---|---|---|
|
|
Start |
instantiate_vehicle.py
What the spawn launch runs to produce an instance’s files. You can also run it on its own:
ros2 run kai_bringup instantiate_vehicle.py --name NAME --out-dir DIR \
--xacro FILE [--bridge FILE] [--urdf FILE]
ros2 run kai_bringup instantiate_vehicle.py --name NAME --out-dir DIR --generator CMD
It writes model.sdf and, when given, ros_gz_bridge.yaml (without
/clock) and robot.urdf for the instance NAME into DIR.
instance_rviz.py
What rviz.launch.xml runs:
ros2 run kai_custom_vehicle instance_rviz.py --name NAME --config BASE.rviz --out FILE
It writes the base RViz config pointed at the instance (fixed frame,
description topic, TF Prefix) to FILE and prints the path.
Worlds
Seven worlds share one contract: the systems every vehicle needs, the
gz-maritime buoyancy reading marked collisions, the waterline at z = 0 and
the wave field for the drawn sea. Pass any of them to the simulation launch
as world:=<name>.sdf; the spawn launch then puts vehicles into it by name.
Four of them are venues of the Virtual RobotX competition (VRX) and the
Virtual Ocean Robotics Challenge (VORC), and one is the venue of the
Maritime RobotX Challenge 2026; the last is an indoor pool.
All of them are named default inside, so the services below work on
every one.
World |
Site |
Terrain |
Where to start |
Water and sea states |
|---|---|---|---|---|
|
Open sea, Monterey Bay coordinates |
None; a landing pad at (8, -8) |
Spawn anywhere |
Open sea, any |
|
Sydney International Regatta Centre, VRX 2022 to 2024 |
Built from open data, from Fuel on first use (about 12 MB); optional seabed; also |
around x -530, y 180; start at x -532, y 180 |
Rowing lake, fresh water, 0 to 2 |
|
Nathan Benderson Park, Sarasota, RobotX 2022 |
Built from open data, from Fuel on first use (about 11 MB); optional seabed; also |
the lake runs along y; start at the origin, heading 1.57 |
Rowing lake, fresh water, 0 to 2 |
|
Sand Island, Honolulu, RobotX 2016 and 2018, VRX 2019 |
Built from open data, from Fuel on first use (about 9 MB); optional seabed; also |
start at x 60, y 120 |
Harbour channel and open ocean, any (calmer in the channel) |
|
La Spezia, VORC 2020 |
Built from open data, from Fuel on first use (about 14 MB); optional seabed; also |
start at x 10, y -372 |
Port and gulf, any (calm in the port) |
|
Marina Bay, Singapore, RobotX 2026 |
Built from OpenStreetMap, from Fuel on first use (about 11 MB); optional seabed; also |
the four courses around the origin; course A at x -45, y 12, heading 0.55 |
Freshwater reservoir, 0 to 2 |
|
Marina Bay set up for the Maritime RobotX Challenge 2026 |
|
the middle of each course’s seawall end; course A at x -53, y 0, heading 0.98 |
Freshwater reservoir, 0 to 2 |
|
An indoor aquatic centre: an Olympic pool and a diving well with a 15 m pit |
A hall, from Fuel on first use (about 3 MB) |
lane 4 at x -20, y -1.25; the diving well at x 45, z -2.5 |
Still pool, no drawn sea, 0 |
Every world starts at sea state 1, Sand Island at 3 and the indoor pool at 0, and takes any of the ten codes (the pool draws no sea), but the last column says what fits the site: a rowing lake never sees more than wind chop (code 2 is 0.3 m waves), while the open water world and the sea sites, Sand Island and La Spezia, take them all. At the sea sites the code sets the open sea, and a shelter map on their water scales the waves down where land, reefs, breakwaters and piers shelter it. Change it with the wave service below.
The site worlds place the water surface model once, at the centre of their
water, and size the drawn sea with <tiles_radius> in their wave source:
the model draws that many 200 m tiles around itself in every direction,
sharing one wave field, and the terrain hides them wherever there is land.
Open water keeps the model’s own radius, a 1 km square. The sites’ water
models also fade the waves out over the last tile (<fadeEdges>) and carry
a shelter map (<textures><shelterMap>, with <shelterOrigin> and
<shelterSize> in its <parameters>): a greyscale image over a world
rectangle, white where the open sea’s full waves reach, black against a
quay. Buoyancy does not depend on any of that.
The site models are credited in kai_gazebo/NOTICE.
The open_water.sdf world
World name: default.
Element |
Setting |
|---|---|
Physics |
DART, 4 ms step |
|
Spawning, moving and removing models |
|
Scene for the GUI |
|
Rendered sensors (ogre2) |
|
IMU, magnetometer, GPS and barometer sensors |
|
Seawater 1025 kg/m³ below z = 0, air 1 kg/m³ above; |
|
Still air by default ( |
|
Slack water by default ( |
|
Sea state 1, updated at 30 Hz; the waves travel towards +x (Gerstner alternative in the file, commented out) |
|
Draws the sea |
|
A static 4 m deck 1 m above the water, the only solid ground; spawn a quad on it at z = 1.25 |
|
36.693509° N, 121.936568° W, elevation 0, ENU |
|
The ocean current, wind and scenario panels, docked on the right, drawing off, a wind sock on the landing pad’s corner; see Change and see the wind and the current |
Buoyancy markup
What a model says to the buoyancy system, and what a world says to it.
Where |
Markup |
Meaning |
|---|---|---|
A |
|
This shape displaces water. A link with any marked collision floats by its marked collisions alone, in nested models too. |
A URDF |
The same |
The only place the conversion keeps the attribute; on a URDF collision or under |
The same |
|
The shape touches nothing; recommended for every mark. |
The world plugin |
|
Unmarked collisions never float. Defaults to |
The world plugin |
|
Unmarked collisions of the named model or link float. Names as spawned. |
Wind markup
What a model says to the wind system.
Where |
Markup |
Meaning |
|---|---|---|
A |
|
The wind pushes on this shape, by the part of it above the water, with quadratic drag on its projected area per axis, taking the wind at the centre of that part. |
The same |
|
Its drag coefficient; the plugin’s |
A |
|
Reads the apparent wind at the sensor, in the sensor frame, as |
Wind parameters
What a world says to the wind system. Each parameter but <model>,
<publish_rate>, <air_density> and <default_drag_coefficient> is also a
key on the wind topic, below.
Markup |
Meaning |
|---|---|
|
The wind: m/s, and the direction it comes from in degrees clockwise from north (270, from the west, blows towards +x). |
|
The vertical wind, m/s, positive up; the z of the world’s |
|
Used as the starting wind when the plugin sets neither |
|
Gusts: standard deviation (m/s, degrees) and correlation time (s, 2 and 10 by default) of the speed and the direction; 0 is steady. The gusts travel with the mean wind. |
|
The height above the water |
|
The wind model the recipe names, |
|
Seed of the gusts; the same seed repeats them, and 0, the default, draws one each run. |
|
Rate of the ground truth, 10 Hz by default. |
|
For the windage: 1.225 kg/m³ and 1 by default. |
The system keeps the wind on the world entity as a recipe, the way the wave
field works, and writes it into gz-sim’s wind entity at the world’s origin.
A system that needs the wind at a point asks gz::sim::wind::WindAt, or
keeps a gz::sim::wind::WindSampler, from the gz_wind library.
Ocean current markup
What a model says to the ocean current system.
Where |
Markup |
Meaning |
|---|---|---|
A |
|
The water pushes on this shape, by the part of it below the water, with quadratic drag on its projected area per axis, taking the current at the centre of that part and the shape’s own velocity there. |
The same |
|
Its drag coefficient; the plugin’s |
The marks are a hydrodynamic model of their own, for a vehicle without
identified coefficients: the water’s drag on the hull, relative to the
water. A vehicle uses one model, its Hydrodynamics plugin or the marks,
never both. The marks damp more than surge and sway: the plan area damps
heave, drag on the part below the centre of mass rolls and pitches the
hull, and a shape off the centre line yaws it, so any plugin damping beside
them counts those axes twice. If a marked vehicle needs more yaw damping,
a Hydrodynamics plugin with yaw terms only (nR, nRabsR) is the most it
may add, and only when no marked shape is off the centre line. The drag
acts at the centre of each wet part, so a single centred box has no yaw
damping at all; a hull of two pontoons does.
Each face of a shape is cut by how vertical its axis is, so a cylinder
lying along the hull, the way a pontoon is modelled, has half its end cap
wet when half of it is under, and its plan area stays whole. The cut is at
the flat <water_level>, not the wave surface, like the windage and the
buoyancy: a hull pitching in waves sees its wet part change with its own
heave and pitch, not with the waves.
Ocean current parameters
What a world says to the ocean current system.
Markup |
Meaning |
|---|---|
|
The current: m/s, and the direction it sets towards in degrees clockwise from north (90, setting east, flows towards +x). The opposite convention from the wind, which is given by where it comes from. Also keys on the ocean current topic, below. |
|
The current model the recipe names, |
|
World z of the water’s surface, 0 by default: where the load on marked shapes cuts them, and where a model that varies with depth puts the surface; |
|
The parameters a model owns, one element each, such as |
|
For a model that draws random numbers; |
|
Rate of the ground truth, 10 Hz by default. |
|
For the load on marked shapes: 1025 kg/m³ and a drag coefficient of 1 by default. The load cuts each shape at |
Any other element is warned about and ignored, so a typo such as <speeed>
does not leave slack water in silence. A <model> nobody registered, or one
that refuses its parameters, is one error from the system, and the world has
no current and no ground truth.
The current is horizontal and uniform with the standard model, and
constant between changes: on the kilometre and hour scales these worlds work at, that is the
water. The system keeps it on the world entity as a recipe, the way the wind
and the wave field work, written as a component change and nothing else, so
every consumer, loaded with the world or spawned later, sees it on the same
step. A system that asks the current every step keeps a
gz::sim::ocean_current::OceanCurrentSampler, from the gz_ocean_current
library; gz::sim::ocean_current::OceanCurrentAt builds the model on every
call and suits an occasional query. The query is a point query: a consumer that spans a gradient
integrates over its own extent with repeated queries.
Water optics parameters
What a world says to the water optics system,
gz-maritime-water-optics-system. Without it, the world has clear water.
Markup |
Meaning |
|---|---|
|
The Jerlov water type, below. Default |
|
Horizontal visibility of a black target, m: scales what the type’s absorption, scattering and diffuse attenuation have above pure water’s (type |
|
β^D, how fast an object’s light fades with range, 1/m, as |
|
β^B, how fast the veil builds with range, 1/m, as |
|
B∞, the veil just below the surface as a fraction of the daylight there, as |
|
K_d, how fast the daylight fades with depth, 1/m, as |
|
World z of the still water, m, default 0. Under a wave field, depth is below the local wave surface. |
|
How strong the daylight is against the renderer’s sun, default 1: it scales the veil. 0 at night, when only lamps light the water. |
|
Strength of the caustics the waves cast on what faces up, 0 to 1, default 0 (off); scaled by the wave height, so none on flat water. Drawn by the underwater rendering. |
|
Marine snow: the fraction of 25 cm cells near the camera that hold a speck, 0 to 1, default 0 (none). Lit by the lamps and faintly by daylight. Drawn by the underwater rendering. |
|
Strength of the light shafts the waves cast through the water, 0 to 1, default 0 (off); scaled by the wave height like the caustics, so none on flat water, and none without a sun above the horizon. Drawn by the underwater rendering. |
|
Rate of the ground truth in wall time, 1 Hz by default, so it keeps coming while paused; a change is published at once. 0 publishes on a change only. |
Any other element is warned about and ignored. An unknown type, a visibility
out of range, a negative coefficient or daylight, or a caustics or marine
snow that is not a number is one error, and the world has clear water. A
caustics or marine snow outside 0 to 1 is clamped to it, with a warning. An explicit <attenuation> wins over <visibility>, with a
warning.
The Jerlov types, from Solonenko and Mobley (2015), at red 625 nm, green 525 nm and blue 450 nm:
Type |
Water |
c = a + b (1/m) |
Veil b / c |
K_d (1/m) |
Visibility (m) |
|---|---|---|---|---|---|
|
Clearest open ocean |
0.296, 0.0481, 0.0218 |
0.00, 0.04, 0.17 |
0.302, 0.049, 0.022 |
99.9 |
|
Clear open ocean |
0.298, 0.0508, 0.0284 |
0.01, 0.08, 0.22 |
0.303, 0.0503, 0.0264 |
94.5 |
|
Clear open ocean |
0.343, 0.103, 0.0915 |
0.14, 0.55, 0.74 |
0.31, 0.0572, 0.0342 |
46.4 |
|
Open ocean |
0.584, 0.434, 0.528 |
0.49, 0.89, 0.95 |
0.337, 0.0845, 0.062 |
11.1 |
|
Turbid open ocean |
1.08, 1.11, 1.42 |
0.73, 0.95, 0.97 |
0.39, 0.129, 0.124 |
4.32 |
|
Clearest coastal |
0.597, 0.463, 0.619 |
0.49, 0.85, 0.83 |
0.395, 0.121, 0.179 |
10.4 |
|
Coastal |
1.16, 1.23, 1.65 |
0.74, 0.94, 0.91 |
0.456, 0.187, 0.319 |
3.91 |
|
Coastal |
1.4, 1.57, 2.17 |
0.77, 0.92, 0.86 |
0.48, 0.277, 0.535 |
3.06 |
|
Turbid coastal |
2.26, 2.77, 3.84 |
0.84, 0.92, 0.86 |
0.6, 0.47, 0.924 |
1.73 |
|
Most turbid coastal |
2.95, 3.81, 5.33 |
0.85, 0.89, 0.82 |
0.763, 0.826, 1.56 |
1.26 |
Each triple is red, green, blue. The values match the paper’s tables (5C in
the red, whose printed row is corrupted, comes from Williamson and Hollins,
2022, and Jerlov, 1976). II and III are the paper’s too, but its model
gives them about two and three and a half times the scattering measured in
open ocean, so III comes out as murky as a harbour. For open ocean use
IB, with a <visibility> if it should be murkier; 1C is the default. The optics are kept on the world entity as
the WaterOptics component; a system that sees through water keeps a
gz::sim::water_optics::WaterOpticsSampler, from the gz_water_optics
library.
Water pressure parameters
What a world says to the water pressure system,
gz-maritime-water-pressure-system, which serves the depth sensors
(type="custom" gz:type="water_pressure"). Each reads
surface_pressure + density * g * depth in pascals, with g the world’s
gravity and depth below a flat, still surface; waves are ignored.
Markup |
Meaning |
|---|---|
|
Density of the water, kg/m³, default 1000. Sea water is about 1025. |
|
World z of the still water surface, m, default 0. Above it a sensor reads the surface pressure. |
|
Pressure of the air on the surface, Pa, default 101325. |
A value that is not a finite number, or a density that is not above zero,
is an error that names it, and its default stays. Keep the density and the
surface in step with the world’s buoyancy; nothing ties them. The sensor’s
own markup is in gz_water_pressure’s README.
Underwater camera parameters
What the underwater camera plugin, gz-maritime-underwater-camera-system,
takes. It goes inside an rgbd_camera sensor that has a <topic>, and
publishes <topic>/underwater/image (gz.msgs.Image, RGB 8 bit) and
<topic>/underwater/camera_info; the sensor’s own topics are unchanged.
Markup |
Default |
Meaning |
|---|---|---|
|
|
Base of the output topics. |
|
|
A gain on linear light, or |
|
|
With |
|
|
|
|
|
Gaussian noise on the light the sensor caught, variance shot_noise · signal + read_noise², before the gain. |
|
|
The noise’s seed, mixed with the sensor’s scoped name, so each camera gets its own noise. |
|
|
Forward scatter: the light from the objects blurred by their range, sigma = forward_scatter · range radians, at most 40 px; between two pixels, by the smaller of their two ranges. |
|
|
|
|
|
Refractive index of the water, for a flat port; 1 or more. |
The water is the world’s (gz-maritime-water-optics-system); without it, or
above the water, only the camera’s response applies, which by default
changes nothing. The plugin works only while its output has a subscriber.
Underwater rendering
Include model://underwater_optics (from gz_underwater_rendering) in a
world with water optics, and every ogre2 camera, and the GUI’s 3D view, sees
through the water: the same model as the underwater camera, per fragment, on
the GPU. The water is the world’s; <enabled>false</enabled> in its plugin
starts it off, and a gz.msgs.Boolean on
/world/<world>/underwater_rendering/enable turns it off and on.
<quality> in its plugin, low, medium (default) or high, sets how
finely the lamps’ beams are marched and how far marine snow is drawn.
Cameras above the water see as in air (lamps included, lit as Ogre lights
them, but casting no shadows while the water is drawn), and an underwater camera plugin in the same world applies only its
own response while it is on. Depth is measured below the wave over each
camera. What PBS shades and what is unlit (particles) is drawn through the
water; looking at nothing, a camera under water sees the veil; the water
surface from below shows Snell’s window, faded by the water; terrain is
drawn as in air. A spot or point light with lamp in its own name (up to
four, the first by name) is a lamp: its light fades both ways through the
water and its beam is drawn, and it casts no shadow, in air too; other
lights are lit by Ogre and, under water, fade with the daylight; set <daylight>0 in
the water optics for night.
Thruster command
What a vehicle’s Thruster plugins expect, with gz-maritime-thruster-system
in normalized mode (<use_normalized_cmd>true</use_normalized_cmd>).
Topic |
Type |
Meaning |
|---|---|---|
|
|
A fraction of full thrust in [-1, 1]: 1 is |
|
|
Propeller speed [rad/s]. |
Services
All take and return Gazebo messages; call them with gz service.
Service |
Request |
Reply |
What it does |
|---|---|---|---|
|
|
|
Change wave parameters while running. |
|
|
|
Spawn a model. |
|
|
|
Move a model. |
Examples
Change the sea state (0 to 9):
gz service -s /world/default/wave/set_parameters --reqtype gz.msgs.Param \
--reptype gz.msgs.Boolean --timeout 2000 \
--req 'params {key: "sea_state" value {type: INT32 int_value: 3}}'
The other wave parameters are listed in the wave design notes.
Spawn a model, and move it:
gz service -s /world/default/create --reqtype gz.msgs.EntityFactory \
--reptype gz.msgs.Boolean --timeout 5000 \
--req 'sdf_filename: "/path/to/model.sdf", name: "my_boat", pose: {position: {z: 0}}'
gz service -s /world/default/set_pose --reqtype gz.msgs.Pose \
--reptype gz.msgs.Boolean --timeout 2000 \
--req 'name: "my_boat", position: {x: 5, y: 0, z: 0}, orientation: {w: 1}'
Wind
The wind changes while the simulation runs on the topic
/world/default/wind/set: a gz.msgs.Param with speed (m/s),
direction (degrees the wind comes from, clockwise from north, kept in
[0, 360)), vertical (m/s, positive up), or any of the gust parameters, in
any combination.
The simulation launch bridges it from ROS as
ros_gz_interfaces/msg/ParamVec, with each key a double parameter. The
current wind is published on /world/default/wind_info as gz.msgs.Wind,
and on /world/default/wind/velocity as gz.msgs.Twist, which the
simulation launch bridges to ROS as geometry_msgs/msg/TwistStamped in the
world frame. Gazebo’s rotor, wing and air speed systems all read the same
wind, at the reference height.
Direction and units
Speed in metres per second, at the reference height, 10 m unless the world says otherwise, as in weather reports.
Direction the wind comes from, in degrees clockwise from true north, as in weather reports, ArduPilot and the marine textbooks: 0 is a north wind, blowing south; 270 is a west wind, blowing east.
North is the world’s, from its
<spherical_coordinates>, the same north its GPS and magnetometer use. With theENUorientation and aheading_degof 0, which every world here has, north is the world’s +y axis and east its +x axis.The ground truth on
/world/default/wind_infois the air’s velocity in the world frame, not a direction: a west wind of 6 m/s readsx: 6, y: 0in these worlds.
A 6 m/s wind from the west, from ROS:
ros2 topic pub --once /world/default/wind/set ros_gz_interfaces/msg/ParamVec \
"{params: [{name: speed, value: {type: 3, double_value: 6.0}}, {name: direction, value: {type: 3, double_value: 270.0}}]}"
Gusts of 1.5 m/s that last about 3 s, from ROS:
ros2 topic pub --once /world/default/wind/set ros_gz_interfaces/msg/ParamVec \
"{params: [{name: speed_gust, value: {type: 3, double_value: 1.5}}, {name: speed_gust_time, value: {type: 3, double_value: 3.0}}]}"
From Gazebo, turning it to come from the south, and reading it back:
gz topic -t /world/default/wind/set -m gz.msgs.Param \
-p 'params {key: "direction" value {type: DOUBLE double_value: 180}}'
gz topic -e -t /world/default/wind_info -n 1
Ocean current
The ocean current is set in the world file and changes while the simulation
runs on the topic /world/default/ocean_current/set: a gz.msgs.Param with
speed (m/s), direction (degrees the current sets towards, clockwise
from north, kept in [0, 360)) or water_level (m), in any combination, each
a double or an integer; any other key is a parameter the model owns and takes
a string or a number. The simulation launch bridges it from ROS as
ros_gz_interfaces/msg/ParamVec. A message is applied whole or not at all:
one key out of range, of the wrong type, or refused by the model, and it
changes nothing. The model itself cannot change at run time: a model key
is refused. A change takes effect on the next step, for every vehicle
at once. The current is published on /world/default/ocean_current_info as
gz.msgs.Twist, which the simulation launch bridges to ROS as
geometry_msgs/msg/TwistStamped in the world frame.
Direction and units
Speed in metres per second.
Direction the current sets towards, in degrees clockwise from true north, as charts draw it and tide tables predict it: 0 sets north, 90 sets east. The wind is given the other way round, by where it comes from: a wind from 270 and a current setting 090 move a boat the same way.
North is the world’s, the same one the wind and the GPS use: with the
ENUorientation and aheading_degof 0, which every world here has, north is the world’s +y axis and east its +x axis.The ground truth on
/world/default/ocean_current_infois the water’s velocity in the world frame, not a direction: a 0.5 m/s current setting east readsx: 0.5, y: 0in these worlds.
A 0.5 m/s current setting east, from ROS:
ros2 topic pub --once /world/default/ocean_current/set ros_gz_interfaces/msg/ParamVec \
"{params: [{name: speed, value: {type: 3, double_value: 0.5}}, {name: direction, value: {type: 3, double_value: 90.0}}]}"
From Gazebo, turning it to set south, and reading it back:
gz topic -t /world/default/ocean_current/set -m gz.msgs.Param \
-p 'params {key: "direction" value {type: DOUBLE double_value: 180}}'
gz topic -e -t /world/default/ocean_current_info -n 1
Water optics
The water is set in the world file and changes while the simulation runs on
the topic /world/<world>/water_optics/set: a gz.msgs.Param whose keys are
the elements above. jerlov takes a string; visibility, water_level,
daylight, caustics, marine_snow and light_shafts a number (or a string holding one);
attenuation, backscatter, veil and diffuse_attenuation a string
"r g b". An empty string removes a
visibility or an explicit value, going back to what the type gives. A
message is applied whole or not at all. The resolved optics are published on
/world/<world>/water_optics_info as gz.msgs.Param: jerlov,
visibility, the four per-channel values as strings, water_level,
daylight, caustics, marine_snow, light_shafts and generation.
gz topic -t /world/default/water_optics/set -m gz.msgs.Param \
-p 'params {key: "jerlov" value {type: STRING string_value: "7C"}}'
gz topic -e -t /world/default/water_optics_info -n 1
Topics
The custom USV’s topics are listed on its vehicle page.