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

OP-124 Flight: Missed some of the files in the previous commit for AHRS SPI error counts

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1348 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
peabody124 2010-08-21 09:23:40 +00:00 committed by peabody124
parent ba4dc14cea
commit 3ad47be673
4 changed files with 30 additions and 2 deletions

View File

@ -69,6 +69,13 @@ AhrsStatus::AhrsStatus(): UAVDataObject(OBJID, ISSINGLEINST, ISSETTINGS, NAME)
SerialNumberElemNames.append("23");
SerialNumberElemNames.append("24");
fields.append( new UAVObjectField(QString("SerialNumber"), QString("n/a"), UAVObjectField::UINT8, SerialNumberElemNames, QStringList()) );
QStringList CommErrorsElemNames;
CommErrorsElemNames.append("Attitude");
CommErrorsElemNames.append("AttitudeRaw");
CommErrorsElemNames.append("PositionActual");
CommErrorsElemNames.append("HomeLocation");
CommErrorsElemNames.append("Altitude");
fields.append( new UAVObjectField(QString("CommErrors"), QString("count"), UAVObjectField::UINT8, CommErrorsElemNames, QStringList()) );
// Initialize object
initializeFields(fields, (quint8*)&data, NUMBYTES);

View File

@ -44,6 +44,7 @@ public:
// Field structure
typedef struct {
quint8 SerialNumber[25];
quint8 CommErrors[5];
} __attribute__((packed)) DataFields;
@ -51,10 +52,15 @@ public:
// Field SerialNumber information
/* Number of elements for field SerialNumber */
static const quint32 SERIALNUMBER_NUMELEM = 25;
// Field CommErrors information
/* Array element names for field CommErrors */
typedef enum { COMMERRORS_ATTITUDE=0, COMMERRORS_ATTITUDERAW=1, COMMERRORS_POSITIONACTUAL=2, COMMERRORS_HOMELOCATION=3, COMMERRORS_ALTITUDE=4 } CommErrorsElem;
/* Number of elements for field CommErrors */
static const quint32 COMMERRORS_NUMELEM = 5;
// Constants
static const quint32 OBJID = 3344048156U;
static const quint32 OBJID = 2618706832U;
static const QString NAME;
static const bool ISSINGLEINST = 1;
static const bool ISSETTINGS = 0;

View File

@ -71,12 +71,26 @@ _fields = [ \
{
}
),
uavobject.UAVObjectField(
'CommErrors',
'B',
5,
[
'Attitude',
'AttitudeRaw',
'PositionActual',
'HomeLocation',
'Altitude',
],
{
}
),
]
class AhrsStatus(uavobject.UAVObject):
## Object constants
OBJID = 3344048156
OBJID = 2618706832
NAME = "AhrsStatus"
METANAME = "AhrsStatusMeta"
ISSINGLEINST = 1

View File

@ -1,6 +1,7 @@
<xml>
<object name="AhrsStatus" singleinstance="true" settings="false">
<field name="SerialNumber" units="n/a" type="uint8" elements="25"/>
<field name="CommErrors" units="count" type="uint8" elementnames="Attitude,AttitudeRaw,PositionActual,HomeLocation,Altitude"/>
<access gcs="readwrite" flight="readwrite"/>
<telemetrygcs acked="false" updatemode="manual" period="0"/>
<telemetryflight acked="false" updatemode="periodic" period="1000"/>