Aerostack2

DocsROS 2 Interfaces

Aerial platform

The topics, services and parameters every aerial platform offers.

Every platform is built on as2::AerialPlatform, so they all offer the interfaces on this page. The node is called platform. Aerial platform explains what the platform does with them.

Topics

TopicDirectionTypeQoS
platform/infoPublishesas2_msgs/PlatformInfoReliable
actuator_command/poseSubscribesgeometry_msgs/PoseStampedSensor data
actuator_command/twistSubscribesgeometry_msgs/TwistStampedSensor data
actuator_command/thrustSubscribesas2_msgs/ThrustSensor data
actuator_command/trajectorySubscribesas2_msgs/TrajectorySetpointsSensor data
alert_eventSubscribesas2_msgs/AlertEventReliable

platform/info is published at info_freq, 10 Hz by default. It says whether the drone is connected, armed and in offboard, where the state machine is, and which control mode is active.

The actuator commands come from the motion controller. The platform sends the latest ones to the drone at cmd_freq, 100 Hz by default, once a control mode is set and the drone is connected, armed and in offboard. It reads TF to convert them into the frames the control mode asks for.

alert_event acts on two alerts. A kill switch cuts the motors and an emergency hover stops the drone, and both put the state machine in its emergency state. Every other alert is ignored.

Services

ServiceTypeWhat it does
set_arming_statestd_srvs/SetBoolArms with true and disarms with false
set_offboard_modestd_srvs/SetBoolTurns offboard on with true and off with false
set_platform_control_modeas2_msgs/SetControlModeSwitches the control mode. Fails if the platform doesn't support it
platform_takeoffstd_srvs/SetBoolTakes off natively. The request's value is ignored
platform_landstd_srvs/SetBoolLands natively. The request's value is ignored
platform/list_control_modesas2_msgs/ListControlModesReturns the control modes the platform supports
platform/state_machine_eventas2_msgs/SetPlatformStateMachineEventSends an event to the state machine and returns the new state

Most services sit at the root of the namespace

The first five services aren't under platform/. For drone0 they're /drone0/set_arming_state, /drone0/platform_takeoff and so on. Only the last two are under platform/.

platform_takeoff and platform_land move the state machine on from taking off to flying, and from landing to landed. They don't start a take-off or a landing in the state machine, so send the TAKE_OFF or LAND event to platform/state_machine_event first. The take-off and land behaviors do this for you.

platform/state_machine_event is named after the node, unlike the other services. If you launch the platform under another node name the service moves with it, and the take-off and land behaviors can no longer find it.

Sensors

Platforms publish their sensors with the helpers in as2_core/sensor.hpp, which put each one under sensor_measurements/. Which sensors there are depends on the drone, so each platform's page lists its own. These are the usual ones.

TopicTypeQoS
sensor_measurements/odomnav_msgs/OdometrySensor data
sensor_measurements/imusensor_msgs/ImuSensor data
sensor_measurements/gpssensor_msgs/NavSatFixSensor data
sensor_measurements/batterysensor_msgs/BatteryStateSensor data
sensor_measurements/<camera>/imagesensor_msgs/ImageReliable
sensor_measurements/<camera>/camera_infosensor_msgs/CameraInfoReliable
ground_truth/posegeometry_msgs/PoseStampedSensor data
ground_truth/twistgeometry_msgs/TwistStampedSensor data

Cameras go through image_transport, so compressed versions such as sensor_measurements/<camera>/image/compressed appear when their plugins are installed. A camera's topics only appear once its first frame arrives. Each camera also publishes a static transform from base_link to its own frame.

Simulators and motion capture systems publish the ground truth topics, which carry the true pose and velocity of the drone.

Gazebo bridges its sensors instead of using the helpers, so their names differ. A camera publishes sensor_measurements/<camera>/image_raw and a lidar sensor_measurements/<lidar>/scan, named after the sensor in the drone's model. Gazebo has the details.

Parameters

ParameterDefaultWhat it does
control_modes_fileThe YAML file that lists the control modes the platform supports. Required
cmd_freq100.0How often commands are sent to the drone, in Hz
info_freq10.0How often platform/info is published, in Hz
tf_timeout_threshold0.05How long to wait for a transform, in seconds

Last updated on November 3, 2026

On this page

Last updated on November 3, 2026