2 ******************************************************************************
3 * @addtogroup OpenPilotLibraries OpenPilot Libraries
5 * @addtogroup Navigation
6 * @brief setups RTH/PH and other pathfollower/pathplanner status
10 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2014.
12 * @see The GNU Public License (GPL) Version 3
14 ******************************************************************************/
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 3 of the License, or
19 * (at your option) any later version.
21 * This program is distributed in the hope that it will be useful, but
22 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
23 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
26 * You should have received a copy of the GNU General Public License along
27 * with this program; if not, write to the Free Software Foundation, Inc.,
28 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
34 #include <pios_math.h>
36 /** \page standard Plans
37 How to use this library
38 \li Call plan_initialize() to init all needed struct and uavos at startup.<br>
39 It may be safely called more than once.<br>
41 \li Functions called plan_setup_* needs to be called once, every time the requested function is engaged.<br>
43 \li Functions called plan_run_* are to be periodically called while the requested mode is engaged.<br>
47 * @brief initialize UAVOs and structs used by this library
49 void plan_initialize();
52 * @brief setup pathplanner/pathfollower for positionhold
54 void plan_setup_positionHold();
57 * @brief setup pathplanner/pathfollower for return to base
59 void plan_setup_returnToBase();
62 * @brief setup pathplanner/pathfollower for land
64 void plan_setup_land();
65 void plan_setup_AutoTakeoff();
68 * @brief setup pathplanner/pathfollower for braking
70 void plan_setup_assistedcontrol();
72 #define PATHDESIRED_MODEPARAMETER_BRAKE_STARTVELOCITYVECTOR_NORTH 0
73 #define PATHDESIRED_MODEPARAMETER_BRAKE_STARTVELOCITYVECTOR_EAST 1
74 #define PATHDESIRED_MODEPARAMETER_BRAKE_STARTVELOCITYVECTOR_DOWN 2
75 #define PATHDESIRED_MODEPARAMETER_BRAKE_TIMEOUT 3
77 #define PATHDESIRED_MODEPARAMETER_VELOCITY_VELOCITYVECTOR_NORTH 0
78 #define PATHDESIRED_MODEPARAMETER_VELOCITY_VELOCITYVECTOR_EAST 1
79 #define PATHDESIRED_MODEPARAMETER_VELOCITY_VELOCITYVECTOR_DOWN 2
80 #define PATHDESIRED_MODEPARAMETER_VELOCITY_UNUSED 3
82 #define PATHDESIRED_MODEPARAMETER_LAND_VELOCITYVECTOR_NORTH 0
83 #define PATHDESIRED_MODEPARAMETER_LAND_VELOCITYVECTOR_EAST 1
84 #define PATHDESIRED_MODEPARAMETER_LAND_VELOCITYVECTOR_DOWN 2
85 #define PATHDESIRED_MODEPARAMETER_LAND_OPTIONS 3
87 #define PATHDESIRED_MODEPARAMETER_LAND_OPTION_NONE 0
88 #define PATHDESIRED_MODEPARAMETER_LAND_OPTION_HORIZONTAL_PH 1
90 #define PATHDESIRED_MODEPARAMETER_GOTOENDPOINT_NEXTCOMMAND 0
91 #define PATHDESIRED_MODEPARAMETER_GOTOENDPOINT_UNUSED1 1
92 #define PATHDESIRED_MODEPARAMETER_GOTOENDPOINT_UNUSED2 2
93 #define PATHDESIRED_MODEPARAMETER_GOTOENDPOINT_UNUSED3 3
95 #define PATHDESIRED_MODEPARAMETER_AUTOTAKEOFF_NORTH 0
96 #define PATHDESIRED_MODEPARAMETER_AUTOTAKEOFF_EAST 1
97 #define PATHDESIRED_MODEPARAMETER_AUTOTAKEOFF_DOWN 2
98 #define PATHDESIRED_MODEPARAMETER_AUTOTAKEOFF_CONTROLSTATE 3
101 * @brief setup pathfollower for positionvario
103 void plan_setup_CourseLock();
104 void plan_setup_PositionRoam();
105 void plan_setup_VelocityRoam();
106 void plan_setup_HomeLeash();
107 void plan_setup_AbsolutePosition();
110 * @brief run for positionvario
112 void plan_run_CourseLock();
113 void plan_run_PositionRoam();
114 void plan_run_VelocityRoam();
115 void plan_run_HomeLeash();
116 void plan_run_AbsolutePosition();
117 void plan_run_AutoTakeoff();
120 * @brief setup pathplanner/pathfollower for AutoCruise
122 void plan_setup_AutoCruise();
125 * @brief execute AutoCruise
127 void plan_run_AutoCruise();
129 #endif /* PLANS_H_ */