FirmwareArchitecture: Multirotor Navigation
Clone this wiki locally
The VTOL navigation is factored into a few tiers spread across two modules, described in more detail below:
- PathPlanner (common to planes): high level module that iterates between waypoints sequentially
- VtolPathFollower: lower level module that supports following the path as well as RTH and PH
- FSM: allows multistep messages like RTH, PH with loiter, as well as passing messages from PathPlanner
- Control: implements the control algorithms
- Paths: a library that contains the math for working out distance along and away from the path. Called from the control code
There is some awkwardness with this layout. The FSM architecture of the VtolPathFollower would be powerful enough to handle sequencing waypoints too. As is, it is somewhat underutilized.
- PathPlanner - the highest level module. Not usable on F3 platforms or below for lack of memory. This manages lists of Waypoints as copies the appropriate Waypoint (determined by WaypointActive) to PathDesired. The information to indicate this comes from PathStatus.Status becoming complete.
- FSM - certain goals can be activated that the VtolPathFollower module will attempt to achieve. Some flight modes map to these modes.
- ReturnToHome: activates GOAL_LAND_HOME which will ascend to 15m (if below), hover, fly to the home location, and finally land.
- PositionHold: this mode will attempt to remain where it was activated. It also supports loitering, where using pitch and roll will move the setpoint forward or laterally.
- PathPlanner: this follows the sequence of waypoints passed from PathPlanner via PathDesired
- Control - this implements the control algorithms (mostly PID). There are three implemented currently
- vtol_follower_control_path - follow a linear or curved path segment
- vtol_follower_control_endpoint - attempt to stay (or move to) the requested location
- vtol_follower_control_land - attempt to descend at the requested location
- Paths - the math that works with straight lines and curves to compute the distance along the path segment and calculate the tangential error