2014-05-19 18:35:18 +02:00
|
|
|
/**
|
|
|
|
******************************************************************************
|
|
|
|
* @addtogroup OpenPilotLibraries OpenPilot Libraries
|
|
|
|
* @{
|
|
|
|
* @addtogroup Navigation
|
|
|
|
* @brief setups RTH/PH and other pathfollower/pathplanner status
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @file plan.h
|
|
|
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2014.
|
|
|
|
*
|
|
|
|
* @see The GNU Public License (GPL) Version 3
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
/*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
|
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
* for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef PLANS_H_
|
|
|
|
#define PLANS_H_
|
2015-01-08 03:20:47 +01:00
|
|
|
#include <stdint.h>
|
2014-05-19 18:35:18 +02:00
|
|
|
#include <pios_math.h>
|
|
|
|
|
|
|
|
/** \page standard Plans
|
|
|
|
How to use this library
|
|
|
|
\li Call plan_initialize() to init all needed struct and uavos at startup.<br>
|
|
|
|
It may be safely called more than once.<br>
|
|
|
|
|
|
|
|
\li Functions called plan_setup_* needs to be called once, every time the requested function is engaged.<br>
|
|
|
|
|
|
|
|
\li Functions called plan_run_* are to be periodically called while the requested mode is engaged.<br>
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief initialize UAVOs and structs used by this library
|
|
|
|
*/
|
|
|
|
void plan_initialize();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief setup pathplanner/pathfollower for positionhold
|
|
|
|
*/
|
|
|
|
void plan_setup_positionHold();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief setup pathplanner/pathfollower for return to base
|
|
|
|
*/
|
|
|
|
void plan_setup_returnToBase();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief setup pathplanner/pathfollower for land
|
|
|
|
*/
|
|
|
|
void plan_setup_land();
|
2015-04-12 13:39:31 +02:00
|
|
|
void plan_setup_AutoTakeoff();
|
2014-05-19 18:35:18 +02:00
|
|
|
|
2015-01-08 03:20:47 +01:00
|
|
|
/**
|
|
|
|
* @brief setup pathplanner/pathfollower for braking
|
|
|
|
*/
|
2015-05-16 12:33:03 +02:00
|
|
|
void plan_setup_assistedcontrol();
|
2015-01-08 03:20:47 +01:00
|
|
|
|
|
|
|
#define PATHDESIRED_MODEPARAMETER_BRAKE_STARTVELOCITYVECTOR_NORTH 0
|
|
|
|
#define PATHDESIRED_MODEPARAMETER_BRAKE_STARTVELOCITYVECTOR_EAST 1
|
|
|
|
#define PATHDESIRED_MODEPARAMETER_BRAKE_STARTVELOCITYVECTOR_DOWN 2
|
|
|
|
#define PATHDESIRED_MODEPARAMETER_BRAKE_TIMEOUT 3
|
|
|
|
|
2015-03-20 11:42:20 +01:00
|
|
|
#define PATHDESIRED_MODEPARAMETER_VELOCITY_VELOCITYVECTOR_NORTH 0
|
|
|
|
#define PATHDESIRED_MODEPARAMETER_VELOCITY_VELOCITYVECTOR_EAST 1
|
|
|
|
#define PATHDESIRED_MODEPARAMETER_VELOCITY_VELOCITYVECTOR_DOWN 2
|
|
|
|
#define PATHDESIRED_MODEPARAMETER_VELOCITY_UNUSED 3
|
|
|
|
|
|
|
|
#define PATHDESIRED_MODEPARAMETER_LAND_VELOCITYVECTOR_NORTH 0
|
|
|
|
#define PATHDESIRED_MODEPARAMETER_LAND_VELOCITYVECTOR_EAST 1
|
|
|
|
#define PATHDESIRED_MODEPARAMETER_LAND_VELOCITYVECTOR_DOWN 2
|
|
|
|
#define PATHDESIRED_MODEPARAMETER_LAND_OPTIONS 3
|
|
|
|
|
|
|
|
#define PATHDESIRED_MODEPARAMETER_LAND_OPTION_NONE 0
|
|
|
|
#define PATHDESIRED_MODEPARAMETER_LAND_OPTION_HORIZONTAL_PH 1
|
|
|
|
|
|
|
|
#define PATHDESIRED_MODEPARAMETER_GOTOENDPOINT_NEXTCOMMAND 0
|
|
|
|
#define PATHDESIRED_MODEPARAMETER_GOTOENDPOINT_UNUSED1 1
|
|
|
|
#define PATHDESIRED_MODEPARAMETER_GOTOENDPOINT_UNUSED2 2
|
|
|
|
#define PATHDESIRED_MODEPARAMETER_GOTOENDPOINT_UNUSED3 3
|
2015-04-12 13:39:31 +02:00
|
|
|
|
|
|
|
#define PATHDESIRED_MODEPARAMETER_AUTOTAKEOFF_NORTH 0
|
|
|
|
#define PATHDESIRED_MODEPARAMETER_AUTOTAKEOFF_EAST 1
|
|
|
|
#define PATHDESIRED_MODEPARAMETER_AUTOTAKEOFF_DOWN 2
|
|
|
|
#define PATHDESIRED_MODEPARAMETER_AUTOTAKEOFF_CONTROLSTATE 3
|
|
|
|
|
2014-06-04 10:29:45 +02:00
|
|
|
/**
|
|
|
|
* @brief setup pathfollower for positionvario
|
|
|
|
*/
|
2014-11-08 12:56:17 +01:00
|
|
|
void plan_setup_CourseLock();
|
2014-11-08 16:01:59 +01:00
|
|
|
void plan_setup_PositionRoam();
|
2015-03-20 11:42:20 +01:00
|
|
|
void plan_setup_VelocityRoam();
|
2014-11-08 16:01:59 +01:00
|
|
|
void plan_setup_HomeLeash();
|
2014-11-08 12:56:17 +01:00
|
|
|
void plan_setup_AbsolutePosition();
|
2014-06-04 10:29:45 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief run for positionvario
|
|
|
|
*/
|
2014-11-08 12:56:17 +01:00
|
|
|
void plan_run_CourseLock();
|
2014-11-08 16:01:59 +01:00
|
|
|
void plan_run_PositionRoam();
|
2015-03-20 11:42:20 +01:00
|
|
|
void plan_run_VelocityRoam();
|
2014-11-08 16:01:59 +01:00
|
|
|
void plan_run_HomeLeash();
|
2014-11-08 12:56:17 +01:00
|
|
|
void plan_run_AbsolutePosition();
|
2015-04-12 13:39:31 +02:00
|
|
|
void plan_run_AutoTakeoff();
|
2014-06-04 10:29:45 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief setup pathplanner/pathfollower for AutoCruise
|
|
|
|
*/
|
|
|
|
void plan_setup_AutoCruise();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief execute AutoCruise
|
|
|
|
*/
|
|
|
|
void plan_run_AutoCruise();
|
|
|
|
|
2014-05-19 18:35:18 +02:00
|
|
|
#endif /* PLANS_H_ */
|