Aerostack2

DocsROS 2 Interfaces

Motion controller

The topics, services and parameters of the motion controller.

The motion controller runs as one node per drone, called controller_manager. Its interfaces are the same whatever plugin it loads. Motion controller explains how it picks control modes and what the plugins do.

Topics

TopicDirectionTypeQoS
motion_reference/poseSubscribesgeometry_msgs/PoseStampedSensor data
motion_reference/twistSubscribesgeometry_msgs/TwistStampedSensor data
motion_reference/trajectorySubscribesas2_msgs/TrajectorySetpointsSensor data
motion_reference/thrustSubscribesas2_msgs/ThrustSensor data
self_localization/twistSubscribesgeometry_msgs/TwistStampedSensor data
platform/infoSubscribesas2_msgs/PlatformInfoReliable
actuator_command/posePublishesgeometry_msgs/PoseStampedSensor data
actuator_command/twistPublishesgeometry_msgs/TwistStampedSensor data
actuator_command/thrustPublishesas2_msgs/ThrustSensor data
actuator_command/trajectoryPublishesas2_msgs/TrajectorySetpointsSensor data
controller/infoPublishesas2_msgs/ControllerInfoReliable

The controller doesn't subscribe to self_localization/pose. Every time a twist arrives, it looks up the pose of base_link in odom from TF at the twist's timestamp.

It only computes commands while platform/info says the drone is armed and in offboard. It then publishes them at cmd_freq, and controller/info at info_freq.

Commands for each output mode

The output mode decides which actuator_command/* topics the controller publishes on every cycle.

Output modeTopics
Trajectorytrajectory
Positionpose and twist
Speedtwist, plus pose when the yaw is an angle
Speed in a planepose and twist
Attitudepose and thrust, plus twist when the yaw is a speed
Body ratestwist and thrust
HoverNone

Services

ServiceRoleTypeWhat it does
controller/set_control_modeServeras2_msgs/SetControlModeAsks for an input mode. The controller picks an output mode the platform accepts
platform/list_control_modesClientas2_msgs/ListControlModesReads the platform's modes. Called once, and the answer is kept
set_platform_control_modeClientas2_msgs/SetControlModeSets the chosen output mode on the platform

When the controller needs a platform service, it waits for it and tries again every second until it appears. A controller started without a platform blocks its first mode change.

Debug topics

The controller can publish what its plugin sees on every cycle. Each topic has a parameter under debug., and an empty value turns it off. They're all off unless the configuration file sets them, and the default file sets them all. A relative name goes under debug/controller/, and a name that starts with / is used as it is.

ParameterTopic in the default fileType
debug.state_pose_topicdebug/controller/state/posegeometry_msgs/PoseStamped
debug.state_twist_topicdebug/controller/state/twistgeometry_msgs/TwistStamped
debug.reference_pose_topicdebug/controller/reference/posegeometry_msgs/PoseStamped
debug.reference_twist_topicdebug/controller/reference/twistgeometry_msgs/TwistStamped
debug.reference_trajectory_topicdebug/controller/reference/trajectoryas2_msgs/TrajectorySetpoints
debug.compute_output_time_topicdebug/controller/compute_output_timestd_msgs/Float64

The state and references are given in the frames the plugin works in, after the controller converts them. The plugin's output is already on actuator_command/*. Plugins can add their own debug topics, set under <plugin_name>.debug in their configuration file.

Parameters

ParameterDefaultWhat it does
plugin_nameThe controller plugin to load. Required
cmd_freq100.0How often commands are computed and sent, in Hz
info_freq10.0How often controller/info is published, in Hz
use_bypasstruePasses references straight to the platform when it accepts them
tf_timeout_threshold0.05How long to wait for a transform, in seconds
desired_pose_frame""The frame the plugin gets poses in. Empty means odom
desired_twist_frame""The frame the plugin gets twists in. Empty means base_link

The defaults come from the configuration file that ships with the controller, which the launch file loads. A configuration file of your own that leaves out use_bypass turns bypass off.

Last updated on November 3, 2026

On this page

Last updated on November 3, 2026