1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +01:00

OP-1374 - Autostart the relevant PathFollower for known frame types

This commit is contained in:
Alessio Morale 2014-06-29 17:23:57 +02:00
parent 3ae85f6434
commit 30491c7992
2 changed files with 9 additions and 2 deletions

View File

@ -62,6 +62,7 @@
#include "velocitystate.h" #include "velocitystate.h"
#include "taskinfo.h" #include "taskinfo.h"
#include <pios_struct_helper.h> #include <pios_struct_helper.h>
#include <sanitycheck.h>
#include "sin_lookup.h" #include "sin_lookup.h"
#include "paths.h" #include "paths.h"
@ -112,7 +113,10 @@ int32_t FixedWingPathFollowerInitialize()
HwSettingsInitialize(); HwSettingsInitialize();
HwSettingsOptionalModulesData optionalModules; HwSettingsOptionalModulesData optionalModules;
HwSettingsOptionalModulesGet(&optionalModules); HwSettingsOptionalModulesGet(&optionalModules);
if (optionalModules.FixedWingPathFollower == HWSETTINGS_OPTIONALMODULES_ENABLED) { FrameType_t frameType = GetCurrentFrameType();
if ((optionalModules.FixedWingPathFollower == HWSETTINGS_OPTIONALMODULES_ENABLED) ||
(frameType == FRAME_TYPE_FIXED_WING)) {
followerEnabled = true; followerEnabled = true;
FixedWingPathFollowerSettingsInitialize(); FixedWingPathFollowerSettingsInitialize();
FixedWingPathFollowerStatusInitialize(); FixedWingPathFollowerStatusInitialize();

View File

@ -73,6 +73,7 @@
#include "paths.h" #include "paths.h"
#include "CoordinateConversions.h" #include "CoordinateConversions.h"
#include <sanitycheck.h>
#include "cameradesired.h" #include "cameradesired.h"
#include "poilearnsettings.h" #include "poilearnsettings.h"
@ -128,8 +129,10 @@ int32_t VtolPathFollowerInitialize()
HwSettingsOptionalModulesData optionalModules; HwSettingsOptionalModulesData optionalModules;
HwSettingsOptionalModulesGet(&optionalModules); HwSettingsOptionalModulesGet(&optionalModules);
FrameType_t frameType = GetCurrentFrameType();
if (optionalModules.VtolPathFollower == HWSETTINGS_OPTIONALMODULES_ENABLED) { if ((optionalModules.VtolPathFollower == HWSETTINGS_OPTIONALMODULES_ENABLED) ||
(frameType == FRAME_TYPE_MULTIROTOR)) {
VtolPathFollowerSettingsInitialize(); VtolPathFollowerSettingsInitialize();
NedAccelInitialize(); NedAccelInitialize();
PathDesiredInitialize(); PathDesiredInitialize();