Mount an accessory on a vehicle

A vehicle’s package models what its maker sells: a BlueBoat comes with its Ping echosounder, an X500 with its GPS mast. What you bolt on yourself, a lidar, a stereo camera, a hydrophone array, belongs to neither the vehicle nor to you alone: it is a model of its own. This page mounts such a model on a vehicle without touching the vehicle’s package.

An accessory is a model

Any SDF model with one or more links works: one from this repository, one you downloaded, one you wrote. It names no vehicle. These come with kai_gazebo:

Model

What it is

Sensors

velodyne_vlp16

16 beam 3D lidar, 100 m, 10 Hz

scan

stereolabs_zed2

Stereo camera, 1280x720 at 15 Hz

left (colour and depth), right, imu, magnetometer, barometer

lidar_rangefinder

One beam, 12 m, 30 Hz

range

hydrophone_array

Bearing to an acoustic pinger

pings

Say what goes where

A list, one entry per accessory:

- name: lidar
  model: model://velodyne_vlp16
  parent: mast
  xyz: "0 0 0.5"

- name: zed
  model: model://stereolabs_zed2
  parent: payload
  xyz: "0.016 0 -0.007"

- name: hydrophones
  model: model://hydrophone_array
  xyz: "0.30 0.15 0.10"
  • name is the mount. Topics and frames carry it, so it is unique on the vehicle, made of letters, digits and underscores, starting with a letter, and not vehicle; the same model can be mounted twice under two names.

  • model is a model:// URI, found on GZ_SIM_RESOURCE_PATH, or the path of a model directory or SDF file, relative to the list.

  • parent is a frame of the vehicle: a link of its URDF, such as the mast part or a slot like base_link_payload, or of its model when it has no URDF. It defaults to base_link.

  • xyz and rpy place the model’s origin in that frame: three numbers each, as text ("0 0 0.5") or a list ([0, 0, 0.5]).

Give the list to the spawn launch, next to the vehicle’s own source:

ros2 launch kai_bringup spawn_vehicle.launch.xml name:=boat_a \
    generator:="<the vehicle's generator and config>" \
    accessories:=my_accessories.yaml

What you get

For a robot named boat_a and a mount named zed:

Pattern

Example

Topic

/<robot>/<mount>/<sensor>

/boat_a/zed/left/image, /boat_a/zed/imu

Frame

<robot>/<mount>_<sensor>

boat_a/zed_left

Mount frame

<robot>/<mount>

boat_a/zed

The names the accessory’s own file gave its topics and frames are replaced, so two robots carrying the same model never share one. Each topic is bridged to ROS under the same name, lazily: a sensor nobody subscribes to costs nothing. The topics follow the sensor’s type:

Sensor type

Topics under /<robot>/<mount>/<sensor>

camera

/image, /camera_info

rgbd_camera

/image, /depth_image, /points, /camera_info

gpu_lidar, one beam

the topic itself, a LaserScan

gpu_lidar, several rings

/points, a PointCloud2

imu, magnetometer, navsat, air_pressure, altimeter

the topic itself

water_pressure, anemometer

the topic itself

acoustic_receiver

the topic itself, and /set to retune it

A sensor of another type is named the same way and left for you to bridge.

The vehicle’s own model is not edited. The instance directory keeps it as vehicle.sdf, and model.sdf merges it and holds each accessory as a nested model on a fixed joint, so reading that file shows exactly what was added. A vehicle model that merges robot.urdf, as the example vehicles do, is pointed at a copy of it, vehicle.urdf, because robot.urdf gains the accessories’ frames.

Things to know

  • An accessory has weight. The boat sits lower with a lidar on its mast, and an ROV trimmed from its own mass sinks with a payload it was not trimmed for, as the real ones do.

  • Every update of a camera or lidar is a pass over the scene, and the simulation waits for it. On the RobotX 2026 course, with every sensor of three vehicles subscribed, taking a one beam rangefinder from 50 Hz to the cameras’ 30 Hz raised the real time factor from 0.69 to 0.78. Give a rendered sensor the lowest rate that does the job.

  • A plugin inside an accessory keeps the topics it names. Leave them out of the model, and Gazebo scopes them by the robot and the mount.

  • One model of links. A model that nests or includes other models is refused; flatten it first. A static model is refused too: Gazebo would not fix it to the vehicle. Give its links inertials and drop <static>.

The RobotX 2026 launch uses this for its boat and its UAV.