Table of Contents

MAVLink v0.9 to v1.0 Porting Guide

Version v0.9 of MAVLink is very similar to the v1.0 release, with a few minor changes and renames. The functionality of the v1.0 is greater than in v0.9, so no functionality is lost.

Relevant Changes

Porting Preparations

Porting Steps

System Heartbeat and Status

Execute these search and replace operations:

The previous base modes do not exist further, instead they have been replaced by a mode indicating the system arm status:

MAV_MODE_AUTO became MAV_MODE_AUTO_DISARMED and MAV_MODE_AUTO_ARMED. One example. The previous switch checked the MAV mode wether the system is in guided or auto:

After the introduction of the state flags, the same check can be done by combining the flag's position with a logical AND with the uint8_t mode:

if (((mode&MAV_MODE_FLAG_DECODE_POSITION_AUTO) || (mode&MAV_MODE_FLAG_DECODE_POSITION_GUIDED)) && positionLock)

The result is either 0 or 1, depending if the AUTO or GUIDED bits were set.

Alternatively the new _ARMED and _DISARMED enum values can be used directly:

MAV_MODE_ARMED

The system types have also been slightly renamed:

MAV_AUTOPILOT_GENERIC_MISSION_WAYPOINTS_ONLY -> MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY
MAV_AUTOPILOT_GENERIC_MISSION_NAVIGATION_ONLY -> MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY

Global and Local Position

Search and replace:

mavlink_local_position_t -> mavlink_local_position_ned_t
MAVLINK_MSG_ID_LOCAL_POSITION -> MAVLINK_MSG_ID_LOCAL_POSITION_NED
mavlink_msg_local_position -> mavlink_msg_local_position_ned

Waypoint Interface, now MISSION Interface

The waypoint interface has now changed, it was however renamed for clarity to mission interface.

Execute these search and replace operations (CASE SENSITIVE PLEASE!):

mavlink_waypoint_ack_t -> mavlink_mission_ack_t
mavlink_waypoint_request_t -> mavlink_mission_request_t
mavlink_waypoint_reached_t -> mavlink_mission_item_reached_t
mavlink_waypoint_current_t -> mavlink_mission_current_t
mavlink_waypoint_set_current_t -> mavlink_mission_set_current_t
mavlink_waypoint_count_t -> mavlink_mission_count_t
mavlink_waypoint_clear_all_t -> mavlink_mission_clear_all_t
mavlink_waypoint_t -> mavlink_mission_item_t

mavlink_msg_waypoint_ack -> mavlink_msg_mission_ack
mavlink_msg_waypoint_request -> mavlink_msg_mission_request
mavlink_msg_waypoint_reached -> mavlink_msg_mission_item_reached
mavlink_msg_waypoint_current -> mavlink_msg_mission_current
mavlink_msg_waypoint_set_current -> mavlink_msg_mission_set_current
mavlink_msg_waypoint_count -> mavlink_msg_mission_count
mavlink_msg_waypoint_clear_all -> mavlink_msg_mission_clear_all
mavlink_msg_waypoint -> mavlink_msg_mission_item

MAVLINK_MSG_ID_WAYPOINT_ACK -> MAVLINK_MSG_ID_MISSION_ACK
MAVLINK_MSG_ID_WAYPOINT_REQUEST -> MAVLINK_MSG_ID_MISSION_REQUEST
MAVLINK_MSG_ID_WAYPOINT_REACHED -> MAVLINK_MSG_ID_MISSION_ITEM_REACHED
MAVLINK_MSG_ID_WAYPOINT_CURRENT -> MAVLINK_MSG_ID_MISSION_CURRENT
MAVLINK_MSG_ID_WAYPOINT_SET_CURRENT -> MAVLINK_MSG_ID_MISSION_SET_CURRENT
MAVLINK_MSG_ID_WAYPOINT_COUNT -> MAVLINK_MSG_ID_MISSION_COUNT
MAVLINK_MSG_ID_WAYPOINT -> MAVLINK_MSG_ID_MISSION_ITEM

Parameter Interface

MAVLINK_TYPE_FLOAT