mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-17 02:52:12 +01:00
OP-493: Populate the Accessory Desired from TX
This commit is contained in:
parent
54d9977eb1
commit
1365542103
@ -140,6 +140,7 @@ endif
|
||||
|
||||
## UAVOBJECTS
|
||||
ifndef TESTAPP
|
||||
SRC += $(OPUAVSYNTHDIR)/accessorydesired.c
|
||||
SRC += $(OPUAVSYNTHDIR)/objectpersistence.c
|
||||
SRC += $(OPUAVSYNTHDIR)/gcstelemetrystats.c
|
||||
SRC += $(OPUAVSYNTHDIR)/flighttelemetrystats.c
|
||||
|
@ -42,6 +42,7 @@
|
||||
#include "stabilizationdesired.h"
|
||||
#include "flighttelemetrystats.h"
|
||||
#include "flightstatus.h"
|
||||
#include "accessorydesired.h"
|
||||
|
||||
// Private constants
|
||||
#if defined(PIOS_MANUAL_STACK_SIZE)
|
||||
@ -75,6 +76,7 @@ static ArmState_t armState;
|
||||
static portTickType lastSysTime;
|
||||
|
||||
// Private functions
|
||||
static void updateAccessoryDesired(ManualControlCommandData * cmd);
|
||||
static void updateActuatorDesired(ManualControlCommandData * cmd);
|
||||
static void updateStabilizationDesired(ManualControlCommandData * cmd, ManualControlSettingsData * settings);
|
||||
static void processFlightMode(ManualControlSettingsData * settings, float flightMode);
|
||||
@ -294,17 +296,30 @@ static void manualControlTask(void *parameters)
|
||||
break;
|
||||
case FLIGHTMODE_MANUAL:
|
||||
updateActuatorDesired(&cmd);
|
||||
updateAccessoryDesired(&cmd);
|
||||
break;
|
||||
case FLIGHTMODE_STABILIZED:
|
||||
updateStabilizationDesired(&cmd, &settings);
|
||||
updateAccessoryDesired(&cmd);
|
||||
break;
|
||||
case FLIGHTMODE_GUIDANCE:
|
||||
updateAccessoryDesired(&cmd);
|
||||
// TODO: Implement
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void updateAccessoryDesired(ManualControlCommandData * cmd)
|
||||
{
|
||||
AccessoryDesiredData accessory;
|
||||
AccessoryDesiredGet(&accessory);
|
||||
accessory.Accessory1 = cmd->Accessory1;
|
||||
accessory.Accessory2 = cmd->Accessory2;
|
||||
accessory.Accessory3 = cmd->Accessory3;
|
||||
AccessoryDesiredSet(&accessory);
|
||||
}
|
||||
|
||||
static void updateActuatorDesired(ManualControlCommandData * cmd)
|
||||
{
|
||||
ActuatorDesiredData actuator;
|
||||
|
@ -24,6 +24,7 @@
|
||||
# (all architectures)
|
||||
|
||||
UAVOBJSRCFILENAMES =
|
||||
UAVOBJSRCFILENAMES += accessorydesired
|
||||
UAVOBJSRCFILENAMES += actuatorcommand
|
||||
UAVOBJSRCFILENAMES += actuatordesired
|
||||
UAVOBJSRCFILENAMES += actuatorsettings
|
||||
|
@ -2738,6 +2738,7 @@
|
||||
65E6E09912E037C800058553 /* pios_adc_priv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pios_adc_priv.h; sourceTree = "<group>"; };
|
||||
65E8C743139A6D0900E1F979 /* pios_crc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pios_crc.c; sourceTree = "<group>"; };
|
||||
65E8C745139A6D1A00E1F979 /* pios_crc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pios_crc.h; sourceTree = "<group>"; };
|
||||
65E8C788139AA2A800E1F979 /* accessorydesired.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = accessorydesired.xml; sourceTree = "<group>"; };
|
||||
65E8EF1F11EEA61E00BBF654 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; name = Makefile; path = ../../OpenPilot/Makefile; sourceTree = SOURCE_ROOT; };
|
||||
65E8EF2011EEA61E00BBF654 /* Makefile.posix */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Makefile.posix; path = ../../OpenPilot/Makefile.posix; sourceTree = SOURCE_ROOT; };
|
||||
65E8EF5C11EEA61E00BBF654 /* alarms.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = alarms.c; path = ../../OpenPilot/System/alarms.c; sourceTree = SOURCE_ROOT; };
|
||||
@ -7418,6 +7419,7 @@
|
||||
65C35E4F12EFB2F3004811C2 /* uavobjectdefinition */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
65E8C788139AA2A800E1F979 /* accessorydesired.xml */,
|
||||
65C35E5012EFB2F3004811C2 /* actuatorcommand.xml */,
|
||||
65C35E5112EFB2F3004811C2 /* actuatordesired.xml */,
|
||||
65C35E5212EFB2F3004811C2 /* actuatorsettings.xml */,
|
||||
|
@ -23,7 +23,8 @@ SOURCES += uavobject.cpp \
|
||||
OTHER_FILES += UAVObjects.pluginspec
|
||||
|
||||
# Add in all of the synthetic/generated uavobject files
|
||||
HEADERS += $$UAVOBJECT_SYNTHETICS/ahrsstatus.h \
|
||||
HEADERS += $$UAVOBJECT_SYNTHETICS/accessorydesired.h \
|
||||
$$UAVOBJECT_SYNTHETICS/ahrsstatus.h \
|
||||
$$UAVOBJECT_SYNTHETICS/ahrscalibration.h \
|
||||
$$UAVOBJECT_SYNTHETICS/baroaltitude.h \
|
||||
$$UAVOBJECT_SYNTHETICS/attitudeactual.h \
|
||||
@ -69,7 +70,8 @@ HEADERS += $$UAVOBJECT_SYNTHETICS/ahrsstatus.h \
|
||||
$$UAVOBJECT_SYNTHETICS/flightstatus.h \
|
||||
$$UAVOBJECT_SYNTHETICS/attitudesettings.h
|
||||
|
||||
SOURCES += $$UAVOBJECT_SYNTHETICS/ahrsstatus.cpp \
|
||||
SOURCES += $$UAVOBJECT_SYNTHETICS/accessorydesired.cpp \
|
||||
$$UAVOBJECT_SYNTHETICS/ahrsstatus.cpp \
|
||||
$$UAVOBJECT_SYNTHETICS/ahrscalibration.cpp \
|
||||
$$UAVOBJECT_SYNTHETICS/baroaltitude.cpp \
|
||||
$$UAVOBJECT_SYNTHETICS/attitudeactual.cpp \
|
||||
|
Loading…
x
Reference in New Issue
Block a user