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

open_water.sdf

World file, by name on GZ_SIM_RESOURCE_PATH or as a full path.

gazebo_gui

true

Start the Gazebo GUI.

use_composition

true

Run the Gazebo server and the bridge as composable nodes in ros_gz_container.

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

name

Instance name: model name, topic prefix, ROS namespace and TF prefix. Letters, digits and underscores, starting with a letter.

xacro

Model xacro, rendered with name:=<name> and, when a URDF is given, urdf_uri:=file://<rendered URDF>. A plain SDF file is copied as it is.

bridge

Bridge config template with @name@ where the name goes; a /clock entry is dropped. Optional.

urdf

URDF, xacro or plain, for robot_state_publisher. Optional.

generator

Instead of xacro: a command run as <command> --name <name> --out-dir <dir> that writes model.sdf, ros_gz_bridge.yaml and a URDF there.

accessories

empty

List of models to mount on the vehicle’s frames; see Mount an accessory.

x, y, z

0

Spawn position [m]; z = 0 is the waterline.

roll, pitch, yaw

0

Spawn orientation [rad].

world

empty

Name of the world to spawn into; empty picks the one running.

instance_dir

$ROS_HOME/kai_bringup/<name>

Where the instance’s files are written; ~/.ros/kai_bringup/<name> by default. It belongs to the instance: with generator:=, any *.urdf, model.sdf and ros_gz_bridge.yaml in it are removed first.

use_composition

true

Load the bridge and state publisher into container_name.

container_name

ros_gz_container

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

sydney_regatta.sdf

World file, as for the simulation launch, among those the demo has poses for: sydney_regatta.sdf (at the start point) or open_water.sdf (around the origin).

gazebo_gui

true

Start the Gazebo GUI.

use_composition

true

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

course

a

The course whose pontoon the vehicles start at: a to d.

gazebo_gui

true

Start the Gazebo GUI.

use_composition

true

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

name

custom_usv

Instance to look at.

instance_dir

$ROS_HOME/kai_bringup/<name>

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

gui

true

Start joint_state_publisher_gui to move the propellers.

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_water.sdf

Open sea, Monterey Bay coordinates

None; a landing pad at (8, -8)

Spawn anywhere

Open sea, any

sydney_regatta.sdf

Sydney International Regatta Centre, VRX 2022 to 2024

Built from open data, from Fuel on first use (about 12 MB); optional seabed; also sydney_regatta_lite.sdf, lighter, about 4 MB

around x -530, y 180; start at x -532, y 180

Rowing lake, fresh water, 0 to 2

benderson_park.sdf

Nathan Benderson Park, Sarasota, RobotX 2022

Built from open data, from Fuel on first use (about 11 MB); optional seabed; also benderson_park_lite.sdf, lighter, about 3 MB

the lake runs along y; start at the origin, heading 1.57

Rowing lake, fresh water, 0 to 2

sand_island.sdf

Sand Island, Honolulu, RobotX 2016 and 2018, VRX 2019

Built from open data, from Fuel on first use (about 9 MB); optional seabed; also sand_island_lite.sdf, lighter, about 5 MB

start at x 60, y 120

Harbour channel and open ocean, any (calmer in the channel)

la_spezia.sdf

La Spezia, VORC 2020

Built from open data, from Fuel on first use (about 14 MB); optional seabed; also la_spezia_lite.sdf, lighter, about 7 MB

start at x 10, y -372

Port and gulf, any (calm in the port)

marina_bay.sdf

Marina Bay, Singapore, RobotX 2026

Built from OpenStreetMap, from Fuel on first use (about 11 MB); optional seabed; also marina_bay_lite.sdf, lighter, about 8 MB

the four courses around the origin; course A at x -45, y 12, heading 0.55

Freshwater reservoir, 0 to 2

robotx_2026.sdf

Marina Bay set up for the Maritime RobotX Challenge 2026

marina_bay.sdf’s site with the four courses, their task elements and the dressed pontoon, all from Fuel on first use

the middle of each course’s seawall end; course A at x -53, y 0, heading 0.98

Freshwater reservoir, 0 to 2

aquatic_centre.sdf

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

gz-sim-user-commands-system

Spawning, moving and removing models

gz-sim-scene-broadcaster-system

Scene for the GUI

gz-sim-sensors-system

Rendered sensors (ogre2)

gz-sim-imu-system, gz-sim-magnetometer-system, gz-sim-navsat-system, gz-sim-air-pressure-system

IMU, magnetometer, GPS and barometer sensors

gz-maritime-buoyancy-system

Seawater 1025 kg/m³ below z = 0, air 1 kg/m³ above; <enable_by_default>false</enable_by_default>, no <enable> list

gz-maritime-wind-system

Still air by default (<speed>0</speed>) at a 10 m reference height, falling off towards the water with a 0.0002 m roughness length, changed at run time on the wind topic; pushes only marked collisions, with air at 1.225 kg/m³ and a drag coefficient of 1 unless a shape sets its own

gz-maritime-ocean-current-system

Slack water by default (<speed>0</speed>); a uniform, horizontal current set in the world file and changed at run time on the ocean current topic, kept on the world as a recipe any system can ask at a point and published as ground truth. A vehicle feels it through gz-maritime-hydrodynamics-system, or through collisions it marks, with seawater at 1025 kg/m³ and a drag coefficient of 1 unless a shape sets its own; gz-sim’s own Hydrodynamics does not see it

gz-sim-waves-fft-system

Sea state 1, updated at 30 Hz; the waves travel towards +x (Gerstner alternative in the file, commented out)

model://water_surface

Draws the sea

model://landing_pad at (8, -8)

A static 4 m deck 1 m above the water, the only solid ground; spawn a quad on it at z = 1.25

<spherical_coordinates>

36.693509° N, 121.936568° W, elevation 0, ENU

<gui>: OceanCurrentPanel, WindPanel, ScenarioPanel

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 <collision> in a model

gz:buoyancy="true" (with xmlns:gz="http://gazebosim.org/schema" on the root)

This shape displaces water. A link with any marked collision floats by its marked collisions alone, in nested models too.

A URDF

The same <collision>, inside a <link> in a model-level <gazebo> block

The only place the conversion keeps the attribute; on a URDF collision or under <gazebo reference> it is dropped.

The same <collision>

<surface><contact><collide_bitmask>0x00</collide_bitmask></contact></surface>

The shape touches nothing; recommended for every mark.

The world plugin

<enable_by_default>false</enable_by_default>

Unmarked collisions never float. Defaults to true with no <enable> list and false with one.

The world plugin

<enable>model</enable>, <enable>model::link</enable>

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 <collision> in a model

gz:wind="true" (same xmlns:gz root attribute)

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. "1" works too. A mesh counts as its bounding box. A buoyancy box can carry both marks.

The same <collision>

gz:wind_cd="1.2"

Its drag coefficient; the plugin’s <default_drag_coefficient> otherwise.

A <sensor> on a link

type="custom" gz:type="anemometer"

Reads the apparent wind at the sensor, in the sensor frame, as gz.msgs.Twist on its <topic>, at its <update_rate> (every step without one), with its <frame_id>.

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

<speed>, <direction>

The wind: m/s, and the direction it comes from in degrees clockwise from north (270, from the west, blows towards +x).

<vertical>

The vertical wind, m/s, positive up; the z of the world’s <wind> by default.

<wind><linear_velocity>x y z</linear_velocity></wind> on the world

Used as the starting wind when the plugin sets neither <speed> nor <direction>.

<speed_gust>, <speed_gust_time>, <direction_gust>, <direction_gust_time>

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.

<reference_height>, <roughness_length>, <water_level>

The height above the water <speed> is given at, 10 m by default, the surface roughness of a logarithmic wind profile, 0.0002 m over open sea (0, the default, is a uniform wind; it slows the mean wind, not the gusts), and the world z of the water. Gazebo’s rotor and wing systems see the reference height wind.

<model>

The wind model the recipe names, standard by default.

<seed>

Seed of the gusts; the same seed repeats them, and 0, the default, draws one each run.

<publish_rate>

Rate of the ground truth, 10 Hz by default.

<air_density>, <default_drag_coefficient>

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 <collision> in a model

gz:ocean_current="true" (same xmlns:gz root attribute)

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. "1" works too. A mesh counts as its bounding box. A buoyancy box can carry the buoyancy and wind marks too.

The same <collision>

gz:ocean_current_cd="1.2"

Its drag coefficient; the plugin’s <default_drag_coefficient> otherwise.

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

<speed>, <direction>

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.

<model>

The current model the recipe names, standard by default: uniform and horizontal. A new model is one class registered under a name; nothing else changes.

<water_level>

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; standard does not read it.

<parameters>

The parameters a model owns, one element each, such as <source>, the file of a gridded current. Opaque to the system, which only stores and replicates them; the model accepts or refuses them. A leaf is its text; an element with children or attributes of its own, such as <layer><depth>10</depth></layer>, is its SDF text, for the model to parse. A name that repeats is a list, numbered in order: three <constituent> elements are constituent.0, constituent.1 and constituent.2. standard takes none.

<seed>

For a model that draws random numbers; standard draws none. 1 by default, so a run repeats; 0 draws a new one each run.

<publish_rate>

Rate of the ground truth, 10 Hz by default.

<water_density>, <default_drag_coefficient>

For the load on marked shapes: 1025 kg/m³ and a drag coefficient of 1 by default. The load cuts each shape at <water_level>.

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

<jerlov>

The Jerlov water type, below. Default 1C.

<visibility>

Horizontal visibility of a black target, m: scales what the type’s absorption, scattering and diffuse attenuation have above pure water’s (type I) by the same factor, so that 4.8 / c in the green comes out at this distance (Zaneveld and Pegau 2003). Clearer water turns bluer; beyond about 100 m, clearer than pure water, below 0.1 m, and for type I, it is an error. Ignored, with a warning, when all four coefficients are given.

<attenuation>

β^D, how fast an object’s light fades with range, 1/m, as r g b. Replaces c = a + b.

<backscatter>

β^B, how fast the veil builds with range, 1/m, as r g b. Replaces c.

<veil>

B∞, the veil just below the surface as a fraction of the daylight there, as r g b. Replaces b / c.

<diffuse_attenuation>

K_d, how fast the daylight fades with depth, 1/m, as r g b. Replaces the type’s K_d.

<water_level>

World z of the still water, m, default 0. Under a wave field, depth is below the local wave surface.

<daylight>

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.

<caustics>

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>

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.

<light_shafts>

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.

<publish_rate>

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)

I

Clearest open ocean

0.296, 0.0481, 0.0218

0.00, 0.04, 0.17

0.302, 0.049, 0.022

99.9

IA

Clear open ocean

0.298, 0.0508, 0.0284

0.01, 0.08, 0.22

0.303, 0.0503, 0.0264

94.5

IB

Clear open ocean

0.343, 0.103, 0.0915

0.14, 0.55, 0.74

0.31, 0.0572, 0.0342

46.4

II

Open ocean

0.584, 0.434, 0.528

0.49, 0.89, 0.95

0.337, 0.0845, 0.062

11.1

III

Turbid open ocean

1.08, 1.11, 1.42

0.73, 0.95, 0.97

0.39, 0.129, 0.124

4.32

1C

Clearest coastal

0.597, 0.463, 0.619

0.49, 0.85, 0.83

0.395, 0.121, 0.179

10.4

3C

Coastal

1.16, 1.23, 1.65

0.74, 0.94, 0.91

0.456, 0.187, 0.319

3.91

5C

Coastal

1.4, 1.57, 2.17

0.77, 0.92, 0.86

0.48, 0.277, 0.535

3.06

7C

Turbid coastal

2.26, 2.77, 3.84

0.84, 0.92, 0.86

0.6, 0.47, 0.924

1.73

9C

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>

Density of the water, kg/m³, default 1000. Sea water is about 1025.

<surface_z>

World z of the still water surface, m, default 0. Above it a sensor reads the surface pressure.

<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

<output_topic>

<topic>/underwater

Base of the output topics.

<exposure>

1

A gain on linear light, or auto, aiming the mean luminance at 0.18.

<max_gain>

16

With auto, the gain stays within 1/max and max.

<white_balance>

none

none, or grey_world, which takes the water’s tint out.

<shot_noise>, <read_noise>

0

Gaussian noise on the light the sensor caught, variance shot_noise · signal + read_noise², before the gain.

<seed>

1

The noise’s seed, mixed with the sensor’s scoped name, so each camera gets its own noise.

<forward_scatter>

0

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.

<port>

none

flat (refracts, magnifies about 1.33×) or dome (centred on the lens: no change).

<water_index>

1.333

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

/<name>/motor_<side>/cmd

gz.msgs.Double (std_msgs/msg/Float64 over the bridge)

A fraction of full thrust in [-1, 1]: 1 is <max_thrust_cmd> ahead, -1 is <min_thrust_cmd> astern, 0 stops. Latches.

/<name>/motor_<side>/cmd/ang_vel

gz.msgs.Double

Propeller speed [rad/s].

Services

All take and return Gazebo messages; call them with gz service.

Service

Request

Reply

What it does

/world/default/wave/set_parameters

gz.msgs.Param

gz.msgs.Boolean

Change wave parameters while running.

/world/default/create

gz.msgs.EntityFactory

gz.msgs.Boolean

Spawn a model.

/world/default/set_pose

gz.msgs.Pose

gz.msgs.Boolean

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 the ENU orientation and a heading_deg of 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_info is the air’s velocity in the world frame, not a direction: a west wind of 6 m/s reads x: 6, y: 0 in 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 ENU orientation and a heading_deg of 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_info is the water’s velocity in the world frame, not a direction: a 0.5 m/s current setting east reads x: 0.5, y: 0 in 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.