From cbedb5b53b56e1bd9410a897f9fc735046941d3f Mon Sep 17 00:00:00 2001 From: James Cotton Date: Tue, 8 May 2012 00:25:59 -0500 Subject: [PATCH] Move Guidance to VtolPathFollower to make room for FWPathFollower --- .../inc/vtolpathfollower.h} | 16 +++++++------- .../vtolpathfollower.c} | 22 +++++++++---------- flight/Revolution/Makefile | 2 +- shared/uavobjectdefinition/taskinfo.xml | 6 ++--- 4 files changed, 23 insertions(+), 23 deletions(-) rename flight/Modules/{Guidance/inc/guidance.h => VtolPathFollower/inc/vtolpathfollower.h} (77%) rename flight/Modules/{Guidance/guidance.c => VtolPathFollower/vtolpathfollower.c} (97%) diff --git a/flight/Modules/Guidance/inc/guidance.h b/flight/Modules/VtolPathFollower/inc/vtolpathfollower.h similarity index 77% rename from flight/Modules/Guidance/inc/guidance.h rename to flight/Modules/VtolPathFollower/inc/vtolpathfollower.h index 86ef46b2d..f97f1588b 100644 --- a/flight/Modules/Guidance/inc/guidance.h +++ b/flight/Modules/VtolPathFollower/inc/vtolpathfollower.h @@ -1,9 +1,9 @@ /** ****************************************************************************** * - * @file examplemodperiodic.c - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * @brief Example module to be used as a template for actual modules. + * @file vtolpathfollower.h + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. + * @brief Module to perform path following for VTOL. * * @see The GNU Public License (GPL) Version 3 * @@ -23,9 +23,9 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef EXAMPLEMODPERIODIC_H -#define EXAMPLEMODPERIODIC_H +#ifndef VTOLPATHFOLLOWER_H +#define VTOLPATHFOLLOWER_H -int32_t ExampleModPeriodicInitialize(); -int32_t GuidanceInitialize(void); -#endif // EXAMPLEMODPERIODIC_H +int32_t VtolPathFollowerInitialize(void); + +#endif // VTOLPATHFOLLOWER_H diff --git a/flight/Modules/Guidance/guidance.c b/flight/Modules/VtolPathFollower/vtolpathfollower.c similarity index 97% rename from flight/Modules/Guidance/guidance.c rename to flight/Modules/VtolPathFollower/vtolpathfollower.c index 2d3e3f9b4..2e26e01c0 100644 --- a/flight/Modules/Guidance/guidance.c +++ b/flight/Modules/VtolPathFollower/vtolpathfollower.c @@ -1,8 +1,8 @@ /** ****************************************************************************** * - * @file guidance.c - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. + * @file vtolpathfollower.c + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. * @brief This module compared @ref PositionActuatl to @ref ActiveWaypoint * and sets @ref AttitudeDesired. It only does this when the FlightMode field * of @ref ManualControlCommand is Auto. @@ -46,7 +46,7 @@ #include "openpilot.h" #include "paths.h" -#include "guidance.h" +#include "vtolpathfollower.h" #include "accels.h" #include "attitudeactual.h" #include "pathdesired.h" // object that will be updated by the module @@ -74,11 +74,11 @@ // Private types // Private variables -static xTaskHandle guidanceTaskHandle; +static xTaskHandle pathfollowerTaskHandle; static xQueueHandle queue; // Private functions -static void guidanceTask(void *parameters); +static void vtolPathFollowerTask(void *parameters); static float bound(float val, float min, float max); static void updateNedAccel(); @@ -93,11 +93,11 @@ static GuidanceSettingsData guidanceSettings; * Initialise the module, called on startup * \returns 0 on success or -1 if initialisation failed */ -int32_t GuidanceStart() +int32_t VtolPathFollowerStart() { // Start main task - xTaskCreate(guidanceTask, (signed char *)"Guidance", STACK_SIZE_BYTES/4, NULL, TASK_PRIORITY, &guidanceTaskHandle); - TaskMonitorAdd(TASKINFO_RUNNING_GUIDANCE, guidanceTaskHandle); + xTaskCreate(vtolPathFollowerTask, (signed char *)"VtolPathFollower", STACK_SIZE_BYTES/4, NULL, TASK_PRIORITY, &pathfollowerTaskHandle); + TaskMonitorAdd(TASKINFO_RUNNING_PATHFOLLOWER, pathfollowerTaskHandle); return 0; } @@ -106,7 +106,7 @@ int32_t GuidanceStart() * Initialise the module, called on startup * \returns 0 on success or -1 if initialisation failed */ -int32_t GuidanceInitialize() +int32_t VtolPathFollowerInitialize() { GuidanceSettingsInitialize(); NedAccelInitialize(); @@ -122,7 +122,7 @@ int32_t GuidanceInitialize() return 0; } -MODULE_INITCALL(GuidanceInitialize, GuidanceStart) +MODULE_INITCALL(VtolPathFollowerInitialize, VtolPathFollowerStart) static float northVelIntegral = 0; static float eastVelIntegral = 0; @@ -137,7 +137,7 @@ static uint8_t positionHoldLast = 0; /** * Module thread, should not return. */ -static void guidanceTask(void *parameters) +static void vtolPathFollowerTask(void *parameters) { SystemSettingsData systemSettings; FlightStatusData flightStatus; diff --git a/flight/Revolution/Makefile b/flight/Revolution/Makefile index 19b8817f5..f0470a590 100644 --- a/flight/Revolution/Makefile +++ b/flight/Revolution/Makefile @@ -50,7 +50,7 @@ FLASH_TOOL = OPENOCD # List of modules to include MODULES = Sensors Attitude/revolution ManualControl Stabilization Altitude/revolution Actuator GPS FirmwareIAP -MODULES += AltitudeHold Guidance PathPlanner +MODULES += AltitudeHold VtolPathFollower PathPlanner MODULES += CameraStab MODULES += OveroSync MODULES += Telemetry diff --git a/shared/uavobjectdefinition/taskinfo.xml b/shared/uavobjectdefinition/taskinfo.xml index 06e897b62..d8599a9a5 100644 --- a/shared/uavobjectdefinition/taskinfo.xml +++ b/shared/uavobjectdefinition/taskinfo.xml @@ -1,9 +1,9 @@ Task information - - - + + +