Sensors
Sensors are parts fitted into slots, with one exception: the IMU, barometer and magnetometer belong to the airframe itself, as the autopilot carries them on the real vehicle. The slots and their accepted types are in the configuration page, and new sensor parts can be added following the Add a part guide.
Available sensors
Sensor |
Part |
Slot |
Fitted by default |
|---|---|---|---|
IMU, barometer, magnetometer |
the airframe |
yes |
|
GPS |
|
|
yes |
Gimbal camera, looking down |
|
|
no |
Sensors ROS API
Flight sensors
ROS Topic |
Description |
Message type |
|---|---|---|
|
Body IMU |
|
|
Barometer |
|
|
Magnetometer |
GPS
ROS Topic |
Description |
Message type |
|---|---|---|
|
Position fix, 10 Hz, about 1.5 m across and 3 m up |
Gimbal camera
Fitted with - {slot: gimbal, type: gimbal_camera}. The head is held looking
straight down; the gimbal’s axes are not driven. The landing gear shows at the
left and right edges of the image.
ROS Topic |
Description |
Message type |
|---|---|---|
|
1280x720 at 30 Hz, 81 degrees across, in |
|
|
Camera intrinsics |
The world needs gz-sim-sensors-system and a GPU for the camera; the worlds
here run it, and it stays idle while no camera is fitted.
<name> is the instance name, x500 for the default instance, or
whatever the quad was spawned as (Several vehicles).
A part topic follows the part’s own name (gps above), so a part renamed
or removed in the config moves or drops its topics
(Configuration).
Sensor messages carry the sensor’s frame under the instance name
(<name>/base_link for the flight sensors, <name>/gps_antenna for the
GPS), which is the frame robot_state_publisher publishes for the
instance.
The PX4 variant
Generated with px4:=true, the model has the same four flight sensors a
second time, for PX4 in simulation. They are extra: every
topic above is still there.
Gazebo topic |
Sensor |
|---|---|
|
IMU, 250 Hz |
|
Barometer, 50 Hz |
|
Magnetometer, 100 Hz |
|
GPS, 30 Hz |
These are the topics PX4 subscribes to, fixed in its code, and they are not
bridged to ROS. The world’s name and the instance’s name are part of each,
so a variant is generated for one world and one name.
model://x500_with_px4 is for the world x500_px4 and the name x500:
use it there, under its own name. Included under another <name>, PX4
cannot hear its sensors and its motors still listen on /x500/..., with no
error. For another world or name, generate one:
ros2 run x500_gazebo configure_vehicle.py \
--config "$(ros2 pkg prefix --share x500_description)"/config/x500.yaml \
--px4 --world my_world.sdf --out-dir $HOME/my_x500
--world takes a world’s name or its SDF file, and --name gives the
instance a name of its own.