mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-18 03:52:11 +01:00
AHRS/Flight: Allow selecting simple algorithm as well as INSGPS
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1384 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
bd8fffe4d0
commit
e94d3d3846
@ -234,7 +234,10 @@ static void ahrscommsTask(void* parameters)
|
||||
{
|
||||
struct opahrs_msg_v1 req;
|
||||
|
||||
req.payload.user.v.req.algorithm.algorithm = settings.Algorithm;
|
||||
if(settings.Algorithm == AHRSSETTINGS_ALGORITHM_INSGPS)
|
||||
req.payload.user.v.req.algorithm.algorithm = INSGPS_Algo;
|
||||
if(settings.Algorithm == AHRSSETTINGS_ALGORITHM_SIMPLE)
|
||||
req.payload.user.v.req.algorithm.algorithm = SIMPLE_Algo;
|
||||
|
||||
if(( result = PIOS_OPAHRS_SetAlgorithm(&req) ) == OPAHRS_RESULT_OK ) {
|
||||
data.AlgorithmSet = AHRSSTATUS_ALGORITHMSET_TRUE;
|
||||
|
@ -73,7 +73,7 @@ static void setDefaults(UAVObjHandle obj, uint16_t instId)
|
||||
// Initialize object fields to their default values
|
||||
UAVObjGetInstanceData(obj, instId, &data);
|
||||
memset(&data, 0, sizeof(AHRSSettingsData));
|
||||
data.Algorithm = 0;
|
||||
data.Algorithm = 1;
|
||||
data.UpdateRaw = 0;
|
||||
data.UpdateFiltered = 1;
|
||||
data.UpdatePeriod = 20;
|
||||
|
@ -67,7 +67,7 @@ typedef struct {
|
||||
// Field information
|
||||
// Field Algorithm information
|
||||
/* Enumeration options for field Algorithm */
|
||||
typedef enum { AHRSSETTINGS_ALGORITHM_INSGPS=0 } AHRSSettingsAlgorithmOptions;
|
||||
typedef enum { AHRSSETTINGS_ALGORITHM_SIMPLE=0, AHRSSETTINGS_ALGORITHM_INSGPS=1 } AHRSSettingsAlgorithmOptions;
|
||||
// Field UpdateRaw information
|
||||
/* Enumeration options for field UpdateRaw */
|
||||
typedef enum { AHRSSETTINGS_UPDATERAW_FALSE=0, AHRSSETTINGS_UPDATERAW_TRUE=1 } AHRSSettingsUpdateRawOptions;
|
||||
|
@ -36,6 +36,7 @@
|
||||
657CEEC2121DC054007A1FBE /* navigationdesired.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = navigationdesired.c; sourceTree = "<group>"; };
|
||||
657CEEC3121DC054007A1FBE /* navigationsettings.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = navigationsettings.c; sourceTree = "<group>"; };
|
||||
657CF024121F49CD007A1FBE /* WMMInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMMInternal.h; sourceTree = "<group>"; };
|
||||
659ED317122226B60011010E /* ahrssettings.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = ahrssettings.xml; sourceTree = "<group>"; };
|
||||
65B35D7F121C261E003EAD18 /* bin.pro */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = bin.pro; sourceTree = "<group>"; };
|
||||
65B35D80121C261E003EAD18 /* openpilotgcs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = openpilotgcs; sourceTree = "<group>"; };
|
||||
65B35D81121C261E003EAD18 /* openpilotgcs.pri */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = openpilotgcs.pri; sourceTree = "<group>"; };
|
||||
@ -2551,7 +2552,6 @@
|
||||
65B367E9121C2620003EAD18 /* attitudeactual.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = attitudeactual.xml; sourceTree = "<group>"; };
|
||||
65B367EA121C2620003EAD18 /* attitudedesired.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = attitudedesired.xml; sourceTree = "<group>"; };
|
||||
65B367EB121C2620003EAD18 /* attituderaw.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = attituderaw.xml; sourceTree = "<group>"; };
|
||||
65B367EC121C2620003EAD18 /* attitudesettings.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = attitudesettings.xml; sourceTree = "<group>"; };
|
||||
65B367ED121C2620003EAD18 /* exampleobject1.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = exampleobject1.xml; sourceTree = "<group>"; };
|
||||
65B367EE121C2620003EAD18 /* exampleobject2.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = exampleobject2.xml; sourceTree = "<group>"; };
|
||||
65B367EF121C2620003EAD18 /* examplesettings.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = examplesettings.xml; sourceTree = "<group>"; };
|
||||
@ -6669,6 +6669,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
655268BC121FBD2900410C6E /* ahrscalibration.xml */,
|
||||
659ED317122226B60011010E /* ahrssettings.xml */,
|
||||
65B367E7121C2620003EAD18 /* ahrsstatus.xml */,
|
||||
65B367E4121C2620003EAD18 /* actuatorcommand.xml */,
|
||||
65B367E5121C2620003EAD18 /* actuatordesired.xml */,
|
||||
@ -6676,7 +6677,6 @@
|
||||
65B367E9121C2620003EAD18 /* attitudeactual.xml */,
|
||||
65B367EA121C2620003EAD18 /* attitudedesired.xml */,
|
||||
65B367EB121C2620003EAD18 /* attituderaw.xml */,
|
||||
65B367EC121C2620003EAD18 /* attitudesettings.xml */,
|
||||
65209A1812208B0600453371 /* baroaltitude.xml */,
|
||||
65B367ED121C2620003EAD18 /* exampleobject1.xml */,
|
||||
65B367EE121C2620003EAD18 /* exampleobject2.xml */,
|
||||
|
@ -45,6 +45,7 @@ AHRSSettings::AHRSSettings(): UAVDataObject(OBJID, ISSINGLEINST, ISSETTINGS, NAM
|
||||
QStringList AlgorithmElemNames;
|
||||
AlgorithmElemNames.append("0");
|
||||
QStringList AlgorithmEnumOptions;
|
||||
AlgorithmEnumOptions.append("SIMPLE");
|
||||
AlgorithmEnumOptions.append("INSGPS");
|
||||
fields.append( new UAVObjectField(QString("Algorithm"), QString(""), UAVObjectField::ENUM, AlgorithmElemNames, AlgorithmEnumOptions) );
|
||||
QStringList UpdateRawElemNames;
|
||||
@ -95,7 +96,7 @@ UAVObject::Metadata AHRSSettings::getDefaultMetadata()
|
||||
*/
|
||||
void AHRSSettings::setDefaultFieldValues()
|
||||
{
|
||||
data.Algorithm = 0;
|
||||
data.Algorithm = 1;
|
||||
data.UpdateRaw = 0;
|
||||
data.UpdateFiltered = 1;
|
||||
data.UpdatePeriod = 20;
|
||||
|
@ -53,7 +53,7 @@ public:
|
||||
// Field information
|
||||
// Field Algorithm information
|
||||
/* Enumeration options for field Algorithm */
|
||||
typedef enum { ALGORITHM_INSGPS=0 } AlgorithmOptions;
|
||||
typedef enum { ALGORITHM_SIMPLE=0, ALGORITHM_INSGPS=1 } AlgorithmOptions;
|
||||
// Field UpdateRaw information
|
||||
/* Enumeration options for field UpdateRaw */
|
||||
typedef enum { UPDATERAW_FALSE=0, UPDATERAW_TRUE=1 } UpdateRawOptions;
|
||||
|
@ -45,7 +45,8 @@ _fields = [ \
|
||||
'0',
|
||||
],
|
||||
{
|
||||
'0' : 'INSGPS',
|
||||
'0' : 'SIMPLE',
|
||||
'1' : 'INSGPS',
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
|
@ -1,6 +1,6 @@
|
||||
<xml>
|
||||
<object name="AHRSSettings" singleinstance="true" settings="true">
|
||||
<field name="Algorithm" units="" type="enum" elements="1" options="INSGPS" defaultvalue="INSGPS"/>
|
||||
<field name="Algorithm" units="" type="enum" elements="1" options="SIMPLE,INSGPS" defaultvalue="INSGPS"/>
|
||||
<field name="UpdateRaw" units="raw" type="enum" elements="1" options="FALSE,TRUE" defaultvalue="FALSE"/>
|
||||
<field name="UpdateFiltered" units="raw" type="enum" elements="1" options="FALSE,TRUE" defaultvalue="TRUE"/>
|
||||
<field name="UpdatePeriod" units="ms" type="int32" elements="1" defaultvalue="20"/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user