MAVLink Interface Definitions
Make table in gitbook here
The definitions that are used through the MAVlink protocol for the complex trajectory tracking are defined in the SET_POSITION_TARGET_LOCAL_NED message and can be seen in the following table:
time_boot_ms
uint32_t
ms
Timestamp (time since system boot)
x
float
m
X Position in NED frame
y
float
m
Y Position in NED frame
z
float
m
Z Position in NED frame (note, altitude is negative in NED)
vx
float
m/s
X velocity in NED frame
vy
float
m/s
Y velocity in NED frame
vz
float
m/s
Z velocity in NED frame
afx
float
m/s/s
X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
afy
float
m/s/s
Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
afz
float
m/s/s
Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
yaw
float
rad
yaw setpoint
yaw_rate
float
rad/s
yaw rate setpoint
From this list of definition, all of them can be set or a select few, it all depends on what the user desires before setting the type_mask field appropriately. For the tracking in this example, we will set every field to ensure ideal tracking of the trajectory.
MAVROS Topics
A complete list of MAVROS topics can be found:
The important MAVROS topics and services used with Clover can be referenced from their website:
Where the information is repeated here:
Main services
/mavros/set_mode
โ set flight mode of the controller. Most often used to set the OFFBOARD mode to accept commands from Raspberry Pi.
/mavros/cmd/arming
โ arm or disarm drone motors (change arming status).
Main published topics
/mavros/state
โ status of connection to the flight controller and flight controller mode.
/mavros/local_position/pose
โ local position and orientation of the copter in the ENU coordinate system.
/mavros/local_position/velocity
โ current speed in local coordinates and angular velocities.
/mavros/global_position/global
โ current global position (latitude, longitude, altitude).
/mavros/global_position/local
โ the global position in the UTM coordinate system.
/mavros/global_position/rel_alt
โ relative altitude (relative to the arming altitude).
Messages published in the topics may be viewed with the rostopic
utility, e.g., rostopic echo /mavros/state
. See more in working with ROS.
Main topics for publication
/mavros/setpoint_position/local
โ set target position and yaw of the drone (in the ENU coordinate system).
/mavros/setpoint_position/global
โ set target position in global coordinates (latitude, longitude, altitude) and yaw of the drone.
/mavros/setpoint_position/cmd_vel
โ set target linear velocity of the drone.
/mavros/setpoint_attitude/attitude
and /mavros/setpoint_attitude/att_throttle
โ set target attitude and throttle level.
/mavros/setpoint_attitude/cmd_vel
and /mavros/setpoint_attitude/att_throttle
โ set target angular velocity and throttle level.
Topics for sending raw packets
/mavros/setpoint_raw/local
โ sends SET_POSITION_TARGET_LOCAL_NED message. Allows setting target position/target speed and target yaw/angular yaw velocity. The values to be set are selected using the type_mask
field.
/mavros/setpoint_raw/attitude
โ sends SET_ATTITUDE_TARGET message. Allows setting the target attitude /angular velocity and throttle level. The values to be set are selected using the type_mask
field
/mavros/setpoint_raw/global
โ sends SET_POSITION_TARGET_GLOBAL_INT. Allows setting the target attitude in global coordinates (latitude, longitude, altitude) and flight speed.
Last updated