1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

Move Guidance to VtolPathFollower to make room for FWPathFollower

This commit is contained in:
James Cotton 2012-05-08 00:25:59 -05:00
parent e4cec48f35
commit cbedb5b53b
4 changed files with 23 additions and 23 deletions

View File

@ -1,9 +1,9 @@
/** /**
****************************************************************************** ******************************************************************************
* *
* @file examplemodperiodic.c * @file vtolpathfollower.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
* @brief Example module to be used as a template for actual modules. * @brief Module to perform path following for VTOL.
* *
* @see The GNU Public License (GPL) Version 3 * @see The GNU Public License (GPL) Version 3
* *
@ -23,9 +23,9 @@
* with this program; if not, write to the Free Software Foundation, Inc., * with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#ifndef EXAMPLEMODPERIODIC_H #ifndef VTOLPATHFOLLOWER_H
#define EXAMPLEMODPERIODIC_H #define VTOLPATHFOLLOWER_H
int32_t ExampleModPeriodicInitialize(); int32_t VtolPathFollowerInitialize(void);
int32_t GuidanceInitialize(void);
#endif // EXAMPLEMODPERIODIC_H #endif // VTOLPATHFOLLOWER_H

View File

@ -1,8 +1,8 @@
/** /**
****************************************************************************** ******************************************************************************
* *
* @file guidance.c * @file vtolpathfollower.c
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
* @brief This module compared @ref PositionActuatl to @ref ActiveWaypoint * @brief This module compared @ref PositionActuatl to @ref ActiveWaypoint
* and sets @ref AttitudeDesired. It only does this when the FlightMode field * and sets @ref AttitudeDesired. It only does this when the FlightMode field
* of @ref ManualControlCommand is Auto. * of @ref ManualControlCommand is Auto.
@ -46,7 +46,7 @@
#include "openpilot.h" #include "openpilot.h"
#include "paths.h" #include "paths.h"
#include "guidance.h" #include "vtolpathfollower.h"
#include "accels.h" #include "accels.h"
#include "attitudeactual.h" #include "attitudeactual.h"
#include "pathdesired.h" // object that will be updated by the module #include "pathdesired.h" // object that will be updated by the module
@ -74,11 +74,11 @@
// Private types // Private types
// Private variables // Private variables
static xTaskHandle guidanceTaskHandle; static xTaskHandle pathfollowerTaskHandle;
static xQueueHandle queue; static xQueueHandle queue;
// Private functions // Private functions
static void guidanceTask(void *parameters); static void vtolPathFollowerTask(void *parameters);
static float bound(float val, float min, float max); static float bound(float val, float min, float max);
static void updateNedAccel(); static void updateNedAccel();
@ -93,11 +93,11 @@ static GuidanceSettingsData guidanceSettings;
* Initialise the module, called on startup * Initialise the module, called on startup
* \returns 0 on success or -1 if initialisation failed * \returns 0 on success or -1 if initialisation failed
*/ */
int32_t GuidanceStart() int32_t VtolPathFollowerStart()
{ {
// Start main task // Start main task
xTaskCreate(guidanceTask, (signed char *)"Guidance", STACK_SIZE_BYTES/4, NULL, TASK_PRIORITY, &guidanceTaskHandle); xTaskCreate(vtolPathFollowerTask, (signed char *)"VtolPathFollower", STACK_SIZE_BYTES/4, NULL, TASK_PRIORITY, &pathfollowerTaskHandle);
TaskMonitorAdd(TASKINFO_RUNNING_GUIDANCE, guidanceTaskHandle); TaskMonitorAdd(TASKINFO_RUNNING_PATHFOLLOWER, pathfollowerTaskHandle);
return 0; return 0;
} }
@ -106,7 +106,7 @@ int32_t GuidanceStart()
* Initialise the module, called on startup * Initialise the module, called on startup
* \returns 0 on success or -1 if initialisation failed * \returns 0 on success or -1 if initialisation failed
*/ */
int32_t GuidanceInitialize() int32_t VtolPathFollowerInitialize()
{ {
GuidanceSettingsInitialize(); GuidanceSettingsInitialize();
NedAccelInitialize(); NedAccelInitialize();
@ -122,7 +122,7 @@ int32_t GuidanceInitialize()
return 0; return 0;
} }
MODULE_INITCALL(GuidanceInitialize, GuidanceStart) MODULE_INITCALL(VtolPathFollowerInitialize, VtolPathFollowerStart)
static float northVelIntegral = 0; static float northVelIntegral = 0;
static float eastVelIntegral = 0; static float eastVelIntegral = 0;
@ -137,7 +137,7 @@ static uint8_t positionHoldLast = 0;
/** /**
* Module thread, should not return. * Module thread, should not return.
*/ */
static void guidanceTask(void *parameters) static void vtolPathFollowerTask(void *parameters)
{ {
SystemSettingsData systemSettings; SystemSettingsData systemSettings;
FlightStatusData flightStatus; FlightStatusData flightStatus;

View File

@ -50,7 +50,7 @@ FLASH_TOOL = OPENOCD
# List of modules to include # List of modules to include
MODULES = Sensors Attitude/revolution ManualControl Stabilization Altitude/revolution Actuator GPS FirmwareIAP MODULES = Sensors Attitude/revolution ManualControl Stabilization Altitude/revolution Actuator GPS FirmwareIAP
MODULES += AltitudeHold Guidance PathPlanner MODULES += AltitudeHold VtolPathFollower PathPlanner
MODULES += CameraStab MODULES += CameraStab
MODULES += OveroSync MODULES += OveroSync
MODULES += Telemetry MODULES += Telemetry

View File

@ -1,9 +1,9 @@
<xml> <xml>
<object name="TaskInfo" singleinstance="true" settings="false"> <object name="TaskInfo" singleinstance="true" settings="false">
<description>Task information</description> <description>Task information</description>
<field name="StackRemaining" units="bytes" type="uint16" elementnames="System,Actuator,Attitude,Sensors,TelemetryTx,TelemetryTxPri,TelemetryRx,GPS,ManualControl,Altitude,Stabilization,AltitudeHold,Guidance,FlightPlan,PathPlanner,Com2UsbBridge,Usb2ComBridge,OveroSync"/> <field name="StackRemaining" units="bytes" type="uint16" elementnames="System,Actuator,Attitude,Sensors,TelemetryTx,TelemetryTxPri,TelemetryRx,GPS,ManualControl,Altitude,Stabilization,AltitudeHold,PathFollower,FlightPlan,PathPlanner,Com2UsbBridge,Usb2ComBridge,OveroSync"/>
<field name="Running" units="bool" type="enum" options="False,True" elementnames="System,Actuator,Attitude,Sensors,TelemetryTx,TelemetryTxPri,TelemetryRx,GPS,ManualControl,Altitude,Stabilization,AltitudeHold,Guidance,FlightPlan,PathPlanner,Com2UsbBridge,Usb2ComBridge,OveroSync"/> <field name="Running" units="bool" type="enum" options="False,True" elementnames="System,Actuator,Attitude,Sensors,TelemetryTx,TelemetryTxPri,TelemetryRx,GPS,ManualControl,Altitude,Stabilization,AltitudeHold,PathFollower,FlightPlan,PathPlanner,Com2UsbBridge,Usb2ComBridge,OveroSync"/>
<field name="RunningTime" units="%" type="uint8" elementnames="System,Actuator,Attitude,Sensors,TelemetryTx,TelemetryTxPri,TelemetryRx,GPS,ManualControl,Altitude,Stabilization,AltitudeHold,Guidance,FlightPlan,PathPlanner,Com2UsbBridge,Usb2ComBridge,OveroSync"/> <field name="RunningTime" units="%" type="uint8" elementnames="System,Actuator,Attitude,Sensors,TelemetryTx,TelemetryTxPri,TelemetryRx,GPS,ManualControl,Altitude,Stabilization,AltitudeHold,PathFollower,FlightPlan,PathPlanner,Com2UsbBridge,Usb2ComBridge,OveroSync"/>
<access gcs="readwrite" flight="readwrite"/> <access gcs="readwrite" flight="readwrite"/>
<telemetrygcs acked="true" updatemode="onchange" period="0"/> <telemetrygcs acked="true" updatemode="onchange" period="0"/>
<telemetryflight acked="true" updatemode="periodic" period="10000"/> <telemetryflight acked="true" updatemode="periodic" period="10000"/>