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 |
|---|---|---|
|
16 beam 3D lidar, 100 m, 10 Hz |
|
|
Stereo camera, 1280x720 at 15 Hz |
|
|
One beam, 12 m, 30 Hz |
|
|
Bearing to an acoustic pinger |
|
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"
nameis 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 notvehicle; the same model can be mounted twice under two names.modelis amodel://URI, found onGZ_SIM_RESOURCE_PATH, or the path of a model directory or SDF file, relative to the list.parentis a frame of the vehicle: a link of its URDF, such as themastpart or a slot likebase_link_payload, or of its model when it has no URDF. It defaults tobase_link.xyzandrpyplace 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 |
|
|
Frame |
|
|
Mount frame |
|
|
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 |
|---|---|
|
|
|
|
|
the topic itself, a |
|
|
|
the topic itself |
|
the topic itself |
|
the topic itself, and |
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.