mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-17 02:52:12 +01:00
OP-32 GCS/Objects Initial release of ManualControl (ServoIn) and Actuator (ServoOut) related objects. Still work in progress.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@633 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
6b6740109e
commit
d2dfb1fdea
@ -46,7 +46,7 @@ UAVObjectBrowserWidget::UAVObjectBrowserWidget(QWidget *parent) : QWidget(parent
|
||||
m_model = new UAVObjectTreeModel();
|
||||
m_browser->treeView->setModel(m_model);
|
||||
m_browser->treeView->setColumnWidth(0, 300);
|
||||
m_browser->treeView->expandAll();
|
||||
//m_browser->treeView->expandAll();
|
||||
BrowserItemDelegate *m_delegate = new BrowserItemDelegate();
|
||||
m_browser->treeView->setItemDelegate(m_delegate);
|
||||
m_browser->treeView->setEditTriggers(QAbstractItemView::AllEditTriggers);
|
||||
|
125
ground/src/plugins/uavobjects/actuatorcommand.cpp
Normal file
125
ground/src/plugins/uavobjects/actuatorcommand.cpp
Normal file
@ -0,0 +1,125 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file actuatorcommand.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Implementation of the ActuatorCommand object. This file has been
|
||||
* automatically generated by the UAVObjectGenerator.
|
||||
*
|
||||
* @note Object definition file: actuatorcommand.xml.
|
||||
* This is an automatically generated file.
|
||||
* DO NOT modify manually.
|
||||
*
|
||||
* @see The GNU Public License (GPL) Version 3
|
||||
*
|
||||
*****************************************************************************/
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include "actuatorcommand.h"
|
||||
#include "uavobjectfield.h"
|
||||
|
||||
const QString ActuatorCommand::NAME = QString("ActuatorCommand");
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
ActuatorCommand::ActuatorCommand(): UAVDataObject(OBJID, ISSINGLEINST, ISSETTINGS, NAME)
|
||||
{
|
||||
// Create fields
|
||||
QList<UAVObjectField*> fields;
|
||||
QStringList ChannelElemNames;
|
||||
ChannelElemNames.append("0");
|
||||
ChannelElemNames.append("1");
|
||||
ChannelElemNames.append("2");
|
||||
ChannelElemNames.append("3");
|
||||
ChannelElemNames.append("4");
|
||||
ChannelElemNames.append("5");
|
||||
ChannelElemNames.append("6");
|
||||
ChannelElemNames.append("7");
|
||||
fields.append( new UAVObjectField(QString("Channel"), QString("us"), UAVObjectField::INT16, ChannelElemNames, QStringList()) );
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, (quint8*)&data, NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the default metadata for this object
|
||||
*/
|
||||
UAVObject::Metadata ActuatorCommand::getDefaultMetadata()
|
||||
{
|
||||
UAVObject::Metadata metadata;
|
||||
metadata.gcsTelemetryAcked = 1;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject::UPDATEMODE_MANUAL;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
metadata.flightTelemetryAcked = 1;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject::UPDATEMODE_PERIODIC;
|
||||
metadata.flightTelemetryUpdatePeriod = 1000;
|
||||
metadata.loggingUpdateMode = UAVObject::UPDATEMODE_NEVER;
|
||||
metadata.loggingUpdatePeriod = 0;
|
||||
return metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize object fields with the default values.
|
||||
* If a default value is not specified the object fields
|
||||
* will be initialized to zero.
|
||||
*/
|
||||
void ActuatorCommand::setDefaultFieldValues()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the object data fields
|
||||
*/
|
||||
ActuatorCommand::DataFields ActuatorCommand::getData()
|
||||
{
|
||||
QMutexLocker locker(mutex);
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the object data fields
|
||||
*/
|
||||
void ActuatorCommand::setData(const DataFields& data)
|
||||
{
|
||||
QMutexLocker locker(mutex);
|
||||
this->data = data;
|
||||
emit objectUpdatedAuto(this); // trigger object updated event
|
||||
emit objectUpdated(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a clone of this object, a new instance ID must be specified.
|
||||
* Do not use this function directly to create new instances, the
|
||||
* UAVObjectManager should be used instead.
|
||||
*/
|
||||
UAVDataObject* ActuatorCommand::clone(quint32 instID)
|
||||
{
|
||||
ActuatorCommand* obj = new ActuatorCommand();
|
||||
obj->initialize(instID, this->getMetaObject());
|
||||
return obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
ActuatorCommand* ActuatorCommand::GetInstance(UAVObjectManager* objMngr, quint32 instID)
|
||||
{
|
||||
return dynamic_cast<ActuatorCommand*>(objMngr->getObject(ActuatorCommand::OBJID, instID));
|
||||
}
|
78
ground/src/plugins/uavobjects/actuatorcommand.h
Normal file
78
ground/src/plugins/uavobjects/actuatorcommand.h
Normal file
@ -0,0 +1,78 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file actuatorcommand.h
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Implementation of the ActuatorCommand object. This file has been
|
||||
* automatically generated by the UAVObjectGenerator.
|
||||
*
|
||||
* @note Object definition file: actuatorcommand.xml.
|
||||
* This is an automatically generated file.
|
||||
* DO NOT modify manually.
|
||||
*
|
||||
* @see The GNU Public License (GPL) Version 3
|
||||
*
|
||||
*****************************************************************************/
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#ifndef ACTUATORCOMMAND_H
|
||||
#define ACTUATORCOMMAND_H
|
||||
|
||||
#include "uavdataobject.h"
|
||||
#include "uavobjectmanager.h"
|
||||
|
||||
class UAVOBJECTS_EXPORT ActuatorCommand: public UAVDataObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
// Field structure
|
||||
typedef struct {
|
||||
qint16 Channel[8];
|
||||
|
||||
} __attribute__((packed)) DataFields;
|
||||
|
||||
// Field information
|
||||
// Field Channel information
|
||||
/* Number of elements for field Channel */
|
||||
static const quint32 CHANNEL_NUMELEM = 8;
|
||||
|
||||
|
||||
// Constants
|
||||
static const quint32 OBJID = 3909877022U;
|
||||
static const QString NAME;
|
||||
static const bool ISSINGLEINST = 1;
|
||||
static const bool ISSETTINGS = 0;
|
||||
static const quint32 NUMBYTES = sizeof(DataFields);
|
||||
|
||||
// Functions
|
||||
ActuatorCommand();
|
||||
|
||||
DataFields getData();
|
||||
void setData(const DataFields& data);
|
||||
Metadata getDefaultMetadata();
|
||||
UAVDataObject* clone(quint32 instID);
|
||||
|
||||
static ActuatorCommand* GetInstance(UAVObjectManager* objMngr, quint32 instID = 0);
|
||||
|
||||
private:
|
||||
DataFields data;
|
||||
|
||||
void setDefaultFieldValues();
|
||||
|
||||
};
|
||||
|
||||
#endif // ACTUATORCOMMAND_H
|
93
ground/src/plugins/uavobjects/actuatorcommand.py
Normal file
93
ground/src/plugins/uavobjects/actuatorcommand.py
Normal file
@ -0,0 +1,93 @@
|
||||
##
|
||||
##############################################################################
|
||||
#
|
||||
# @file actuatorcommand.py
|
||||
# @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
# @brief Implementation of the ActuatorCommand object. This file has been
|
||||
# automatically generated by the UAVObjectGenerator.
|
||||
#
|
||||
# @note Object definition file: actuatorcommand.xml.
|
||||
# This is an automatically generated file.
|
||||
# DO NOT modify manually.
|
||||
#
|
||||
# @see The GNU Public License (GPL) Version 3
|
||||
#
|
||||
#############################################################################/
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
|
||||
import uavobject
|
||||
|
||||
import struct
|
||||
from collections import namedtuple
|
||||
|
||||
# This is a list of instances of the data fields contained in this object
|
||||
_fields = [ \
|
||||
uavobject.UAVObjectField(
|
||||
'Channel',
|
||||
'h',
|
||||
8,
|
||||
[
|
||||
'0',
|
||||
'1',
|
||||
'2',
|
||||
'3',
|
||||
'4',
|
||||
'5',
|
||||
'6',
|
||||
'7',
|
||||
],
|
||||
{
|
||||
}
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
class ActuatorCommand(uavobject.UAVObject):
|
||||
## Object constants
|
||||
OBJID = 3909877022
|
||||
NAME = "ActuatorCommand"
|
||||
METANAME = "ActuatorCommandMeta"
|
||||
ISSINGLEINST = 1
|
||||
ISSETTINGS = 0
|
||||
|
||||
def __init__(self):
|
||||
uavobject.UAVObject.__init__(self,
|
||||
self.OBJID,
|
||||
self.NAME,
|
||||
self.METANAME,
|
||||
0,
|
||||
self.ISSINGLEINST)
|
||||
|
||||
for f in _fields:
|
||||
self.add_field(f)
|
||||
|
||||
def __str__(self):
|
||||
s = ("0x%08X (%10u) %-30s %3u bytes format '%s'\n"
|
||||
% (self.OBJID, self.OBJID, self.NAME, self.get_struct().size, self.get_struct().format))
|
||||
for f in self.get_tuple()._fields:
|
||||
s += ("\t%s\n" % f)
|
||||
return (s)
|
||||
|
||||
def main():
|
||||
# Instantiate the object and dump out some interesting info
|
||||
x = ActuatorCommand()
|
||||
print (x)
|
||||
|
||||
if __name__ == "__main__":
|
||||
#import pdb ; pdb.run('main()')
|
||||
main()
|
127
ground/src/plugins/uavobjects/actuatordesired.cpp
Normal file
127
ground/src/plugins/uavobjects/actuatordesired.cpp
Normal file
@ -0,0 +1,127 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file actuatordesired.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Implementation of the ActuatorDesired object. This file has been
|
||||
* automatically generated by the UAVObjectGenerator.
|
||||
*
|
||||
* @note Object definition file: actuatordesired.xml.
|
||||
* This is an automatically generated file.
|
||||
* DO NOT modify manually.
|
||||
*
|
||||
* @see The GNU Public License (GPL) Version 3
|
||||
*
|
||||
*****************************************************************************/
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include "actuatordesired.h"
|
||||
#include "uavobjectfield.h"
|
||||
|
||||
const QString ActuatorDesired::NAME = QString("ActuatorDesired");
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
ActuatorDesired::ActuatorDesired(): UAVDataObject(OBJID, ISSINGLEINST, ISSETTINGS, NAME)
|
||||
{
|
||||
// Create fields
|
||||
QList<UAVObjectField*> fields;
|
||||
QStringList RollElemNames;
|
||||
RollElemNames.append("0");
|
||||
fields.append( new UAVObjectField(QString("Roll"), QString("%"), UAVObjectField::FLOAT32, RollElemNames, QStringList()) );
|
||||
QStringList PitchElemNames;
|
||||
PitchElemNames.append("0");
|
||||
fields.append( new UAVObjectField(QString("Pitch"), QString("%"), UAVObjectField::FLOAT32, PitchElemNames, QStringList()) );
|
||||
QStringList YawElemNames;
|
||||
YawElemNames.append("0");
|
||||
fields.append( new UAVObjectField(QString("Yaw"), QString("%"), UAVObjectField::FLOAT32, YawElemNames, QStringList()) );
|
||||
QStringList ThrottleElemNames;
|
||||
ThrottleElemNames.append("0");
|
||||
fields.append( new UAVObjectField(QString("Throttle"), QString("%"), UAVObjectField::FLOAT32, ThrottleElemNames, QStringList()) );
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, (quint8*)&data, NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the default metadata for this object
|
||||
*/
|
||||
UAVObject::Metadata ActuatorDesired::getDefaultMetadata()
|
||||
{
|
||||
UAVObject::Metadata metadata;
|
||||
metadata.gcsTelemetryAcked = 1;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject::UPDATEMODE_MANUAL;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
metadata.flightTelemetryAcked = 1;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject::UPDATEMODE_PERIODIC;
|
||||
metadata.flightTelemetryUpdatePeriod = 1000;
|
||||
metadata.loggingUpdateMode = UAVObject::UPDATEMODE_NEVER;
|
||||
metadata.loggingUpdatePeriod = 0;
|
||||
return metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize object fields with the default values.
|
||||
* If a default value is not specified the object fields
|
||||
* will be initialized to zero.
|
||||
*/
|
||||
void ActuatorDesired::setDefaultFieldValues()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the object data fields
|
||||
*/
|
||||
ActuatorDesired::DataFields ActuatorDesired::getData()
|
||||
{
|
||||
QMutexLocker locker(mutex);
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the object data fields
|
||||
*/
|
||||
void ActuatorDesired::setData(const DataFields& data)
|
||||
{
|
||||
QMutexLocker locker(mutex);
|
||||
this->data = data;
|
||||
emit objectUpdatedAuto(this); // trigger object updated event
|
||||
emit objectUpdated(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a clone of this object, a new instance ID must be specified.
|
||||
* Do not use this function directly to create new instances, the
|
||||
* UAVObjectManager should be used instead.
|
||||
*/
|
||||
UAVDataObject* ActuatorDesired::clone(quint32 instID)
|
||||
{
|
||||
ActuatorDesired* obj = new ActuatorDesired();
|
||||
obj->initialize(instID, this->getMetaObject());
|
||||
return obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
ActuatorDesired* ActuatorDesired::GetInstance(UAVObjectManager* objMngr, quint32 instID)
|
||||
{
|
||||
return dynamic_cast<ActuatorDesired*>(objMngr->getObject(ActuatorDesired::OBJID, instID));
|
||||
}
|
82
ground/src/plugins/uavobjects/actuatordesired.h
Normal file
82
ground/src/plugins/uavobjects/actuatordesired.h
Normal file
@ -0,0 +1,82 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file actuatordesired.h
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Implementation of the ActuatorDesired object. This file has been
|
||||
* automatically generated by the UAVObjectGenerator.
|
||||
*
|
||||
* @note Object definition file: actuatordesired.xml.
|
||||
* This is an automatically generated file.
|
||||
* DO NOT modify manually.
|
||||
*
|
||||
* @see The GNU Public License (GPL) Version 3
|
||||
*
|
||||
*****************************************************************************/
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#ifndef ACTUATORDESIRED_H
|
||||
#define ACTUATORDESIRED_H
|
||||
|
||||
#include "uavdataobject.h"
|
||||
#include "uavobjectmanager.h"
|
||||
|
||||
class UAVOBJECTS_EXPORT ActuatorDesired: public UAVDataObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
// Field structure
|
||||
typedef struct {
|
||||
float Roll;
|
||||
float Pitch;
|
||||
float Yaw;
|
||||
float Throttle;
|
||||
|
||||
} __attribute__((packed)) DataFields;
|
||||
|
||||
// Field information
|
||||
// Field Roll information
|
||||
// Field Pitch information
|
||||
// Field Yaw information
|
||||
// Field Throttle information
|
||||
|
||||
|
||||
// Constants
|
||||
static const quint32 OBJID = 123085850U;
|
||||
static const QString NAME;
|
||||
static const bool ISSINGLEINST = 1;
|
||||
static const bool ISSETTINGS = 0;
|
||||
static const quint32 NUMBYTES = sizeof(DataFields);
|
||||
|
||||
// Functions
|
||||
ActuatorDesired();
|
||||
|
||||
DataFields getData();
|
||||
void setData(const DataFields& data);
|
||||
Metadata getDefaultMetadata();
|
||||
UAVDataObject* clone(quint32 instID);
|
||||
|
||||
static ActuatorDesired* GetInstance(UAVObjectManager* objMngr, quint32 instID = 0);
|
||||
|
||||
private:
|
||||
DataFields data;
|
||||
|
||||
void setDefaultFieldValues();
|
||||
|
||||
};
|
||||
|
||||
#endif // ACTUATORDESIRED_H
|
116
ground/src/plugins/uavobjects/actuatordesired.py
Normal file
116
ground/src/plugins/uavobjects/actuatordesired.py
Normal file
@ -0,0 +1,116 @@
|
||||
##
|
||||
##############################################################################
|
||||
#
|
||||
# @file actuatordesired.py
|
||||
# @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
# @brief Implementation of the ActuatorDesired object. This file has been
|
||||
# automatically generated by the UAVObjectGenerator.
|
||||
#
|
||||
# @note Object definition file: actuatordesired.xml.
|
||||
# This is an automatically generated file.
|
||||
# DO NOT modify manually.
|
||||
#
|
||||
# @see The GNU Public License (GPL) Version 3
|
||||
#
|
||||
#############################################################################/
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
|
||||
import uavobject
|
||||
|
||||
import struct
|
||||
from collections import namedtuple
|
||||
|
||||
# This is a list of instances of the data fields contained in this object
|
||||
_fields = [ \
|
||||
uavobject.UAVObjectField(
|
||||
'Roll',
|
||||
'f',
|
||||
1,
|
||||
[
|
||||
'0',
|
||||
],
|
||||
{
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'Pitch',
|
||||
'f',
|
||||
1,
|
||||
[
|
||||
'0',
|
||||
],
|
||||
{
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'Yaw',
|
||||
'f',
|
||||
1,
|
||||
[
|
||||
'0',
|
||||
],
|
||||
{
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'Throttle',
|
||||
'f',
|
||||
1,
|
||||
[
|
||||
'0',
|
||||
],
|
||||
{
|
||||
}
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
class ActuatorDesired(uavobject.UAVObject):
|
||||
## Object constants
|
||||
OBJID = 123085850
|
||||
NAME = "ActuatorDesired"
|
||||
METANAME = "ActuatorDesiredMeta"
|
||||
ISSINGLEINST = 1
|
||||
ISSETTINGS = 0
|
||||
|
||||
def __init__(self):
|
||||
uavobject.UAVObject.__init__(self,
|
||||
self.OBJID,
|
||||
self.NAME,
|
||||
self.METANAME,
|
||||
0,
|
||||
self.ISSINGLEINST)
|
||||
|
||||
for f in _fields:
|
||||
self.add_field(f)
|
||||
|
||||
def __str__(self):
|
||||
s = ("0x%08X (%10u) %-30s %3u bytes format '%s'\n"
|
||||
% (self.OBJID, self.OBJID, self.NAME, self.get_struct().size, self.get_struct().format))
|
||||
for f in self.get_tuple()._fields:
|
||||
s += ("\t%s\n" % f)
|
||||
return (s)
|
||||
|
||||
def main():
|
||||
# Instantiate the object and dump out some interesting info
|
||||
x = ActuatorDesired()
|
||||
print (x)
|
||||
|
||||
if __name__ == "__main__":
|
||||
#import pdb ; pdb.run('main()')
|
||||
main()
|
371
ground/src/plugins/uavobjects/actuatorsettings.cpp
Normal file
371
ground/src/plugins/uavobjects/actuatorsettings.cpp
Normal file
@ -0,0 +1,371 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file actuatorsettings.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Implementation of the ActuatorSettings object. This file has been
|
||||
* automatically generated by the UAVObjectGenerator.
|
||||
*
|
||||
* @note Object definition file: actuatorsettings.xml.
|
||||
* This is an automatically generated file.
|
||||
* DO NOT modify manually.
|
||||
*
|
||||
* @see The GNU Public License (GPL) Version 3
|
||||
*
|
||||
*****************************************************************************/
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include "actuatorsettings.h"
|
||||
#include "uavobjectfield.h"
|
||||
|
||||
const QString ActuatorSettings::NAME = QString("ActuatorSettings");
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
ActuatorSettings::ActuatorSettings(): UAVDataObject(OBJID, ISSINGLEINST, ISSETTINGS, NAME)
|
||||
{
|
||||
// Create fields
|
||||
QList<UAVObjectField*> fields;
|
||||
QStringList FixedWingRoll1ElemNames;
|
||||
FixedWingRoll1ElemNames.append("0");
|
||||
QStringList FixedWingRoll1EnumOptions;
|
||||
FixedWingRoll1EnumOptions.append("Channel1");
|
||||
FixedWingRoll1EnumOptions.append("Channel2");
|
||||
FixedWingRoll1EnumOptions.append("Channel3");
|
||||
FixedWingRoll1EnumOptions.append("Channel4");
|
||||
FixedWingRoll1EnumOptions.append("Channel5");
|
||||
FixedWingRoll1EnumOptions.append("Channel6");
|
||||
FixedWingRoll1EnumOptions.append("Channel7");
|
||||
FixedWingRoll1EnumOptions.append("Channel8");
|
||||
FixedWingRoll1EnumOptions.append("None");
|
||||
fields.append( new UAVObjectField(QString("FixedWingRoll1"), QString("channel"), UAVObjectField::ENUM, FixedWingRoll1ElemNames, FixedWingRoll1EnumOptions) );
|
||||
QStringList FixedWingRoll2ElemNames;
|
||||
FixedWingRoll2ElemNames.append("0");
|
||||
QStringList FixedWingRoll2EnumOptions;
|
||||
FixedWingRoll2EnumOptions.append("Channel1");
|
||||
FixedWingRoll2EnumOptions.append("Channel2");
|
||||
FixedWingRoll2EnumOptions.append("Channel3");
|
||||
FixedWingRoll2EnumOptions.append("Channel4");
|
||||
FixedWingRoll2EnumOptions.append("Channel5");
|
||||
FixedWingRoll2EnumOptions.append("Channel6");
|
||||
FixedWingRoll2EnumOptions.append("Channel7");
|
||||
FixedWingRoll2EnumOptions.append("Channel8");
|
||||
FixedWingRoll2EnumOptions.append("None");
|
||||
fields.append( new UAVObjectField(QString("FixedWingRoll2"), QString("channel"), UAVObjectField::ENUM, FixedWingRoll2ElemNames, FixedWingRoll2EnumOptions) );
|
||||
QStringList FixedWingPitch1ElemNames;
|
||||
FixedWingPitch1ElemNames.append("0");
|
||||
QStringList FixedWingPitch1EnumOptions;
|
||||
FixedWingPitch1EnumOptions.append("Channel1");
|
||||
FixedWingPitch1EnumOptions.append("Channel2");
|
||||
FixedWingPitch1EnumOptions.append("Channel3");
|
||||
FixedWingPitch1EnumOptions.append("Channel4");
|
||||
FixedWingPitch1EnumOptions.append("Channel5");
|
||||
FixedWingPitch1EnumOptions.append("Channel6");
|
||||
FixedWingPitch1EnumOptions.append("Channel7");
|
||||
FixedWingPitch1EnumOptions.append("Channel8");
|
||||
FixedWingPitch1EnumOptions.append("None");
|
||||
fields.append( new UAVObjectField(QString("FixedWingPitch1"), QString("channel"), UAVObjectField::ENUM, FixedWingPitch1ElemNames, FixedWingPitch1EnumOptions) );
|
||||
QStringList FixedWingPitch2ElemNames;
|
||||
FixedWingPitch2ElemNames.append("0");
|
||||
QStringList FixedWingPitch2EnumOptions;
|
||||
FixedWingPitch2EnumOptions.append("Channel1");
|
||||
FixedWingPitch2EnumOptions.append("Channel2");
|
||||
FixedWingPitch2EnumOptions.append("Channel3");
|
||||
FixedWingPitch2EnumOptions.append("Channel4");
|
||||
FixedWingPitch2EnumOptions.append("Channel5");
|
||||
FixedWingPitch2EnumOptions.append("Channel6");
|
||||
FixedWingPitch2EnumOptions.append("Channel7");
|
||||
FixedWingPitch2EnumOptions.append("Channel8");
|
||||
FixedWingPitch2EnumOptions.append("None");
|
||||
fields.append( new UAVObjectField(QString("FixedWingPitch2"), QString("channel"), UAVObjectField::ENUM, FixedWingPitch2ElemNames, FixedWingPitch2EnumOptions) );
|
||||
QStringList FixedWingYawElemNames;
|
||||
FixedWingYawElemNames.append("0");
|
||||
QStringList FixedWingYawEnumOptions;
|
||||
FixedWingYawEnumOptions.append("Channel1");
|
||||
FixedWingYawEnumOptions.append("Channel2");
|
||||
FixedWingYawEnumOptions.append("Channel3");
|
||||
FixedWingYawEnumOptions.append("Channel4");
|
||||
FixedWingYawEnumOptions.append("Channel5");
|
||||
FixedWingYawEnumOptions.append("Channel6");
|
||||
FixedWingYawEnumOptions.append("Channel7");
|
||||
FixedWingYawEnumOptions.append("Channel8");
|
||||
FixedWingYawEnumOptions.append("None");
|
||||
fields.append( new UAVObjectField(QString("FixedWingYaw"), QString("channel"), UAVObjectField::ENUM, FixedWingYawElemNames, FixedWingYawEnumOptions) );
|
||||
QStringList FixedWingThrottleElemNames;
|
||||
FixedWingThrottleElemNames.append("0");
|
||||
QStringList FixedWingThrottleEnumOptions;
|
||||
FixedWingThrottleEnumOptions.append("Channel1");
|
||||
FixedWingThrottleEnumOptions.append("Channel2");
|
||||
FixedWingThrottleEnumOptions.append("Channel3");
|
||||
FixedWingThrottleEnumOptions.append("Channel4");
|
||||
FixedWingThrottleEnumOptions.append("Channel5");
|
||||
FixedWingThrottleEnumOptions.append("Channel6");
|
||||
FixedWingThrottleEnumOptions.append("Channel7");
|
||||
FixedWingThrottleEnumOptions.append("Channel8");
|
||||
FixedWingThrottleEnumOptions.append("None");
|
||||
fields.append( new UAVObjectField(QString("FixedWingThrottle"), QString("channel"), UAVObjectField::ENUM, FixedWingThrottleElemNames, FixedWingThrottleEnumOptions) );
|
||||
QStringList VTOLMotorNElemNames;
|
||||
VTOLMotorNElemNames.append("0");
|
||||
QStringList VTOLMotorNEnumOptions;
|
||||
VTOLMotorNEnumOptions.append("Channel1");
|
||||
VTOLMotorNEnumOptions.append("Channel2");
|
||||
VTOLMotorNEnumOptions.append("Channel3");
|
||||
VTOLMotorNEnumOptions.append("Channel4");
|
||||
VTOLMotorNEnumOptions.append("Channel5");
|
||||
VTOLMotorNEnumOptions.append("Channel6");
|
||||
VTOLMotorNEnumOptions.append("Channel7");
|
||||
VTOLMotorNEnumOptions.append("Channel8");
|
||||
VTOLMotorNEnumOptions.append("None");
|
||||
fields.append( new UAVObjectField(QString("VTOLMotorN"), QString("channel"), UAVObjectField::ENUM, VTOLMotorNElemNames, VTOLMotorNEnumOptions) );
|
||||
QStringList VTOLMotorNEElemNames;
|
||||
VTOLMotorNEElemNames.append("0");
|
||||
QStringList VTOLMotorNEEnumOptions;
|
||||
VTOLMotorNEEnumOptions.append("Channel1");
|
||||
VTOLMotorNEEnumOptions.append("Channel2");
|
||||
VTOLMotorNEEnumOptions.append("Channel3");
|
||||
VTOLMotorNEEnumOptions.append("Channel4");
|
||||
VTOLMotorNEEnumOptions.append("Channel5");
|
||||
VTOLMotorNEEnumOptions.append("Channel6");
|
||||
VTOLMotorNEEnumOptions.append("Channel7");
|
||||
VTOLMotorNEEnumOptions.append("Channel8");
|
||||
VTOLMotorNEEnumOptions.append("None");
|
||||
fields.append( new UAVObjectField(QString("VTOLMotorNE"), QString("channel"), UAVObjectField::ENUM, VTOLMotorNEElemNames, VTOLMotorNEEnumOptions) );
|
||||
QStringList VTOLMotorEElemNames;
|
||||
VTOLMotorEElemNames.append("0");
|
||||
QStringList VTOLMotorEEnumOptions;
|
||||
VTOLMotorEEnumOptions.append("Channel1");
|
||||
VTOLMotorEEnumOptions.append("Channel2");
|
||||
VTOLMotorEEnumOptions.append("Channel3");
|
||||
VTOLMotorEEnumOptions.append("Channel4");
|
||||
VTOLMotorEEnumOptions.append("Channel5");
|
||||
VTOLMotorEEnumOptions.append("Channel6");
|
||||
VTOLMotorEEnumOptions.append("Channel7");
|
||||
VTOLMotorEEnumOptions.append("Channel8");
|
||||
VTOLMotorEEnumOptions.append("None");
|
||||
fields.append( new UAVObjectField(QString("VTOLMotorE"), QString("channel"), UAVObjectField::ENUM, VTOLMotorEElemNames, VTOLMotorEEnumOptions) );
|
||||
QStringList VTOLMotorSEElemNames;
|
||||
VTOLMotorSEElemNames.append("0");
|
||||
QStringList VTOLMotorSEEnumOptions;
|
||||
VTOLMotorSEEnumOptions.append("Channel1");
|
||||
VTOLMotorSEEnumOptions.append("Channel2");
|
||||
VTOLMotorSEEnumOptions.append("Channel3");
|
||||
VTOLMotorSEEnumOptions.append("Channel4");
|
||||
VTOLMotorSEEnumOptions.append("Channel5");
|
||||
VTOLMotorSEEnumOptions.append("Channel6");
|
||||
VTOLMotorSEEnumOptions.append("Channel7");
|
||||
VTOLMotorSEEnumOptions.append("Channel8");
|
||||
VTOLMotorSEEnumOptions.append("None");
|
||||
fields.append( new UAVObjectField(QString("VTOLMotorSE"), QString("channel"), UAVObjectField::ENUM, VTOLMotorSEElemNames, VTOLMotorSEEnumOptions) );
|
||||
QStringList VTOLMotorSElemNames;
|
||||
VTOLMotorSElemNames.append("0");
|
||||
QStringList VTOLMotorSEnumOptions;
|
||||
VTOLMotorSEnumOptions.append("Channel1");
|
||||
VTOLMotorSEnumOptions.append("Channel2");
|
||||
VTOLMotorSEnumOptions.append("Channel3");
|
||||
VTOLMotorSEnumOptions.append("Channel4");
|
||||
VTOLMotorSEnumOptions.append("Channel5");
|
||||
VTOLMotorSEnumOptions.append("Channel6");
|
||||
VTOLMotorSEnumOptions.append("Channel7");
|
||||
VTOLMotorSEnumOptions.append("Channel8");
|
||||
VTOLMotorSEnumOptions.append("None");
|
||||
fields.append( new UAVObjectField(QString("VTOLMotorS"), QString("channel"), UAVObjectField::ENUM, VTOLMotorSElemNames, VTOLMotorSEnumOptions) );
|
||||
QStringList VTOLMotorSWElemNames;
|
||||
VTOLMotorSWElemNames.append("0");
|
||||
QStringList VTOLMotorSWEnumOptions;
|
||||
VTOLMotorSWEnumOptions.append("Channel1");
|
||||
VTOLMotorSWEnumOptions.append("Channel2");
|
||||
VTOLMotorSWEnumOptions.append("Channel3");
|
||||
VTOLMotorSWEnumOptions.append("Channel4");
|
||||
VTOLMotorSWEnumOptions.append("Channel5");
|
||||
VTOLMotorSWEnumOptions.append("Channel6");
|
||||
VTOLMotorSWEnumOptions.append("Channel7");
|
||||
VTOLMotorSWEnumOptions.append("Channel8");
|
||||
VTOLMotorSWEnumOptions.append("None");
|
||||
fields.append( new UAVObjectField(QString("VTOLMotorSW"), QString("channel"), UAVObjectField::ENUM, VTOLMotorSWElemNames, VTOLMotorSWEnumOptions) );
|
||||
QStringList VTOLMotorWElemNames;
|
||||
VTOLMotorWElemNames.append("0");
|
||||
QStringList VTOLMotorWEnumOptions;
|
||||
VTOLMotorWEnumOptions.append("Channel1");
|
||||
VTOLMotorWEnumOptions.append("Channel2");
|
||||
VTOLMotorWEnumOptions.append("Channel3");
|
||||
VTOLMotorWEnumOptions.append("Channel4");
|
||||
VTOLMotorWEnumOptions.append("Channel5");
|
||||
VTOLMotorWEnumOptions.append("Channel6");
|
||||
VTOLMotorWEnumOptions.append("Channel7");
|
||||
VTOLMotorWEnumOptions.append("Channel8");
|
||||
VTOLMotorWEnumOptions.append("None");
|
||||
fields.append( new UAVObjectField(QString("VTOLMotorW"), QString("channel"), UAVObjectField::ENUM, VTOLMotorWElemNames, VTOLMotorWEnumOptions) );
|
||||
QStringList VTOLMotorNWElemNames;
|
||||
VTOLMotorNWElemNames.append("0");
|
||||
QStringList VTOLMotorNWEnumOptions;
|
||||
VTOLMotorNWEnumOptions.append("Channel1");
|
||||
VTOLMotorNWEnumOptions.append("Channel2");
|
||||
VTOLMotorNWEnumOptions.append("Channel3");
|
||||
VTOLMotorNWEnumOptions.append("Channel4");
|
||||
VTOLMotorNWEnumOptions.append("Channel5");
|
||||
VTOLMotorNWEnumOptions.append("Channel6");
|
||||
VTOLMotorNWEnumOptions.append("Channel7");
|
||||
VTOLMotorNWEnumOptions.append("Channel8");
|
||||
VTOLMotorNWEnumOptions.append("None");
|
||||
fields.append( new UAVObjectField(QString("VTOLMotorNW"), QString("channel"), UAVObjectField::ENUM, VTOLMotorNWElemNames, VTOLMotorNWEnumOptions) );
|
||||
QStringList ChannelUpdateFreqElemNames;
|
||||
ChannelUpdateFreqElemNames.append("0");
|
||||
ChannelUpdateFreqElemNames.append("1");
|
||||
fields.append( new UAVObjectField(QString("ChannelUpdateFreq"), QString("Hz"), UAVObjectField::INT16, ChannelUpdateFreqElemNames, QStringList()) );
|
||||
QStringList ChannelMaxElemNames;
|
||||
ChannelMaxElemNames.append("0");
|
||||
ChannelMaxElemNames.append("1");
|
||||
ChannelMaxElemNames.append("2");
|
||||
ChannelMaxElemNames.append("3");
|
||||
ChannelMaxElemNames.append("4");
|
||||
ChannelMaxElemNames.append("5");
|
||||
ChannelMaxElemNames.append("6");
|
||||
ChannelMaxElemNames.append("7");
|
||||
fields.append( new UAVObjectField(QString("ChannelMax"), QString("us"), UAVObjectField::INT16, ChannelMaxElemNames, QStringList()) );
|
||||
QStringList ChannelNeutralElemNames;
|
||||
ChannelNeutralElemNames.append("0");
|
||||
ChannelNeutralElemNames.append("1");
|
||||
ChannelNeutralElemNames.append("2");
|
||||
ChannelNeutralElemNames.append("3");
|
||||
ChannelNeutralElemNames.append("4");
|
||||
ChannelNeutralElemNames.append("5");
|
||||
ChannelNeutralElemNames.append("6");
|
||||
ChannelNeutralElemNames.append("7");
|
||||
fields.append( new UAVObjectField(QString("ChannelNeutral"), QString("us"), UAVObjectField::INT16, ChannelNeutralElemNames, QStringList()) );
|
||||
QStringList ChannelMinElemNames;
|
||||
ChannelMinElemNames.append("0");
|
||||
ChannelMinElemNames.append("1");
|
||||
ChannelMinElemNames.append("2");
|
||||
ChannelMinElemNames.append("3");
|
||||
ChannelMinElemNames.append("4");
|
||||
ChannelMinElemNames.append("5");
|
||||
ChannelMinElemNames.append("6");
|
||||
ChannelMinElemNames.append("7");
|
||||
fields.append( new UAVObjectField(QString("ChannelMin"), QString("us"), UAVObjectField::INT16, ChannelMinElemNames, QStringList()) );
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, (quint8*)&data, NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the default metadata for this object
|
||||
*/
|
||||
UAVObject::Metadata ActuatorSettings::getDefaultMetadata()
|
||||
{
|
||||
UAVObject::Metadata metadata;
|
||||
metadata.gcsTelemetryAcked = 1;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject::UPDATEMODE_ONCHANGE;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
metadata.flightTelemetryAcked = 1;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject::UPDATEMODE_ONCHANGE;
|
||||
metadata.flightTelemetryUpdatePeriod = 0;
|
||||
metadata.loggingUpdateMode = UAVObject::UPDATEMODE_NEVER;
|
||||
metadata.loggingUpdatePeriod = 0;
|
||||
return metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize object fields with the default values.
|
||||
* If a default value is not specified the object fields
|
||||
* will be initialized to zero.
|
||||
*/
|
||||
void ActuatorSettings::setDefaultFieldValues()
|
||||
{
|
||||
data.FixedWingRoll1 = 8;
|
||||
data.FixedWingRoll2 = 8;
|
||||
data.FixedWingPitch1 = 8;
|
||||
data.FixedWingPitch2 = 8;
|
||||
data.FixedWingYaw = 8;
|
||||
data.FixedWingThrottle = 8;
|
||||
data.VTOLMotorN = 8;
|
||||
data.VTOLMotorNE = 8;
|
||||
data.VTOLMotorE = 8;
|
||||
data.VTOLMotorSE = 8;
|
||||
data.VTOLMotorS = 8;
|
||||
data.VTOLMotorSW = 8;
|
||||
data.VTOLMotorW = 8;
|
||||
data.VTOLMotorNW = 8;
|
||||
data.ChannelUpdateFreq[0] = 50;
|
||||
data.ChannelUpdateFreq[1] = 50;
|
||||
data.ChannelMax[0] = 2000;
|
||||
data.ChannelMax[1] = 2000;
|
||||
data.ChannelMax[2] = 2000;
|
||||
data.ChannelMax[3] = 2000;
|
||||
data.ChannelMax[4] = 2000;
|
||||
data.ChannelMax[5] = 2000;
|
||||
data.ChannelMax[6] = 2000;
|
||||
data.ChannelMax[7] = 2000;
|
||||
data.ChannelNeutral[0] = 1500;
|
||||
data.ChannelNeutral[1] = 1500;
|
||||
data.ChannelNeutral[2] = 1500;
|
||||
data.ChannelNeutral[3] = 1500;
|
||||
data.ChannelNeutral[4] = 1500;
|
||||
data.ChannelNeutral[5] = 1500;
|
||||
data.ChannelNeutral[6] = 1500;
|
||||
data.ChannelNeutral[7] = 1500;
|
||||
data.ChannelMin[0] = 1000;
|
||||
data.ChannelMin[1] = 1000;
|
||||
data.ChannelMin[2] = 1000;
|
||||
data.ChannelMin[3] = 1000;
|
||||
data.ChannelMin[4] = 1000;
|
||||
data.ChannelMin[5] = 1000;
|
||||
data.ChannelMin[6] = 1000;
|
||||
data.ChannelMin[7] = 1000;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the object data fields
|
||||
*/
|
||||
ActuatorSettings::DataFields ActuatorSettings::getData()
|
||||
{
|
||||
QMutexLocker locker(mutex);
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the object data fields
|
||||
*/
|
||||
void ActuatorSettings::setData(const DataFields& data)
|
||||
{
|
||||
QMutexLocker locker(mutex);
|
||||
this->data = data;
|
||||
emit objectUpdatedAuto(this); // trigger object updated event
|
||||
emit objectUpdated(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a clone of this object, a new instance ID must be specified.
|
||||
* Do not use this function directly to create new instances, the
|
||||
* UAVObjectManager should be used instead.
|
||||
*/
|
||||
UAVDataObject* ActuatorSettings::clone(quint32 instID)
|
||||
{
|
||||
ActuatorSettings* obj = new ActuatorSettings();
|
||||
obj->initialize(instID, this->getMetaObject());
|
||||
return obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
ActuatorSettings* ActuatorSettings::GetInstance(UAVObjectManager* objMngr, quint32 instID)
|
||||
{
|
||||
return dynamic_cast<ActuatorSettings*>(objMngr->getObject(ActuatorSettings::OBJID, instID));
|
||||
}
|
146
ground/src/plugins/uavobjects/actuatorsettings.h
Normal file
146
ground/src/plugins/uavobjects/actuatorsettings.h
Normal file
@ -0,0 +1,146 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file actuatorsettings.h
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Implementation of the ActuatorSettings object. This file has been
|
||||
* automatically generated by the UAVObjectGenerator.
|
||||
*
|
||||
* @note Object definition file: actuatorsettings.xml.
|
||||
* This is an automatically generated file.
|
||||
* DO NOT modify manually.
|
||||
*
|
||||
* @see The GNU Public License (GPL) Version 3
|
||||
*
|
||||
*****************************************************************************/
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#ifndef ACTUATORSETTINGS_H
|
||||
#define ACTUATORSETTINGS_H
|
||||
|
||||
#include "uavdataobject.h"
|
||||
#include "uavobjectmanager.h"
|
||||
|
||||
class UAVOBJECTS_EXPORT ActuatorSettings: public UAVDataObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
// Field structure
|
||||
typedef struct {
|
||||
quint8 FixedWingRoll1;
|
||||
quint8 FixedWingRoll2;
|
||||
quint8 FixedWingPitch1;
|
||||
quint8 FixedWingPitch2;
|
||||
quint8 FixedWingYaw;
|
||||
quint8 FixedWingThrottle;
|
||||
quint8 VTOLMotorN;
|
||||
quint8 VTOLMotorNE;
|
||||
quint8 VTOLMotorE;
|
||||
quint8 VTOLMotorSE;
|
||||
quint8 VTOLMotorS;
|
||||
quint8 VTOLMotorSW;
|
||||
quint8 VTOLMotorW;
|
||||
quint8 VTOLMotorNW;
|
||||
qint16 ChannelUpdateFreq[2];
|
||||
qint16 ChannelMax[8];
|
||||
qint16 ChannelNeutral[8];
|
||||
qint16 ChannelMin[8];
|
||||
|
||||
} __attribute__((packed)) DataFields;
|
||||
|
||||
// Field information
|
||||
// Field FixedWingRoll1 information
|
||||
/* Enumeration options for field FixedWingRoll1 */
|
||||
typedef enum { FIXEDWINGROLL1_CHANNEL1=0, FIXEDWINGROLL1_CHANNEL2=1, FIXEDWINGROLL1_CHANNEL3=2, FIXEDWINGROLL1_CHANNEL4=3, FIXEDWINGROLL1_CHANNEL5=4, FIXEDWINGROLL1_CHANNEL6=5, FIXEDWINGROLL1_CHANNEL7=6, FIXEDWINGROLL1_CHANNEL8=7, FIXEDWINGROLL1_NONE=8, } FixedWingRoll1Options;
|
||||
// Field FixedWingRoll2 information
|
||||
/* Enumeration options for field FixedWingRoll2 */
|
||||
typedef enum { FIXEDWINGROLL2_CHANNEL1=0, FIXEDWINGROLL2_CHANNEL2=1, FIXEDWINGROLL2_CHANNEL3=2, FIXEDWINGROLL2_CHANNEL4=3, FIXEDWINGROLL2_CHANNEL5=4, FIXEDWINGROLL2_CHANNEL6=5, FIXEDWINGROLL2_CHANNEL7=6, FIXEDWINGROLL2_CHANNEL8=7, FIXEDWINGROLL2_NONE=8, } FixedWingRoll2Options;
|
||||
// Field FixedWingPitch1 information
|
||||
/* Enumeration options for field FixedWingPitch1 */
|
||||
typedef enum { FIXEDWINGPITCH1_CHANNEL1=0, FIXEDWINGPITCH1_CHANNEL2=1, FIXEDWINGPITCH1_CHANNEL3=2, FIXEDWINGPITCH1_CHANNEL4=3, FIXEDWINGPITCH1_CHANNEL5=4, FIXEDWINGPITCH1_CHANNEL6=5, FIXEDWINGPITCH1_CHANNEL7=6, FIXEDWINGPITCH1_CHANNEL8=7, FIXEDWINGPITCH1_NONE=8, } FixedWingPitch1Options;
|
||||
// Field FixedWingPitch2 information
|
||||
/* Enumeration options for field FixedWingPitch2 */
|
||||
typedef enum { FIXEDWINGPITCH2_CHANNEL1=0, FIXEDWINGPITCH2_CHANNEL2=1, FIXEDWINGPITCH2_CHANNEL3=2, FIXEDWINGPITCH2_CHANNEL4=3, FIXEDWINGPITCH2_CHANNEL5=4, FIXEDWINGPITCH2_CHANNEL6=5, FIXEDWINGPITCH2_CHANNEL7=6, FIXEDWINGPITCH2_CHANNEL8=7, FIXEDWINGPITCH2_NONE=8, } FixedWingPitch2Options;
|
||||
// Field FixedWingYaw information
|
||||
/* Enumeration options for field FixedWingYaw */
|
||||
typedef enum { FIXEDWINGYAW_CHANNEL1=0, FIXEDWINGYAW_CHANNEL2=1, FIXEDWINGYAW_CHANNEL3=2, FIXEDWINGYAW_CHANNEL4=3, FIXEDWINGYAW_CHANNEL5=4, FIXEDWINGYAW_CHANNEL6=5, FIXEDWINGYAW_CHANNEL7=6, FIXEDWINGYAW_CHANNEL8=7, FIXEDWINGYAW_NONE=8, } FixedWingYawOptions;
|
||||
// Field FixedWingThrottle information
|
||||
/* Enumeration options for field FixedWingThrottle */
|
||||
typedef enum { FIXEDWINGTHROTTLE_CHANNEL1=0, FIXEDWINGTHROTTLE_CHANNEL2=1, FIXEDWINGTHROTTLE_CHANNEL3=2, FIXEDWINGTHROTTLE_CHANNEL4=3, FIXEDWINGTHROTTLE_CHANNEL5=4, FIXEDWINGTHROTTLE_CHANNEL6=5, FIXEDWINGTHROTTLE_CHANNEL7=6, FIXEDWINGTHROTTLE_CHANNEL8=7, FIXEDWINGTHROTTLE_NONE=8, } FixedWingThrottleOptions;
|
||||
// Field VTOLMotorN information
|
||||
/* Enumeration options for field VTOLMotorN */
|
||||
typedef enum { VTOLMOTORN_CHANNEL1=0, VTOLMOTORN_CHANNEL2=1, VTOLMOTORN_CHANNEL3=2, VTOLMOTORN_CHANNEL4=3, VTOLMOTORN_CHANNEL5=4, VTOLMOTORN_CHANNEL6=5, VTOLMOTORN_CHANNEL7=6, VTOLMOTORN_CHANNEL8=7, VTOLMOTORN_NONE=8, } VTOLMotorNOptions;
|
||||
// Field VTOLMotorNE information
|
||||
/* Enumeration options for field VTOLMotorNE */
|
||||
typedef enum { VTOLMOTORNE_CHANNEL1=0, VTOLMOTORNE_CHANNEL2=1, VTOLMOTORNE_CHANNEL3=2, VTOLMOTORNE_CHANNEL4=3, VTOLMOTORNE_CHANNEL5=4, VTOLMOTORNE_CHANNEL6=5, VTOLMOTORNE_CHANNEL7=6, VTOLMOTORNE_CHANNEL8=7, VTOLMOTORNE_NONE=8, } VTOLMotorNEOptions;
|
||||
// Field VTOLMotorE information
|
||||
/* Enumeration options for field VTOLMotorE */
|
||||
typedef enum { VTOLMOTORE_CHANNEL1=0, VTOLMOTORE_CHANNEL2=1, VTOLMOTORE_CHANNEL3=2, VTOLMOTORE_CHANNEL4=3, VTOLMOTORE_CHANNEL5=4, VTOLMOTORE_CHANNEL6=5, VTOLMOTORE_CHANNEL7=6, VTOLMOTORE_CHANNEL8=7, VTOLMOTORE_NONE=8, } VTOLMotorEOptions;
|
||||
// Field VTOLMotorSE information
|
||||
/* Enumeration options for field VTOLMotorSE */
|
||||
typedef enum { VTOLMOTORSE_CHANNEL1=0, VTOLMOTORSE_CHANNEL2=1, VTOLMOTORSE_CHANNEL3=2, VTOLMOTORSE_CHANNEL4=3, VTOLMOTORSE_CHANNEL5=4, VTOLMOTORSE_CHANNEL6=5, VTOLMOTORSE_CHANNEL7=6, VTOLMOTORSE_CHANNEL8=7, VTOLMOTORSE_NONE=8, } VTOLMotorSEOptions;
|
||||
// Field VTOLMotorS information
|
||||
/* Enumeration options for field VTOLMotorS */
|
||||
typedef enum { VTOLMOTORS_CHANNEL1=0, VTOLMOTORS_CHANNEL2=1, VTOLMOTORS_CHANNEL3=2, VTOLMOTORS_CHANNEL4=3, VTOLMOTORS_CHANNEL5=4, VTOLMOTORS_CHANNEL6=5, VTOLMOTORS_CHANNEL7=6, VTOLMOTORS_CHANNEL8=7, VTOLMOTORS_NONE=8, } VTOLMotorSOptions;
|
||||
// Field VTOLMotorSW information
|
||||
/* Enumeration options for field VTOLMotorSW */
|
||||
typedef enum { VTOLMOTORSW_CHANNEL1=0, VTOLMOTORSW_CHANNEL2=1, VTOLMOTORSW_CHANNEL3=2, VTOLMOTORSW_CHANNEL4=3, VTOLMOTORSW_CHANNEL5=4, VTOLMOTORSW_CHANNEL6=5, VTOLMOTORSW_CHANNEL7=6, VTOLMOTORSW_CHANNEL8=7, VTOLMOTORSW_NONE=8, } VTOLMotorSWOptions;
|
||||
// Field VTOLMotorW information
|
||||
/* Enumeration options for field VTOLMotorW */
|
||||
typedef enum { VTOLMOTORW_CHANNEL1=0, VTOLMOTORW_CHANNEL2=1, VTOLMOTORW_CHANNEL3=2, VTOLMOTORW_CHANNEL4=3, VTOLMOTORW_CHANNEL5=4, VTOLMOTORW_CHANNEL6=5, VTOLMOTORW_CHANNEL7=6, VTOLMOTORW_CHANNEL8=7, VTOLMOTORW_NONE=8, } VTOLMotorWOptions;
|
||||
// Field VTOLMotorNW information
|
||||
/* Enumeration options for field VTOLMotorNW */
|
||||
typedef enum { VTOLMOTORNW_CHANNEL1=0, VTOLMOTORNW_CHANNEL2=1, VTOLMOTORNW_CHANNEL3=2, VTOLMOTORNW_CHANNEL4=3, VTOLMOTORNW_CHANNEL5=4, VTOLMOTORNW_CHANNEL6=5, VTOLMOTORNW_CHANNEL7=6, VTOLMOTORNW_CHANNEL8=7, VTOLMOTORNW_NONE=8, } VTOLMotorNWOptions;
|
||||
// Field ChannelUpdateFreq information
|
||||
/* Number of elements for field ChannelUpdateFreq */
|
||||
static const quint32 CHANNELUPDATEFREQ_NUMELEM = 2;
|
||||
// Field ChannelMax information
|
||||
/* Number of elements for field ChannelMax */
|
||||
static const quint32 CHANNELMAX_NUMELEM = 8;
|
||||
// Field ChannelNeutral information
|
||||
/* Number of elements for field ChannelNeutral */
|
||||
static const quint32 CHANNELNEUTRAL_NUMELEM = 8;
|
||||
// Field ChannelMin information
|
||||
/* Number of elements for field ChannelMin */
|
||||
static const quint32 CHANNELMIN_NUMELEM = 8;
|
||||
|
||||
|
||||
// Constants
|
||||
static const quint32 OBJID = 3054509114U;
|
||||
static const QString NAME;
|
||||
static const bool ISSINGLEINST = 1;
|
||||
static const bool ISSETTINGS = 1;
|
||||
static const quint32 NUMBYTES = sizeof(DataFields);
|
||||
|
||||
// Functions
|
||||
ActuatorSettings();
|
||||
|
||||
DataFields getData();
|
||||
void setData(const DataFields& data);
|
||||
Metadata getDefaultMetadata();
|
||||
UAVDataObject* clone(quint32 instID);
|
||||
|
||||
static ActuatorSettings* GetInstance(UAVObjectManager* objMngr, quint32 instID = 0);
|
||||
|
||||
private:
|
||||
DataFields data;
|
||||
|
||||
void setDefaultFieldValues();
|
||||
|
||||
};
|
||||
|
||||
#endif // ACTUATORSETTINGS_H
|
404
ground/src/plugins/uavobjects/actuatorsettings.py
Normal file
404
ground/src/plugins/uavobjects/actuatorsettings.py
Normal file
@ -0,0 +1,404 @@
|
||||
##
|
||||
##############################################################################
|
||||
#
|
||||
# @file actuatorsettings.py
|
||||
# @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
# @brief Implementation of the ActuatorSettings object. This file has been
|
||||
# automatically generated by the UAVObjectGenerator.
|
||||
#
|
||||
# @note Object definition file: actuatorsettings.xml.
|
||||
# This is an automatically generated file.
|
||||
# DO NOT modify manually.
|
||||
#
|
||||
# @see The GNU Public License (GPL) Version 3
|
||||
#
|
||||
#############################################################################/
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
|
||||
import uavobject
|
||||
|
||||
import struct
|
||||
from collections import namedtuple
|
||||
|
||||
# This is a list of instances of the data fields contained in this object
|
||||
_fields = [ \
|
||||
uavobject.UAVObjectField(
|
||||
'FixedWingRoll1',
|
||||
'b',
|
||||
1,
|
||||
[
|
||||
'0',
|
||||
],
|
||||
{
|
||||
'0' : 'Channel1',
|
||||
'1' : 'Channel2',
|
||||
'2' : 'Channel3',
|
||||
'3' : 'Channel4',
|
||||
'4' : 'Channel5',
|
||||
'5' : 'Channel6',
|
||||
'6' : 'Channel7',
|
||||
'7' : 'Channel8',
|
||||
'8' : 'None',
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'FixedWingRoll2',
|
||||
'b',
|
||||
1,
|
||||
[
|
||||
'0',
|
||||
],
|
||||
{
|
||||
'0' : 'Channel1',
|
||||
'1' : 'Channel2',
|
||||
'2' : 'Channel3',
|
||||
'3' : 'Channel4',
|
||||
'4' : 'Channel5',
|
||||
'5' : 'Channel6',
|
||||
'6' : 'Channel7',
|
||||
'7' : 'Channel8',
|
||||
'8' : 'None',
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'FixedWingPitch1',
|
||||
'b',
|
||||
1,
|
||||
[
|
||||
'0',
|
||||
],
|
||||
{
|
||||
'0' : 'Channel1',
|
||||
'1' : 'Channel2',
|
||||
'2' : 'Channel3',
|
||||
'3' : 'Channel4',
|
||||
'4' : 'Channel5',
|
||||
'5' : 'Channel6',
|
||||
'6' : 'Channel7',
|
||||
'7' : 'Channel8',
|
||||
'8' : 'None',
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'FixedWingPitch2',
|
||||
'b',
|
||||
1,
|
||||
[
|
||||
'0',
|
||||
],
|
||||
{
|
||||
'0' : 'Channel1',
|
||||
'1' : 'Channel2',
|
||||
'2' : 'Channel3',
|
||||
'3' : 'Channel4',
|
||||
'4' : 'Channel5',
|
||||
'5' : 'Channel6',
|
||||
'6' : 'Channel7',
|
||||
'7' : 'Channel8',
|
||||
'8' : 'None',
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'FixedWingYaw',
|
||||
'b',
|
||||
1,
|
||||
[
|
||||
'0',
|
||||
],
|
||||
{
|
||||
'0' : 'Channel1',
|
||||
'1' : 'Channel2',
|
||||
'2' : 'Channel3',
|
||||
'3' : 'Channel4',
|
||||
'4' : 'Channel5',
|
||||
'5' : 'Channel6',
|
||||
'6' : 'Channel7',
|
||||
'7' : 'Channel8',
|
||||
'8' : 'None',
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'FixedWingThrottle',
|
||||
'b',
|
||||
1,
|
||||
[
|
||||
'0',
|
||||
],
|
||||
{
|
||||
'0' : 'Channel1',
|
||||
'1' : 'Channel2',
|
||||
'2' : 'Channel3',
|
||||
'3' : 'Channel4',
|
||||
'4' : 'Channel5',
|
||||
'5' : 'Channel6',
|
||||
'6' : 'Channel7',
|
||||
'7' : 'Channel8',
|
||||
'8' : 'None',
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'VTOLMotorN',
|
||||
'b',
|
||||
1,
|
||||
[
|
||||
'0',
|
||||
],
|
||||
{
|
||||
'0' : 'Channel1',
|
||||
'1' : 'Channel2',
|
||||
'2' : 'Channel3',
|
||||
'3' : 'Channel4',
|
||||
'4' : 'Channel5',
|
||||
'5' : 'Channel6',
|
||||
'6' : 'Channel7',
|
||||
'7' : 'Channel8',
|
||||
'8' : 'None',
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'VTOLMotorNE',
|
||||
'b',
|
||||
1,
|
||||
[
|
||||
'0',
|
||||
],
|
||||
{
|
||||
'0' : 'Channel1',
|
||||
'1' : 'Channel2',
|
||||
'2' : 'Channel3',
|
||||
'3' : 'Channel4',
|
||||
'4' : 'Channel5',
|
||||
'5' : 'Channel6',
|
||||
'6' : 'Channel7',
|
||||
'7' : 'Channel8',
|
||||
'8' : 'None',
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'VTOLMotorE',
|
||||
'b',
|
||||
1,
|
||||
[
|
||||
'0',
|
||||
],
|
||||
{
|
||||
'0' : 'Channel1',
|
||||
'1' : 'Channel2',
|
||||
'2' : 'Channel3',
|
||||
'3' : 'Channel4',
|
||||
'4' : 'Channel5',
|
||||
'5' : 'Channel6',
|
||||
'6' : 'Channel7',
|
||||
'7' : 'Channel8',
|
||||
'8' : 'None',
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'VTOLMotorSE',
|
||||
'b',
|
||||
1,
|
||||
[
|
||||
'0',
|
||||
],
|
||||
{
|
||||
'0' : 'Channel1',
|
||||
'1' : 'Channel2',
|
||||
'2' : 'Channel3',
|
||||
'3' : 'Channel4',
|
||||
'4' : 'Channel5',
|
||||
'5' : 'Channel6',
|
||||
'6' : 'Channel7',
|
||||
'7' : 'Channel8',
|
||||
'8' : 'None',
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'VTOLMotorS',
|
||||
'b',
|
||||
1,
|
||||
[
|
||||
'0',
|
||||
],
|
||||
{
|
||||
'0' : 'Channel1',
|
||||
'1' : 'Channel2',
|
||||
'2' : 'Channel3',
|
||||
'3' : 'Channel4',
|
||||
'4' : 'Channel5',
|
||||
'5' : 'Channel6',
|
||||
'6' : 'Channel7',
|
||||
'7' : 'Channel8',
|
||||
'8' : 'None',
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'VTOLMotorSW',
|
||||
'b',
|
||||
1,
|
||||
[
|
||||
'0',
|
||||
],
|
||||
{
|
||||
'0' : 'Channel1',
|
||||
'1' : 'Channel2',
|
||||
'2' : 'Channel3',
|
||||
'3' : 'Channel4',
|
||||
'4' : 'Channel5',
|
||||
'5' : 'Channel6',
|
||||
'6' : 'Channel7',
|
||||
'7' : 'Channel8',
|
||||
'8' : 'None',
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'VTOLMotorW',
|
||||
'b',
|
||||
1,
|
||||
[
|
||||
'0',
|
||||
],
|
||||
{
|
||||
'0' : 'Channel1',
|
||||
'1' : 'Channel2',
|
||||
'2' : 'Channel3',
|
||||
'3' : 'Channel4',
|
||||
'4' : 'Channel5',
|
||||
'5' : 'Channel6',
|
||||
'6' : 'Channel7',
|
||||
'7' : 'Channel8',
|
||||
'8' : 'None',
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'VTOLMotorNW',
|
||||
'b',
|
||||
1,
|
||||
[
|
||||
'0',
|
||||
],
|
||||
{
|
||||
'0' : 'Channel1',
|
||||
'1' : 'Channel2',
|
||||
'2' : 'Channel3',
|
||||
'3' : 'Channel4',
|
||||
'4' : 'Channel5',
|
||||
'5' : 'Channel6',
|
||||
'6' : 'Channel7',
|
||||
'7' : 'Channel8',
|
||||
'8' : 'None',
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'ChannelUpdateFreq',
|
||||
'h',
|
||||
2,
|
||||
[
|
||||
'0',
|
||||
'1',
|
||||
],
|
||||
{
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'ChannelMax',
|
||||
'h',
|
||||
8,
|
||||
[
|
||||
'0',
|
||||
'1',
|
||||
'2',
|
||||
'3',
|
||||
'4',
|
||||
'5',
|
||||
'6',
|
||||
'7',
|
||||
],
|
||||
{
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'ChannelNeutral',
|
||||
'h',
|
||||
8,
|
||||
[
|
||||
'0',
|
||||
'1',
|
||||
'2',
|
||||
'3',
|
||||
'4',
|
||||
'5',
|
||||
'6',
|
||||
'7',
|
||||
],
|
||||
{
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'ChannelMin',
|
||||
'h',
|
||||
8,
|
||||
[
|
||||
'0',
|
||||
'1',
|
||||
'2',
|
||||
'3',
|
||||
'4',
|
||||
'5',
|
||||
'6',
|
||||
'7',
|
||||
],
|
||||
{
|
||||
}
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
class ActuatorSettings(uavobject.UAVObject):
|
||||
## Object constants
|
||||
OBJID = 3054509114
|
||||
NAME = "ActuatorSettings"
|
||||
METANAME = "ActuatorSettingsMeta"
|
||||
ISSINGLEINST = 1
|
||||
ISSETTINGS = 1
|
||||
|
||||
def __init__(self):
|
||||
uavobject.UAVObject.__init__(self,
|
||||
self.OBJID,
|
||||
self.NAME,
|
||||
self.METANAME,
|
||||
0,
|
||||
self.ISSINGLEINST)
|
||||
|
||||
for f in _fields:
|
||||
self.add_field(f)
|
||||
|
||||
def __str__(self):
|
||||
s = ("0x%08X (%10u) %-30s %3u bytes format '%s'\n"
|
||||
% (self.OBJID, self.OBJID, self.NAME, self.get_struct().size, self.get_struct().format))
|
||||
for f in self.get_tuple()._fields:
|
||||
s += ("\t%s\n" % f)
|
||||
return (s)
|
||||
|
||||
def main():
|
||||
# Instantiate the object and dump out some interesting info
|
||||
x = ActuatorSettings()
|
||||
print (x)
|
||||
|
||||
if __name__ == "__main__":
|
||||
#import pdb ; pdb.run('main()')
|
||||
main()
|
127
ground/src/plugins/uavobjects/attitudedesired.cpp
Normal file
127
ground/src/plugins/uavobjects/attitudedesired.cpp
Normal file
@ -0,0 +1,127 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file attitudedesired.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Implementation of the AttitudeDesired object. This file has been
|
||||
* automatically generated by the UAVObjectGenerator.
|
||||
*
|
||||
* @note Object definition file: attitudedesired.xml.
|
||||
* This is an automatically generated file.
|
||||
* DO NOT modify manually.
|
||||
*
|
||||
* @see The GNU Public License (GPL) Version 3
|
||||
*
|
||||
*****************************************************************************/
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include "attitudedesired.h"
|
||||
#include "uavobjectfield.h"
|
||||
|
||||
const QString AttitudeDesired::NAME = QString("AttitudeDesired");
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
AttitudeDesired::AttitudeDesired(): UAVDataObject(OBJID, ISSINGLEINST, ISSETTINGS, NAME)
|
||||
{
|
||||
// Create fields
|
||||
QList<UAVObjectField*> fields;
|
||||
QStringList RollElemNames;
|
||||
RollElemNames.append("0");
|
||||
fields.append( new UAVObjectField(QString("Roll"), QString("degrees"), UAVObjectField::FLOAT32, RollElemNames, QStringList()) );
|
||||
QStringList PitchElemNames;
|
||||
PitchElemNames.append("0");
|
||||
fields.append( new UAVObjectField(QString("Pitch"), QString("degrees"), UAVObjectField::FLOAT32, PitchElemNames, QStringList()) );
|
||||
QStringList YawElemNames;
|
||||
YawElemNames.append("0");
|
||||
fields.append( new UAVObjectField(QString("Yaw"), QString("degrees"), UAVObjectField::FLOAT32, YawElemNames, QStringList()) );
|
||||
QStringList ThrottleElemNames;
|
||||
ThrottleElemNames.append("0");
|
||||
fields.append( new UAVObjectField(QString("Throttle"), QString("%"), UAVObjectField::FLOAT32, ThrottleElemNames, QStringList()) );
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, (quint8*)&data, NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the default metadata for this object
|
||||
*/
|
||||
UAVObject::Metadata AttitudeDesired::getDefaultMetadata()
|
||||
{
|
||||
UAVObject::Metadata metadata;
|
||||
metadata.gcsTelemetryAcked = 1;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject::UPDATEMODE_MANUAL;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
metadata.flightTelemetryAcked = 1;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject::UPDATEMODE_PERIODIC;
|
||||
metadata.flightTelemetryUpdatePeriod = 1000;
|
||||
metadata.loggingUpdateMode = UAVObject::UPDATEMODE_NEVER;
|
||||
metadata.loggingUpdatePeriod = 0;
|
||||
return metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize object fields with the default values.
|
||||
* If a default value is not specified the object fields
|
||||
* will be initialized to zero.
|
||||
*/
|
||||
void AttitudeDesired::setDefaultFieldValues()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the object data fields
|
||||
*/
|
||||
AttitudeDesired::DataFields AttitudeDesired::getData()
|
||||
{
|
||||
QMutexLocker locker(mutex);
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the object data fields
|
||||
*/
|
||||
void AttitudeDesired::setData(const DataFields& data)
|
||||
{
|
||||
QMutexLocker locker(mutex);
|
||||
this->data = data;
|
||||
emit objectUpdatedAuto(this); // trigger object updated event
|
||||
emit objectUpdated(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a clone of this object, a new instance ID must be specified.
|
||||
* Do not use this function directly to create new instances, the
|
||||
* UAVObjectManager should be used instead.
|
||||
*/
|
||||
UAVDataObject* AttitudeDesired::clone(quint32 instID)
|
||||
{
|
||||
AttitudeDesired* obj = new AttitudeDesired();
|
||||
obj->initialize(instID, this->getMetaObject());
|
||||
return obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
AttitudeDesired* AttitudeDesired::GetInstance(UAVObjectManager* objMngr, quint32 instID)
|
||||
{
|
||||
return dynamic_cast<AttitudeDesired*>(objMngr->getObject(AttitudeDesired::OBJID, instID));
|
||||
}
|
82
ground/src/plugins/uavobjects/attitudedesired.h
Normal file
82
ground/src/plugins/uavobjects/attitudedesired.h
Normal file
@ -0,0 +1,82 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file attitudedesired.h
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Implementation of the AttitudeDesired object. This file has been
|
||||
* automatically generated by the UAVObjectGenerator.
|
||||
*
|
||||
* @note Object definition file: attitudedesired.xml.
|
||||
* This is an automatically generated file.
|
||||
* DO NOT modify manually.
|
||||
*
|
||||
* @see The GNU Public License (GPL) Version 3
|
||||
*
|
||||
*****************************************************************************/
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#ifndef ATTITUDEDESIRED_H
|
||||
#define ATTITUDEDESIRED_H
|
||||
|
||||
#include "uavdataobject.h"
|
||||
#include "uavobjectmanager.h"
|
||||
|
||||
class UAVOBJECTS_EXPORT AttitudeDesired: public UAVDataObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
// Field structure
|
||||
typedef struct {
|
||||
float Roll;
|
||||
float Pitch;
|
||||
float Yaw;
|
||||
float Throttle;
|
||||
|
||||
} __attribute__((packed)) DataFields;
|
||||
|
||||
// Field information
|
||||
// Field Roll information
|
||||
// Field Pitch information
|
||||
// Field Yaw information
|
||||
// Field Throttle information
|
||||
|
||||
|
||||
// Constants
|
||||
static const quint32 OBJID = 1412270808U;
|
||||
static const QString NAME;
|
||||
static const bool ISSINGLEINST = 1;
|
||||
static const bool ISSETTINGS = 0;
|
||||
static const quint32 NUMBYTES = sizeof(DataFields);
|
||||
|
||||
// Functions
|
||||
AttitudeDesired();
|
||||
|
||||
DataFields getData();
|
||||
void setData(const DataFields& data);
|
||||
Metadata getDefaultMetadata();
|
||||
UAVDataObject* clone(quint32 instID);
|
||||
|
||||
static AttitudeDesired* GetInstance(UAVObjectManager* objMngr, quint32 instID = 0);
|
||||
|
||||
private:
|
||||
DataFields data;
|
||||
|
||||
void setDefaultFieldValues();
|
||||
|
||||
};
|
||||
|
||||
#endif // ATTITUDEDESIRED_H
|
116
ground/src/plugins/uavobjects/attitudedesired.py
Normal file
116
ground/src/plugins/uavobjects/attitudedesired.py
Normal file
@ -0,0 +1,116 @@
|
||||
##
|
||||
##############################################################################
|
||||
#
|
||||
# @file attitudedesired.py
|
||||
# @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
# @brief Implementation of the AttitudeDesired object. This file has been
|
||||
# automatically generated by the UAVObjectGenerator.
|
||||
#
|
||||
# @note Object definition file: attitudedesired.xml.
|
||||
# This is an automatically generated file.
|
||||
# DO NOT modify manually.
|
||||
#
|
||||
# @see The GNU Public License (GPL) Version 3
|
||||
#
|
||||
#############################################################################/
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
|
||||
import uavobject
|
||||
|
||||
import struct
|
||||
from collections import namedtuple
|
||||
|
||||
# This is a list of instances of the data fields contained in this object
|
||||
_fields = [ \
|
||||
uavobject.UAVObjectField(
|
||||
'Roll',
|
||||
'f',
|
||||
1,
|
||||
[
|
||||
'0',
|
||||
],
|
||||
{
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'Pitch',
|
||||
'f',
|
||||
1,
|
||||
[
|
||||
'0',
|
||||
],
|
||||
{
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'Yaw',
|
||||
'f',
|
||||
1,
|
||||
[
|
||||
'0',
|
||||
],
|
||||
{
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'Throttle',
|
||||
'f',
|
||||
1,
|
||||
[
|
||||
'0',
|
||||
],
|
||||
{
|
||||
}
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
class AttitudeDesired(uavobject.UAVObject):
|
||||
## Object constants
|
||||
OBJID = 1412270808
|
||||
NAME = "AttitudeDesired"
|
||||
METANAME = "AttitudeDesiredMeta"
|
||||
ISSINGLEINST = 1
|
||||
ISSETTINGS = 0
|
||||
|
||||
def __init__(self):
|
||||
uavobject.UAVObject.__init__(self,
|
||||
self.OBJID,
|
||||
self.NAME,
|
||||
self.METANAME,
|
||||
0,
|
||||
self.ISSINGLEINST)
|
||||
|
||||
for f in _fields:
|
||||
self.add_field(f)
|
||||
|
||||
def __str__(self):
|
||||
s = ("0x%08X (%10u) %-30s %3u bytes format '%s'\n"
|
||||
% (self.OBJID, self.OBJID, self.NAME, self.get_struct().size, self.get_struct().format))
|
||||
for f in self.get_tuple()._fields:
|
||||
s += ("\t%s\n" % f)
|
||||
return (s)
|
||||
|
||||
def main():
|
||||
# Instantiate the object and dump out some interesting info
|
||||
x = AttitudeDesired()
|
||||
print (x)
|
||||
|
||||
if __name__ == "__main__":
|
||||
#import pdb ; pdb.run('main()')
|
||||
main()
|
150
ground/src/plugins/uavobjects/manualcontrolcommand.cpp
Normal file
150
ground/src/plugins/uavobjects/manualcontrolcommand.cpp
Normal file
@ -0,0 +1,150 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file manualcontrolcommand.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Implementation of the ManualControlCommand object. This file has been
|
||||
* automatically generated by the UAVObjectGenerator.
|
||||
*
|
||||
* @note Object definition file: manualcontrolcommand.xml.
|
||||
* This is an automatically generated file.
|
||||
* DO NOT modify manually.
|
||||
*
|
||||
* @see The GNU Public License (GPL) Version 3
|
||||
*
|
||||
*****************************************************************************/
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include "manualcontrolcommand.h"
|
||||
#include "uavobjectfield.h"
|
||||
|
||||
const QString ManualControlCommand::NAME = QString("ManualControlCommand");
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
ManualControlCommand::ManualControlCommand(): UAVDataObject(OBJID, ISSINGLEINST, ISSETTINGS, NAME)
|
||||
{
|
||||
// Create fields
|
||||
QList<UAVObjectField*> fields;
|
||||
QStringList ConnectedElemNames;
|
||||
ConnectedElemNames.append("0");
|
||||
QStringList ConnectedEnumOptions;
|
||||
ConnectedEnumOptions.append("False");
|
||||
ConnectedEnumOptions.append("True");
|
||||
fields.append( new UAVObjectField(QString("Connected"), QString(""), UAVObjectField::ENUM, ConnectedElemNames, ConnectedEnumOptions) );
|
||||
QStringList RollElemNames;
|
||||
RollElemNames.append("0");
|
||||
fields.append( new UAVObjectField(QString("Roll"), QString("%"), UAVObjectField::FLOAT32, RollElemNames, QStringList()) );
|
||||
QStringList PitchElemNames;
|
||||
PitchElemNames.append("0");
|
||||
fields.append( new UAVObjectField(QString("Pitch"), QString("%"), UAVObjectField::FLOAT32, PitchElemNames, QStringList()) );
|
||||
QStringList YawElemNames;
|
||||
YawElemNames.append("0");
|
||||
fields.append( new UAVObjectField(QString("Yaw"), QString("%"), UAVObjectField::FLOAT32, YawElemNames, QStringList()) );
|
||||
QStringList ThrottleElemNames;
|
||||
ThrottleElemNames.append("0");
|
||||
fields.append( new UAVObjectField(QString("Throttle"), QString("%"), UAVObjectField::FLOAT32, ThrottleElemNames, QStringList()) );
|
||||
QStringList FlightModeElemNames;
|
||||
FlightModeElemNames.append("0");
|
||||
QStringList FlightModeEnumOptions;
|
||||
FlightModeEnumOptions.append("Manual");
|
||||
FlightModeEnumOptions.append("Stabilized");
|
||||
FlightModeEnumOptions.append("Auto");
|
||||
fields.append( new UAVObjectField(QString("FlightMode"), QString(""), UAVObjectField::ENUM, FlightModeElemNames, FlightModeEnumOptions) );
|
||||
QStringList ChannelElemNames;
|
||||
ChannelElemNames.append("0");
|
||||
ChannelElemNames.append("1");
|
||||
ChannelElemNames.append("2");
|
||||
ChannelElemNames.append("3");
|
||||
ChannelElemNames.append("4");
|
||||
ChannelElemNames.append("5");
|
||||
ChannelElemNames.append("6");
|
||||
ChannelElemNames.append("7");
|
||||
fields.append( new UAVObjectField(QString("Channel"), QString("us"), UAVObjectField::INT16, ChannelElemNames, QStringList()) );
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, (quint8*)&data, NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the default metadata for this object
|
||||
*/
|
||||
UAVObject::Metadata ManualControlCommand::getDefaultMetadata()
|
||||
{
|
||||
UAVObject::Metadata metadata;
|
||||
metadata.gcsTelemetryAcked = 1;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject::UPDATEMODE_MANUAL;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
metadata.flightTelemetryAcked = 1;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject::UPDATEMODE_PERIODIC;
|
||||
metadata.flightTelemetryUpdatePeriod = 3000;
|
||||
metadata.loggingUpdateMode = UAVObject::UPDATEMODE_NEVER;
|
||||
metadata.loggingUpdatePeriod = 0;
|
||||
return metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize object fields with the default values.
|
||||
* If a default value is not specified the object fields
|
||||
* will be initialized to zero.
|
||||
*/
|
||||
void ManualControlCommand::setDefaultFieldValues()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the object data fields
|
||||
*/
|
||||
ManualControlCommand::DataFields ManualControlCommand::getData()
|
||||
{
|
||||
QMutexLocker locker(mutex);
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the object data fields
|
||||
*/
|
||||
void ManualControlCommand::setData(const DataFields& data)
|
||||
{
|
||||
QMutexLocker locker(mutex);
|
||||
this->data = data;
|
||||
emit objectUpdatedAuto(this); // trigger object updated event
|
||||
emit objectUpdated(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a clone of this object, a new instance ID must be specified.
|
||||
* Do not use this function directly to create new instances, the
|
||||
* UAVObjectManager should be used instead.
|
||||
*/
|
||||
UAVDataObject* ManualControlCommand::clone(quint32 instID)
|
||||
{
|
||||
ManualControlCommand* obj = new ManualControlCommand();
|
||||
obj->initialize(instID, this->getMetaObject());
|
||||
return obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
ManualControlCommand* ManualControlCommand::GetInstance(UAVObjectManager* objMngr, quint32 instID)
|
||||
{
|
||||
return dynamic_cast<ManualControlCommand*>(objMngr->getObject(ManualControlCommand::OBJID, instID));
|
||||
}
|
94
ground/src/plugins/uavobjects/manualcontrolcommand.h
Normal file
94
ground/src/plugins/uavobjects/manualcontrolcommand.h
Normal file
@ -0,0 +1,94 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file manualcontrolcommand.h
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Implementation of the ManualControlCommand object. This file has been
|
||||
* automatically generated by the UAVObjectGenerator.
|
||||
*
|
||||
* @note Object definition file: manualcontrolcommand.xml.
|
||||
* This is an automatically generated file.
|
||||
* DO NOT modify manually.
|
||||
*
|
||||
* @see The GNU Public License (GPL) Version 3
|
||||
*
|
||||
*****************************************************************************/
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#ifndef MANUALCONTROLCOMMAND_H
|
||||
#define MANUALCONTROLCOMMAND_H
|
||||
|
||||
#include "uavdataobject.h"
|
||||
#include "uavobjectmanager.h"
|
||||
|
||||
class UAVOBJECTS_EXPORT ManualControlCommand: public UAVDataObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
// Field structure
|
||||
typedef struct {
|
||||
quint8 Connected;
|
||||
float Roll;
|
||||
float Pitch;
|
||||
float Yaw;
|
||||
float Throttle;
|
||||
quint8 FlightMode;
|
||||
qint16 Channel[8];
|
||||
|
||||
} __attribute__((packed)) DataFields;
|
||||
|
||||
// Field information
|
||||
// Field Connected information
|
||||
/* Enumeration options for field Connected */
|
||||
typedef enum { CONNECTED_FALSE=0, CONNECTED_TRUE=1, } ConnectedOptions;
|
||||
// Field Roll information
|
||||
// Field Pitch information
|
||||
// Field Yaw information
|
||||
// Field Throttle information
|
||||
// Field FlightMode information
|
||||
/* Enumeration options for field FlightMode */
|
||||
typedef enum { FLIGHTMODE_MANUAL=0, FLIGHTMODE_STABILIZED=1, FLIGHTMODE_AUTO=2, } FlightModeOptions;
|
||||
// Field Channel information
|
||||
/* Number of elements for field Channel */
|
||||
static const quint32 CHANNEL_NUMELEM = 8;
|
||||
|
||||
|
||||
// Constants
|
||||
static const quint32 OBJID = 990495372U;
|
||||
static const QString NAME;
|
||||
static const bool ISSINGLEINST = 1;
|
||||
static const bool ISSETTINGS = 0;
|
||||
static const quint32 NUMBYTES = sizeof(DataFields);
|
||||
|
||||
// Functions
|
||||
ManualControlCommand();
|
||||
|
||||
DataFields getData();
|
||||
void setData(const DataFields& data);
|
||||
Metadata getDefaultMetadata();
|
||||
UAVDataObject* clone(quint32 instID);
|
||||
|
||||
static ManualControlCommand* GetInstance(UAVObjectManager* objMngr, quint32 instID = 0);
|
||||
|
||||
private:
|
||||
DataFields data;
|
||||
|
||||
void setDefaultFieldValues();
|
||||
|
||||
};
|
||||
|
||||
#endif // MANUALCONTROLCOMMAND_H
|
158
ground/src/plugins/uavobjects/manualcontrolcommand.py
Normal file
158
ground/src/plugins/uavobjects/manualcontrolcommand.py
Normal file
@ -0,0 +1,158 @@
|
||||
##
|
||||
##############################################################################
|
||||
#
|
||||
# @file manualcontrolcommand.py
|
||||
# @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
# @brief Implementation of the ManualControlCommand object. This file has been
|
||||
# automatically generated by the UAVObjectGenerator.
|
||||
#
|
||||
# @note Object definition file: manualcontrolcommand.xml.
|
||||
# This is an automatically generated file.
|
||||
# DO NOT modify manually.
|
||||
#
|
||||
# @see The GNU Public License (GPL) Version 3
|
||||
#
|
||||
#############################################################################/
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
|
||||
import uavobject
|
||||
|
||||
import struct
|
||||
from collections import namedtuple
|
||||
|
||||
# This is a list of instances of the data fields contained in this object
|
||||
_fields = [ \
|
||||
uavobject.UAVObjectField(
|
||||
'Connected',
|
||||
'b',
|
||||
1,
|
||||
[
|
||||
'0',
|
||||
],
|
||||
{
|
||||
'0' : 'False',
|
||||
'1' : 'True',
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'Roll',
|
||||
'f',
|
||||
1,
|
||||
[
|
||||
'0',
|
||||
],
|
||||
{
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'Pitch',
|
||||
'f',
|
||||
1,
|
||||
[
|
||||
'0',
|
||||
],
|
||||
{
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'Yaw',
|
||||
'f',
|
||||
1,
|
||||
[
|
||||
'0',
|
||||
],
|
||||
{
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'Throttle',
|
||||
'f',
|
||||
1,
|
||||
[
|
||||
'0',
|
||||
],
|
||||
{
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'FlightMode',
|
||||
'b',
|
||||
1,
|
||||
[
|
||||
'0',
|
||||
],
|
||||
{
|
||||
'0' : 'Manual',
|
||||
'1' : 'Stabilized',
|
||||
'2' : 'Auto',
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'Channel',
|
||||
'h',
|
||||
8,
|
||||
[
|
||||
'0',
|
||||
'1',
|
||||
'2',
|
||||
'3',
|
||||
'4',
|
||||
'5',
|
||||
'6',
|
||||
'7',
|
||||
],
|
||||
{
|
||||
}
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
class ManualControlCommand(uavobject.UAVObject):
|
||||
## Object constants
|
||||
OBJID = 990495372
|
||||
NAME = "ManualControlCommand"
|
||||
METANAME = "ManualControlCommandMeta"
|
||||
ISSINGLEINST = 1
|
||||
ISSETTINGS = 0
|
||||
|
||||
def __init__(self):
|
||||
uavobject.UAVObject.__init__(self,
|
||||
self.OBJID,
|
||||
self.NAME,
|
||||
self.METANAME,
|
||||
0,
|
||||
self.ISSINGLEINST)
|
||||
|
||||
for f in _fields:
|
||||
self.add_field(f)
|
||||
|
||||
def __str__(self):
|
||||
s = ("0x%08X (%10u) %-30s %3u bytes format '%s'\n"
|
||||
% (self.OBJID, self.OBJID, self.NAME, self.get_struct().size, self.get_struct().format))
|
||||
for f in self.get_tuple()._fields:
|
||||
s += ("\t%s\n" % f)
|
||||
return (s)
|
||||
|
||||
def main():
|
||||
# Instantiate the object and dump out some interesting info
|
||||
x = ManualControlCommand()
|
||||
print (x)
|
||||
|
||||
if __name__ == "__main__":
|
||||
#import pdb ; pdb.run('main()')
|
||||
main()
|
247
ground/src/plugins/uavobjects/manualcontrolsettings.cpp
Normal file
247
ground/src/plugins/uavobjects/manualcontrolsettings.cpp
Normal file
@ -0,0 +1,247 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file manualcontrolsettings.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Implementation of the ManualControlSettings object. This file has been
|
||||
* automatically generated by the UAVObjectGenerator.
|
||||
*
|
||||
* @note Object definition file: manualcontrolsettings.xml.
|
||||
* This is an automatically generated file.
|
||||
* DO NOT modify manually.
|
||||
*
|
||||
* @see The GNU Public License (GPL) Version 3
|
||||
*
|
||||
*****************************************************************************/
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include "manualcontrolsettings.h"
|
||||
#include "uavobjectfield.h"
|
||||
|
||||
const QString ManualControlSettings::NAME = QString("ManualControlSettings");
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
ManualControlSettings::ManualControlSettings(): UAVDataObject(OBJID, ISSINGLEINST, ISSETTINGS, NAME)
|
||||
{
|
||||
// Create fields
|
||||
QList<UAVObjectField*> fields;
|
||||
QStringList InputModeElemNames;
|
||||
InputModeElemNames.append("0");
|
||||
QStringList InputModeEnumOptions;
|
||||
InputModeEnumOptions.append("PWM");
|
||||
InputModeEnumOptions.append("PPM");
|
||||
InputModeEnumOptions.append("Spektrum");
|
||||
fields.append( new UAVObjectField(QString("InputMode"), QString(""), UAVObjectField::ENUM, InputModeElemNames, InputModeEnumOptions) );
|
||||
QStringList RollElemNames;
|
||||
RollElemNames.append("0");
|
||||
QStringList RollEnumOptions;
|
||||
RollEnumOptions.append("Channel1");
|
||||
RollEnumOptions.append("Channel2");
|
||||
RollEnumOptions.append("Channel3");
|
||||
RollEnumOptions.append("Channel4");
|
||||
RollEnumOptions.append("Channel5");
|
||||
RollEnumOptions.append("Channel6");
|
||||
RollEnumOptions.append("Channel7");
|
||||
RollEnumOptions.append("Channel8");
|
||||
RollEnumOptions.append("None");
|
||||
fields.append( new UAVObjectField(QString("Roll"), QString("channel"), UAVObjectField::ENUM, RollElemNames, RollEnumOptions) );
|
||||
QStringList PitchElemNames;
|
||||
PitchElemNames.append("0");
|
||||
QStringList PitchEnumOptions;
|
||||
PitchEnumOptions.append("Channel1");
|
||||
PitchEnumOptions.append("Channel2");
|
||||
PitchEnumOptions.append("Channel3");
|
||||
PitchEnumOptions.append("Channel4");
|
||||
PitchEnumOptions.append("Channel5");
|
||||
PitchEnumOptions.append("Channel6");
|
||||
PitchEnumOptions.append("Channel7");
|
||||
PitchEnumOptions.append("Channel8");
|
||||
PitchEnumOptions.append("None");
|
||||
fields.append( new UAVObjectField(QString("Pitch"), QString("channel"), UAVObjectField::ENUM, PitchElemNames, PitchEnumOptions) );
|
||||
QStringList YawElemNames;
|
||||
YawElemNames.append("0");
|
||||
QStringList YawEnumOptions;
|
||||
YawEnumOptions.append("Channel1");
|
||||
YawEnumOptions.append("Channel2");
|
||||
YawEnumOptions.append("Channel3");
|
||||
YawEnumOptions.append("Channel4");
|
||||
YawEnumOptions.append("Channel5");
|
||||
YawEnumOptions.append("Channel6");
|
||||
YawEnumOptions.append("Channel7");
|
||||
YawEnumOptions.append("Channel8");
|
||||
YawEnumOptions.append("None");
|
||||
fields.append( new UAVObjectField(QString("Yaw"), QString("channel"), UAVObjectField::ENUM, YawElemNames, YawEnumOptions) );
|
||||
QStringList ThrottleElemNames;
|
||||
ThrottleElemNames.append("0");
|
||||
QStringList ThrottleEnumOptions;
|
||||
ThrottleEnumOptions.append("Channel1");
|
||||
ThrottleEnumOptions.append("Channel2");
|
||||
ThrottleEnumOptions.append("Channel3");
|
||||
ThrottleEnumOptions.append("Channel4");
|
||||
ThrottleEnumOptions.append("Channel5");
|
||||
ThrottleEnumOptions.append("Channel6");
|
||||
ThrottleEnumOptions.append("Channel7");
|
||||
ThrottleEnumOptions.append("Channel8");
|
||||
ThrottleEnumOptions.append("None");
|
||||
fields.append( new UAVObjectField(QString("Throttle"), QString("channel"), UAVObjectField::ENUM, ThrottleElemNames, ThrottleEnumOptions) );
|
||||
QStringList FlightModeElemNames;
|
||||
FlightModeElemNames.append("0");
|
||||
QStringList FlightModeEnumOptions;
|
||||
FlightModeEnumOptions.append("Channel1");
|
||||
FlightModeEnumOptions.append("Channel2");
|
||||
FlightModeEnumOptions.append("Channel3");
|
||||
FlightModeEnumOptions.append("Channel4");
|
||||
FlightModeEnumOptions.append("Channel5");
|
||||
FlightModeEnumOptions.append("Channel6");
|
||||
FlightModeEnumOptions.append("Channel7");
|
||||
FlightModeEnumOptions.append("Channel8");
|
||||
FlightModeEnumOptions.append("None");
|
||||
fields.append( new UAVObjectField(QString("FlightMode"), QString("channel"), UAVObjectField::ENUM, FlightModeElemNames, FlightModeEnumOptions) );
|
||||
QStringList ChannelMaxElemNames;
|
||||
ChannelMaxElemNames.append("0");
|
||||
ChannelMaxElemNames.append("1");
|
||||
ChannelMaxElemNames.append("2");
|
||||
ChannelMaxElemNames.append("3");
|
||||
ChannelMaxElemNames.append("4");
|
||||
ChannelMaxElemNames.append("5");
|
||||
ChannelMaxElemNames.append("6");
|
||||
ChannelMaxElemNames.append("7");
|
||||
fields.append( new UAVObjectField(QString("ChannelMax"), QString("us"), UAVObjectField::INT16, ChannelMaxElemNames, QStringList()) );
|
||||
QStringList ChannelNeutralElemNames;
|
||||
ChannelNeutralElemNames.append("0");
|
||||
ChannelNeutralElemNames.append("1");
|
||||
ChannelNeutralElemNames.append("2");
|
||||
ChannelNeutralElemNames.append("3");
|
||||
ChannelNeutralElemNames.append("4");
|
||||
ChannelNeutralElemNames.append("5");
|
||||
ChannelNeutralElemNames.append("6");
|
||||
ChannelNeutralElemNames.append("7");
|
||||
fields.append( new UAVObjectField(QString("ChannelNeutral"), QString("us"), UAVObjectField::INT16, ChannelNeutralElemNames, QStringList()) );
|
||||
QStringList ChannelMinElemNames;
|
||||
ChannelMinElemNames.append("0");
|
||||
ChannelMinElemNames.append("1");
|
||||
ChannelMinElemNames.append("2");
|
||||
ChannelMinElemNames.append("3");
|
||||
ChannelMinElemNames.append("4");
|
||||
ChannelMinElemNames.append("5");
|
||||
ChannelMinElemNames.append("6");
|
||||
ChannelMinElemNames.append("7");
|
||||
fields.append( new UAVObjectField(QString("ChannelMin"), QString("us"), UAVObjectField::INT16, ChannelMinElemNames, QStringList()) );
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, (quint8*)&data, NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the default metadata for this object
|
||||
*/
|
||||
UAVObject::Metadata ManualControlSettings::getDefaultMetadata()
|
||||
{
|
||||
UAVObject::Metadata metadata;
|
||||
metadata.gcsTelemetryAcked = 1;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject::UPDATEMODE_ONCHANGE;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
metadata.flightTelemetryAcked = 1;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject::UPDATEMODE_ONCHANGE;
|
||||
metadata.flightTelemetryUpdatePeriod = 0;
|
||||
metadata.loggingUpdateMode = UAVObject::UPDATEMODE_NEVER;
|
||||
metadata.loggingUpdatePeriod = 0;
|
||||
return metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize object fields with the default values.
|
||||
* If a default value is not specified the object fields
|
||||
* will be initialized to zero.
|
||||
*/
|
||||
void ManualControlSettings::setDefaultFieldValues()
|
||||
{
|
||||
data.InputMode = 0;
|
||||
data.Roll = 0;
|
||||
data.Pitch = 1;
|
||||
data.Yaw = 2;
|
||||
data.Throttle = 3;
|
||||
data.FlightMode = 4;
|
||||
data.ChannelMax[0] = 2000;
|
||||
data.ChannelMax[1] = 2000;
|
||||
data.ChannelMax[2] = 2000;
|
||||
data.ChannelMax[3] = 2000;
|
||||
data.ChannelMax[4] = 2000;
|
||||
data.ChannelMax[5] = 2000;
|
||||
data.ChannelMax[6] = 2000;
|
||||
data.ChannelMax[7] = 2000;
|
||||
data.ChannelNeutral[0] = 1500;
|
||||
data.ChannelNeutral[1] = 1500;
|
||||
data.ChannelNeutral[2] = 1500;
|
||||
data.ChannelNeutral[3] = 1500;
|
||||
data.ChannelNeutral[4] = 1500;
|
||||
data.ChannelNeutral[5] = 1500;
|
||||
data.ChannelNeutral[6] = 1500;
|
||||
data.ChannelNeutral[7] = 1500;
|
||||
data.ChannelMin[0] = 1000;
|
||||
data.ChannelMin[1] = 1000;
|
||||
data.ChannelMin[2] = 1000;
|
||||
data.ChannelMin[3] = 1000;
|
||||
data.ChannelMin[4] = 1000;
|
||||
data.ChannelMin[5] = 1000;
|
||||
data.ChannelMin[6] = 1000;
|
||||
data.ChannelMin[7] = 1000;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the object data fields
|
||||
*/
|
||||
ManualControlSettings::DataFields ManualControlSettings::getData()
|
||||
{
|
||||
QMutexLocker locker(mutex);
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the object data fields
|
||||
*/
|
||||
void ManualControlSettings::setData(const DataFields& data)
|
||||
{
|
||||
QMutexLocker locker(mutex);
|
||||
this->data = data;
|
||||
emit objectUpdatedAuto(this); // trigger object updated event
|
||||
emit objectUpdated(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a clone of this object, a new instance ID must be specified.
|
||||
* Do not use this function directly to create new instances, the
|
||||
* UAVObjectManager should be used instead.
|
||||
*/
|
||||
UAVDataObject* ManualControlSettings::clone(quint32 instID)
|
||||
{
|
||||
ManualControlSettings* obj = new ManualControlSettings();
|
||||
obj->initialize(instID, this->getMetaObject());
|
||||
return obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
ManualControlSettings* ManualControlSettings::GetInstance(UAVObjectManager* objMngr, quint32 instID)
|
||||
{
|
||||
return dynamic_cast<ManualControlSettings*>(objMngr->getObject(ManualControlSettings::OBJID, instID));
|
||||
}
|
110
ground/src/plugins/uavobjects/manualcontrolsettings.h
Normal file
110
ground/src/plugins/uavobjects/manualcontrolsettings.h
Normal file
@ -0,0 +1,110 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file manualcontrolsettings.h
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Implementation of the ManualControlSettings object. This file has been
|
||||
* automatically generated by the UAVObjectGenerator.
|
||||
*
|
||||
* @note Object definition file: manualcontrolsettings.xml.
|
||||
* This is an automatically generated file.
|
||||
* DO NOT modify manually.
|
||||
*
|
||||
* @see The GNU Public License (GPL) Version 3
|
||||
*
|
||||
*****************************************************************************/
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#ifndef MANUALCONTROLSETTINGS_H
|
||||
#define MANUALCONTROLSETTINGS_H
|
||||
|
||||
#include "uavdataobject.h"
|
||||
#include "uavobjectmanager.h"
|
||||
|
||||
class UAVOBJECTS_EXPORT ManualControlSettings: public UAVDataObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
// Field structure
|
||||
typedef struct {
|
||||
quint8 InputMode;
|
||||
quint8 Roll;
|
||||
quint8 Pitch;
|
||||
quint8 Yaw;
|
||||
quint8 Throttle;
|
||||
quint8 FlightMode;
|
||||
qint16 ChannelMax[8];
|
||||
qint16 ChannelNeutral[8];
|
||||
qint16 ChannelMin[8];
|
||||
|
||||
} __attribute__((packed)) DataFields;
|
||||
|
||||
// Field information
|
||||
// Field InputMode information
|
||||
/* Enumeration options for field InputMode */
|
||||
typedef enum { INPUTMODE_PWM=0, INPUTMODE_PPM=1, INPUTMODE_SPEKTRUM=2, } InputModeOptions;
|
||||
// Field Roll information
|
||||
/* Enumeration options for field Roll */
|
||||
typedef enum { ROLL_CHANNEL1=0, ROLL_CHANNEL2=1, ROLL_CHANNEL3=2, ROLL_CHANNEL4=3, ROLL_CHANNEL5=4, ROLL_CHANNEL6=5, ROLL_CHANNEL7=6, ROLL_CHANNEL8=7, ROLL_NONE=8, } RollOptions;
|
||||
// Field Pitch information
|
||||
/* Enumeration options for field Pitch */
|
||||
typedef enum { PITCH_CHANNEL1=0, PITCH_CHANNEL2=1, PITCH_CHANNEL3=2, PITCH_CHANNEL4=3, PITCH_CHANNEL5=4, PITCH_CHANNEL6=5, PITCH_CHANNEL7=6, PITCH_CHANNEL8=7, PITCH_NONE=8, } PitchOptions;
|
||||
// Field Yaw information
|
||||
/* Enumeration options for field Yaw */
|
||||
typedef enum { YAW_CHANNEL1=0, YAW_CHANNEL2=1, YAW_CHANNEL3=2, YAW_CHANNEL4=3, YAW_CHANNEL5=4, YAW_CHANNEL6=5, YAW_CHANNEL7=6, YAW_CHANNEL8=7, YAW_NONE=8, } YawOptions;
|
||||
// Field Throttle information
|
||||
/* Enumeration options for field Throttle */
|
||||
typedef enum { THROTTLE_CHANNEL1=0, THROTTLE_CHANNEL2=1, THROTTLE_CHANNEL3=2, THROTTLE_CHANNEL4=3, THROTTLE_CHANNEL5=4, THROTTLE_CHANNEL6=5, THROTTLE_CHANNEL7=6, THROTTLE_CHANNEL8=7, THROTTLE_NONE=8, } ThrottleOptions;
|
||||
// Field FlightMode information
|
||||
/* Enumeration options for field FlightMode */
|
||||
typedef enum { FLIGHTMODE_CHANNEL1=0, FLIGHTMODE_CHANNEL2=1, FLIGHTMODE_CHANNEL3=2, FLIGHTMODE_CHANNEL4=3, FLIGHTMODE_CHANNEL5=4, FLIGHTMODE_CHANNEL6=5, FLIGHTMODE_CHANNEL7=6, FLIGHTMODE_CHANNEL8=7, FLIGHTMODE_NONE=8, } FlightModeOptions;
|
||||
// Field ChannelMax information
|
||||
/* Number of elements for field ChannelMax */
|
||||
static const quint32 CHANNELMAX_NUMELEM = 8;
|
||||
// Field ChannelNeutral information
|
||||
/* Number of elements for field ChannelNeutral */
|
||||
static const quint32 CHANNELNEUTRAL_NUMELEM = 8;
|
||||
// Field ChannelMin information
|
||||
/* Number of elements for field ChannelMin */
|
||||
static const quint32 CHANNELMIN_NUMELEM = 8;
|
||||
|
||||
|
||||
// Constants
|
||||
static const quint32 OBJID = 2933673028U;
|
||||
static const QString NAME;
|
||||
static const bool ISSINGLEINST = 1;
|
||||
static const bool ISSETTINGS = 1;
|
||||
static const quint32 NUMBYTES = sizeof(DataFields);
|
||||
|
||||
// Functions
|
||||
ManualControlSettings();
|
||||
|
||||
DataFields getData();
|
||||
void setData(const DataFields& data);
|
||||
Metadata getDefaultMetadata();
|
||||
UAVDataObject* clone(quint32 instID);
|
||||
|
||||
static ManualControlSettings* GetInstance(UAVObjectManager* objMngr, quint32 instID = 0);
|
||||
|
||||
private:
|
||||
DataFields data;
|
||||
|
||||
void setDefaultFieldValues();
|
||||
|
||||
};
|
||||
|
||||
#endif // MANUALCONTROLSETTINGS_H
|
235
ground/src/plugins/uavobjects/manualcontrolsettings.py
Normal file
235
ground/src/plugins/uavobjects/manualcontrolsettings.py
Normal file
@ -0,0 +1,235 @@
|
||||
##
|
||||
##############################################################################
|
||||
#
|
||||
# @file manualcontrolsettings.py
|
||||
# @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
# @brief Implementation of the ManualControlSettings object. This file has been
|
||||
# automatically generated by the UAVObjectGenerator.
|
||||
#
|
||||
# @note Object definition file: manualcontrolsettings.xml.
|
||||
# This is an automatically generated file.
|
||||
# DO NOT modify manually.
|
||||
#
|
||||
# @see The GNU Public License (GPL) Version 3
|
||||
#
|
||||
#############################################################################/
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
|
||||
import uavobject
|
||||
|
||||
import struct
|
||||
from collections import namedtuple
|
||||
|
||||
# This is a list of instances of the data fields contained in this object
|
||||
_fields = [ \
|
||||
uavobject.UAVObjectField(
|
||||
'InputMode',
|
||||
'b',
|
||||
1,
|
||||
[
|
||||
'0',
|
||||
],
|
||||
{
|
||||
'0' : 'PWM',
|
||||
'1' : 'PPM',
|
||||
'2' : 'Spektrum',
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'Roll',
|
||||
'b',
|
||||
1,
|
||||
[
|
||||
'0',
|
||||
],
|
||||
{
|
||||
'0' : 'Channel1',
|
||||
'1' : 'Channel2',
|
||||
'2' : 'Channel3',
|
||||
'3' : 'Channel4',
|
||||
'4' : 'Channel5',
|
||||
'5' : 'Channel6',
|
||||
'6' : 'Channel7',
|
||||
'7' : 'Channel8',
|
||||
'8' : 'None',
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'Pitch',
|
||||
'b',
|
||||
1,
|
||||
[
|
||||
'0',
|
||||
],
|
||||
{
|
||||
'0' : 'Channel1',
|
||||
'1' : 'Channel2',
|
||||
'2' : 'Channel3',
|
||||
'3' : 'Channel4',
|
||||
'4' : 'Channel5',
|
||||
'5' : 'Channel6',
|
||||
'6' : 'Channel7',
|
||||
'7' : 'Channel8',
|
||||
'8' : 'None',
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'Yaw',
|
||||
'b',
|
||||
1,
|
||||
[
|
||||
'0',
|
||||
],
|
||||
{
|
||||
'0' : 'Channel1',
|
||||
'1' : 'Channel2',
|
||||
'2' : 'Channel3',
|
||||
'3' : 'Channel4',
|
||||
'4' : 'Channel5',
|
||||
'5' : 'Channel6',
|
||||
'6' : 'Channel7',
|
||||
'7' : 'Channel8',
|
||||
'8' : 'None',
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'Throttle',
|
||||
'b',
|
||||
1,
|
||||
[
|
||||
'0',
|
||||
],
|
||||
{
|
||||
'0' : 'Channel1',
|
||||
'1' : 'Channel2',
|
||||
'2' : 'Channel3',
|
||||
'3' : 'Channel4',
|
||||
'4' : 'Channel5',
|
||||
'5' : 'Channel6',
|
||||
'6' : 'Channel7',
|
||||
'7' : 'Channel8',
|
||||
'8' : 'None',
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'FlightMode',
|
||||
'b',
|
||||
1,
|
||||
[
|
||||
'0',
|
||||
],
|
||||
{
|
||||
'0' : 'Channel1',
|
||||
'1' : 'Channel2',
|
||||
'2' : 'Channel3',
|
||||
'3' : 'Channel4',
|
||||
'4' : 'Channel5',
|
||||
'5' : 'Channel6',
|
||||
'6' : 'Channel7',
|
||||
'7' : 'Channel8',
|
||||
'8' : 'None',
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'ChannelMax',
|
||||
'h',
|
||||
8,
|
||||
[
|
||||
'0',
|
||||
'1',
|
||||
'2',
|
||||
'3',
|
||||
'4',
|
||||
'5',
|
||||
'6',
|
||||
'7',
|
||||
],
|
||||
{
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'ChannelNeutral',
|
||||
'h',
|
||||
8,
|
||||
[
|
||||
'0',
|
||||
'1',
|
||||
'2',
|
||||
'3',
|
||||
'4',
|
||||
'5',
|
||||
'6',
|
||||
'7',
|
||||
],
|
||||
{
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'ChannelMin',
|
||||
'h',
|
||||
8,
|
||||
[
|
||||
'0',
|
||||
'1',
|
||||
'2',
|
||||
'3',
|
||||
'4',
|
||||
'5',
|
||||
'6',
|
||||
'7',
|
||||
],
|
||||
{
|
||||
}
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
class ManualControlSettings(uavobject.UAVObject):
|
||||
## Object constants
|
||||
OBJID = 2933673028
|
||||
NAME = "ManualControlSettings"
|
||||
METANAME = "ManualControlSettingsMeta"
|
||||
ISSINGLEINST = 1
|
||||
ISSETTINGS = 1
|
||||
|
||||
def __init__(self):
|
||||
uavobject.UAVObject.__init__(self,
|
||||
self.OBJID,
|
||||
self.NAME,
|
||||
self.METANAME,
|
||||
0,
|
||||
self.ISSINGLEINST)
|
||||
|
||||
for f in _fields:
|
||||
self.add_field(f)
|
||||
|
||||
def __str__(self):
|
||||
s = ("0x%08X (%10u) %-30s %3u bytes format '%s'\n"
|
||||
% (self.OBJID, self.OBJID, self.NAME, self.get_struct().size, self.get_struct().format))
|
||||
for f in self.get_tuple()._fields:
|
||||
s += ("\t%s\n" % f)
|
||||
return (s)
|
||||
|
||||
def main():
|
||||
# Instantiate the object and dump out some interesting info
|
||||
x = ManualControlSettings()
|
||||
print (x)
|
||||
|
||||
if __name__ == "__main__":
|
||||
#import pdb ; pdb.run('main()')
|
||||
main()
|
127
ground/src/plugins/uavobjects/stabilizationsettings.cpp
Normal file
127
ground/src/plugins/uavobjects/stabilizationsettings.cpp
Normal file
@ -0,0 +1,127 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file stabilizationsettings.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Implementation of the StabilizationSettings object. This file has been
|
||||
* automatically generated by the UAVObjectGenerator.
|
||||
*
|
||||
* @note Object definition file: stabilizationsettings.xml.
|
||||
* This is an automatically generated file.
|
||||
* DO NOT modify manually.
|
||||
*
|
||||
* @see The GNU Public License (GPL) Version 3
|
||||
*
|
||||
*****************************************************************************/
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include "stabilizationsettings.h"
|
||||
#include "uavobjectfield.h"
|
||||
|
||||
const QString StabilizationSettings::NAME = QString("StabilizationSettings");
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
StabilizationSettings::StabilizationSettings(): UAVDataObject(OBJID, ISSINGLEINST, ISSETTINGS, NAME)
|
||||
{
|
||||
// Create fields
|
||||
QList<UAVObjectField*> fields;
|
||||
QStringList RollMaxElemNames;
|
||||
RollMaxElemNames.append("0");
|
||||
fields.append( new UAVObjectField(QString("RollMax"), QString("degrees"), UAVObjectField::FLOAT32, RollMaxElemNames, QStringList()) );
|
||||
QStringList PitchMaxElemNames;
|
||||
PitchMaxElemNames.append("0");
|
||||
fields.append( new UAVObjectField(QString("PitchMax"), QString("degrees"), UAVObjectField::FLOAT32, PitchMaxElemNames, QStringList()) );
|
||||
QStringList ThrottleMaxElemNames;
|
||||
ThrottleMaxElemNames.append("0");
|
||||
fields.append( new UAVObjectField(QString("ThrottleMax"), QString("%"), UAVObjectField::FLOAT32, ThrottleMaxElemNames, QStringList()) );
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, (quint8*)&data, NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the default metadata for this object
|
||||
*/
|
||||
UAVObject::Metadata StabilizationSettings::getDefaultMetadata()
|
||||
{
|
||||
UAVObject::Metadata metadata;
|
||||
metadata.gcsTelemetryAcked = 1;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject::UPDATEMODE_ONCHANGE;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
metadata.flightTelemetryAcked = 1;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject::UPDATEMODE_ONCHANGE;
|
||||
metadata.flightTelemetryUpdatePeriod = 0;
|
||||
metadata.loggingUpdateMode = UAVObject::UPDATEMODE_NEVER;
|
||||
metadata.loggingUpdatePeriod = 0;
|
||||
return metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize object fields with the default values.
|
||||
* If a default value is not specified the object fields
|
||||
* will be initialized to zero.
|
||||
*/
|
||||
void StabilizationSettings::setDefaultFieldValues()
|
||||
{
|
||||
data.RollMax = 35;
|
||||
data.PitchMax = 35;
|
||||
data.ThrottleMax = 100;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the object data fields
|
||||
*/
|
||||
StabilizationSettings::DataFields StabilizationSettings::getData()
|
||||
{
|
||||
QMutexLocker locker(mutex);
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the object data fields
|
||||
*/
|
||||
void StabilizationSettings::setData(const DataFields& data)
|
||||
{
|
||||
QMutexLocker locker(mutex);
|
||||
this->data = data;
|
||||
emit objectUpdatedAuto(this); // trigger object updated event
|
||||
emit objectUpdated(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a clone of this object, a new instance ID must be specified.
|
||||
* Do not use this function directly to create new instances, the
|
||||
* UAVObjectManager should be used instead.
|
||||
*/
|
||||
UAVDataObject* StabilizationSettings::clone(quint32 instID)
|
||||
{
|
||||
StabilizationSettings* obj = new StabilizationSettings();
|
||||
obj->initialize(instID, this->getMetaObject());
|
||||
return obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
StabilizationSettings* StabilizationSettings::GetInstance(UAVObjectManager* objMngr, quint32 instID)
|
||||
{
|
||||
return dynamic_cast<StabilizationSettings*>(objMngr->getObject(StabilizationSettings::OBJID, instID));
|
||||
}
|
80
ground/src/plugins/uavobjects/stabilizationsettings.h
Normal file
80
ground/src/plugins/uavobjects/stabilizationsettings.h
Normal file
@ -0,0 +1,80 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file stabilizationsettings.h
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Implementation of the StabilizationSettings object. This file has been
|
||||
* automatically generated by the UAVObjectGenerator.
|
||||
*
|
||||
* @note Object definition file: stabilizationsettings.xml.
|
||||
* This is an automatically generated file.
|
||||
* DO NOT modify manually.
|
||||
*
|
||||
* @see The GNU Public License (GPL) Version 3
|
||||
*
|
||||
*****************************************************************************/
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#ifndef STABILIZATIONSETTINGS_H
|
||||
#define STABILIZATIONSETTINGS_H
|
||||
|
||||
#include "uavdataobject.h"
|
||||
#include "uavobjectmanager.h"
|
||||
|
||||
class UAVOBJECTS_EXPORT StabilizationSettings: public UAVDataObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
// Field structure
|
||||
typedef struct {
|
||||
float RollMax;
|
||||
float PitchMax;
|
||||
float ThrottleMax;
|
||||
|
||||
} __attribute__((packed)) DataFields;
|
||||
|
||||
// Field information
|
||||
// Field RollMax information
|
||||
// Field PitchMax information
|
||||
// Field ThrottleMax information
|
||||
|
||||
|
||||
// Constants
|
||||
static const quint32 OBJID = 1855169608U;
|
||||
static const QString NAME;
|
||||
static const bool ISSINGLEINST = 1;
|
||||
static const bool ISSETTINGS = 1;
|
||||
static const quint32 NUMBYTES = sizeof(DataFields);
|
||||
|
||||
// Functions
|
||||
StabilizationSettings();
|
||||
|
||||
DataFields getData();
|
||||
void setData(const DataFields& data);
|
||||
Metadata getDefaultMetadata();
|
||||
UAVDataObject* clone(quint32 instID);
|
||||
|
||||
static StabilizationSettings* GetInstance(UAVObjectManager* objMngr, quint32 instID = 0);
|
||||
|
||||
private:
|
||||
DataFields data;
|
||||
|
||||
void setDefaultFieldValues();
|
||||
|
||||
};
|
||||
|
||||
#endif // STABILIZATIONSETTINGS_H
|
106
ground/src/plugins/uavobjects/stabilizationsettings.py
Normal file
106
ground/src/plugins/uavobjects/stabilizationsettings.py
Normal file
@ -0,0 +1,106 @@
|
||||
##
|
||||
##############################################################################
|
||||
#
|
||||
# @file stabilizationsettings.py
|
||||
# @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
# @brief Implementation of the StabilizationSettings object. This file has been
|
||||
# automatically generated by the UAVObjectGenerator.
|
||||
#
|
||||
# @note Object definition file: stabilizationsettings.xml.
|
||||
# This is an automatically generated file.
|
||||
# DO NOT modify manually.
|
||||
#
|
||||
# @see The GNU Public License (GPL) Version 3
|
||||
#
|
||||
#############################################################################/
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
|
||||
import uavobject
|
||||
|
||||
import struct
|
||||
from collections import namedtuple
|
||||
|
||||
# This is a list of instances of the data fields contained in this object
|
||||
_fields = [ \
|
||||
uavobject.UAVObjectField(
|
||||
'RollMax',
|
||||
'f',
|
||||
1,
|
||||
[
|
||||
'0',
|
||||
],
|
||||
{
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'PitchMax',
|
||||
'f',
|
||||
1,
|
||||
[
|
||||
'0',
|
||||
],
|
||||
{
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
'ThrottleMax',
|
||||
'f',
|
||||
1,
|
||||
[
|
||||
'0',
|
||||
],
|
||||
{
|
||||
}
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
class StabilizationSettings(uavobject.UAVObject):
|
||||
## Object constants
|
||||
OBJID = 1855169608
|
||||
NAME = "StabilizationSettings"
|
||||
METANAME = "StabilizationSettingsMeta"
|
||||
ISSINGLEINST = 1
|
||||
ISSETTINGS = 1
|
||||
|
||||
def __init__(self):
|
||||
uavobject.UAVObject.__init__(self,
|
||||
self.OBJID,
|
||||
self.NAME,
|
||||
self.METANAME,
|
||||
0,
|
||||
self.ISSINGLEINST)
|
||||
|
||||
for f in _fields:
|
||||
self.add_field(f)
|
||||
|
||||
def __str__(self):
|
||||
s = ("0x%08X (%10u) %-30s %3u bytes format '%s'\n"
|
||||
% (self.OBJID, self.OBJID, self.NAME, self.get_struct().size, self.get_struct().format))
|
||||
for f in self.get_tuple()._fields:
|
||||
s += ("\t%s\n" % f)
|
||||
return (s)
|
||||
|
||||
def main():
|
||||
# Instantiate the object and dump out some interesting info
|
||||
x = StabilizationSettings()
|
||||
print (x)
|
||||
|
||||
if __name__ == "__main__":
|
||||
#import pdb ; pdb.run('main()')
|
||||
main()
|
@ -47,6 +47,8 @@ SystemAlarms::SystemAlarms(): UAVDataObject(OBJID, ISSINGLEINST, ISSETTINGS, NAM
|
||||
AlarmElemNames.append("EventSystem");
|
||||
AlarmElemNames.append("SDCard");
|
||||
AlarmElemNames.append("Telemetry");
|
||||
AlarmElemNames.append("ManualControl");
|
||||
AlarmElemNames.append("Actuator");
|
||||
QStringList AlarmEnumOptions;
|
||||
AlarmEnumOptions.append("OK");
|
||||
AlarmEnumOptions.append("Warning");
|
||||
|
@ -41,7 +41,7 @@ class UAVOBJECTS_EXPORT SystemAlarms: public UAVDataObject
|
||||
public:
|
||||
// Field structure
|
||||
typedef struct {
|
||||
quint8 Alarm[6];
|
||||
quint8 Alarm[8];
|
||||
|
||||
} __attribute__((packed)) DataFields;
|
||||
|
||||
@ -50,13 +50,13 @@ public:
|
||||
/* Enumeration options for field Alarm */
|
||||
typedef enum { ALARM_OK=0, ALARM_WARNING=1, ALARM_ERROR=2, ALARM_CRITICAL=3, } AlarmOptions;
|
||||
/* Array element names for field Alarm */
|
||||
typedef enum { ALARM_OUTOFMEMORY=0, ALARM_STACKOVERFLOW=1, ALARM_CPUOVERLOAD=2, ALARM_EVENTSYSTEM=3, ALARM_SDCARD=4, ALARM_TELEMETRY=5, } AlarmElem;
|
||||
typedef enum { ALARM_OUTOFMEMORY=0, ALARM_STACKOVERFLOW=1, ALARM_CPUOVERLOAD=2, ALARM_EVENTSYSTEM=3, ALARM_SDCARD=4, ALARM_TELEMETRY=5, ALARM_MANUALCONTROL=6, ALARM_ACTUATOR=7, } AlarmElem;
|
||||
/* Number of elements for field Alarm */
|
||||
static const quint32 ALARM_NUMELEM = 6;
|
||||
static const quint32 ALARM_NUMELEM = 8;
|
||||
|
||||
|
||||
// Constants
|
||||
static const quint32 OBJID = 2311311458U;
|
||||
static const quint32 OBJID = 2311311520U;
|
||||
static const QString NAME;
|
||||
static const bool ISSINGLEINST = 1;
|
||||
static const bool ISSETTINGS = 0;
|
||||
|
@ -40,7 +40,7 @@ _fields = [ \
|
||||
uavobject.UAVObjectField(
|
||||
'Alarm',
|
||||
'b',
|
||||
6,
|
||||
8,
|
||||
[
|
||||
'OutOfMemory',
|
||||
'StackOverflow',
|
||||
@ -48,6 +48,8 @@ _fields = [ \
|
||||
'EventSystem',
|
||||
'SDCard',
|
||||
'Telemetry',
|
||||
'ManualControl',
|
||||
'Actuator',
|
||||
],
|
||||
{
|
||||
'0' : 'OK',
|
||||
@ -61,7 +63,7 @@ _fields = [ \
|
||||
|
||||
class SystemAlarms(uavobject.UAVObject):
|
||||
## Object constants
|
||||
OBJID = 2311311458
|
||||
OBJID = 2311311520
|
||||
NAME = "SystemAlarms"
|
||||
METANAME = "SystemAlarmsMeta"
|
||||
ISSINGLEINST = 1
|
||||
|
123
ground/src/plugins/uavobjects/systemsettings.cpp
Normal file
123
ground/src/plugins/uavobjects/systemsettings.cpp
Normal file
@ -0,0 +1,123 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file systemsettings.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Implementation of the SystemSettings object. This file has been
|
||||
* automatically generated by the UAVObjectGenerator.
|
||||
*
|
||||
* @note Object definition file: systemsettings.xml.
|
||||
* This is an automatically generated file.
|
||||
* DO NOT modify manually.
|
||||
*
|
||||
* @see The GNU Public License (GPL) Version 3
|
||||
*
|
||||
*****************************************************************************/
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include "systemsettings.h"
|
||||
#include "uavobjectfield.h"
|
||||
|
||||
const QString SystemSettings::NAME = QString("SystemSettings");
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
SystemSettings::SystemSettings(): UAVDataObject(OBJID, ISSINGLEINST, ISSETTINGS, NAME)
|
||||
{
|
||||
// Create fields
|
||||
QList<UAVObjectField*> fields;
|
||||
QStringList AirframeTypeElemNames;
|
||||
AirframeTypeElemNames.append("0");
|
||||
QStringList AirframeTypeEnumOptions;
|
||||
AirframeTypeEnumOptions.append("FixedWing");
|
||||
AirframeTypeEnumOptions.append("FixedWingElevon");
|
||||
AirframeTypeEnumOptions.append("VTOL");
|
||||
fields.append( new UAVObjectField(QString("AirframeType"), QString(""), UAVObjectField::ENUM, AirframeTypeElemNames, AirframeTypeEnumOptions) );
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, (quint8*)&data, NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the default metadata for this object
|
||||
*/
|
||||
UAVObject::Metadata SystemSettings::getDefaultMetadata()
|
||||
{
|
||||
UAVObject::Metadata metadata;
|
||||
metadata.gcsTelemetryAcked = 1;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject::UPDATEMODE_ONCHANGE;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
metadata.flightTelemetryAcked = 1;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject::UPDATEMODE_ONCHANGE;
|
||||
metadata.flightTelemetryUpdatePeriod = 0;
|
||||
metadata.loggingUpdateMode = UAVObject::UPDATEMODE_NEVER;
|
||||
metadata.loggingUpdatePeriod = 0;
|
||||
return metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize object fields with the default values.
|
||||
* If a default value is not specified the object fields
|
||||
* will be initialized to zero.
|
||||
*/
|
||||
void SystemSettings::setDefaultFieldValues()
|
||||
{
|
||||
data.AirframeType = 0;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the object data fields
|
||||
*/
|
||||
SystemSettings::DataFields SystemSettings::getData()
|
||||
{
|
||||
QMutexLocker locker(mutex);
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the object data fields
|
||||
*/
|
||||
void SystemSettings::setData(const DataFields& data)
|
||||
{
|
||||
QMutexLocker locker(mutex);
|
||||
this->data = data;
|
||||
emit objectUpdatedAuto(this); // trigger object updated event
|
||||
emit objectUpdated(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a clone of this object, a new instance ID must be specified.
|
||||
* Do not use this function directly to create new instances, the
|
||||
* UAVObjectManager should be used instead.
|
||||
*/
|
||||
UAVDataObject* SystemSettings::clone(quint32 instID)
|
||||
{
|
||||
SystemSettings* obj = new SystemSettings();
|
||||
obj->initialize(instID, this->getMetaObject());
|
||||
return obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
SystemSettings* SystemSettings::GetInstance(UAVObjectManager* objMngr, quint32 instID)
|
||||
{
|
||||
return dynamic_cast<SystemSettings*>(objMngr->getObject(SystemSettings::OBJID, instID));
|
||||
}
|
78
ground/src/plugins/uavobjects/systemsettings.h
Normal file
78
ground/src/plugins/uavobjects/systemsettings.h
Normal file
@ -0,0 +1,78 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file systemsettings.h
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Implementation of the SystemSettings object. This file has been
|
||||
* automatically generated by the UAVObjectGenerator.
|
||||
*
|
||||
* @note Object definition file: systemsettings.xml.
|
||||
* This is an automatically generated file.
|
||||
* DO NOT modify manually.
|
||||
*
|
||||
* @see The GNU Public License (GPL) Version 3
|
||||
*
|
||||
*****************************************************************************/
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#ifndef SYSTEMSETTINGS_H
|
||||
#define SYSTEMSETTINGS_H
|
||||
|
||||
#include "uavdataobject.h"
|
||||
#include "uavobjectmanager.h"
|
||||
|
||||
class UAVOBJECTS_EXPORT SystemSettings: public UAVDataObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
// Field structure
|
||||
typedef struct {
|
||||
quint8 AirframeType;
|
||||
|
||||
} __attribute__((packed)) DataFields;
|
||||
|
||||
// Field information
|
||||
// Field AirframeType information
|
||||
/* Enumeration options for field AirframeType */
|
||||
typedef enum { AIRFRAMETYPE_FIXEDWING=0, AIRFRAMETYPE_FIXEDWINGELEVON=1, AIRFRAMETYPE_VTOL=2, } AirframeTypeOptions;
|
||||
|
||||
|
||||
// Constants
|
||||
static const quint32 OBJID = 59202798U;
|
||||
static const QString NAME;
|
||||
static const bool ISSINGLEINST = 1;
|
||||
static const bool ISSETTINGS = 1;
|
||||
static const quint32 NUMBYTES = sizeof(DataFields);
|
||||
|
||||
// Functions
|
||||
SystemSettings();
|
||||
|
||||
DataFields getData();
|
||||
void setData(const DataFields& data);
|
||||
Metadata getDefaultMetadata();
|
||||
UAVDataObject* clone(quint32 instID);
|
||||
|
||||
static SystemSettings* GetInstance(UAVObjectManager* objMngr, quint32 instID = 0);
|
||||
|
||||
private:
|
||||
DataFields data;
|
||||
|
||||
void setDefaultFieldValues();
|
||||
|
||||
};
|
||||
|
||||
#endif // SYSTEMSETTINGS_H
|
89
ground/src/plugins/uavobjects/systemsettings.py
Normal file
89
ground/src/plugins/uavobjects/systemsettings.py
Normal file
@ -0,0 +1,89 @@
|
||||
##
|
||||
##############################################################################
|
||||
#
|
||||
# @file systemsettings.py
|
||||
# @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
# @brief Implementation of the SystemSettings object. This file has been
|
||||
# automatically generated by the UAVObjectGenerator.
|
||||
#
|
||||
# @note Object definition file: systemsettings.xml.
|
||||
# This is an automatically generated file.
|
||||
# DO NOT modify manually.
|
||||
#
|
||||
# @see The GNU Public License (GPL) Version 3
|
||||
#
|
||||
#############################################################################/
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
|
||||
import uavobject
|
||||
|
||||
import struct
|
||||
from collections import namedtuple
|
||||
|
||||
# This is a list of instances of the data fields contained in this object
|
||||
_fields = [ \
|
||||
uavobject.UAVObjectField(
|
||||
'AirframeType',
|
||||
'b',
|
||||
1,
|
||||
[
|
||||
'0',
|
||||
],
|
||||
{
|
||||
'0' : 'FixedWing',
|
||||
'1' : 'FixedWingElevon',
|
||||
'2' : 'VTOL',
|
||||
}
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
class SystemSettings(uavobject.UAVObject):
|
||||
## Object constants
|
||||
OBJID = 59202798
|
||||
NAME = "SystemSettings"
|
||||
METANAME = "SystemSettingsMeta"
|
||||
ISSINGLEINST = 1
|
||||
ISSETTINGS = 1
|
||||
|
||||
def __init__(self):
|
||||
uavobject.UAVObject.__init__(self,
|
||||
self.OBJID,
|
||||
self.NAME,
|
||||
self.METANAME,
|
||||
0,
|
||||
self.ISSINGLEINST)
|
||||
|
||||
for f in _fields:
|
||||
self.add_field(f)
|
||||
|
||||
def __str__(self):
|
||||
s = ("0x%08X (%10u) %-30s %3u bytes format '%s'\n"
|
||||
% (self.OBJID, self.OBJID, self.NAME, self.get_struct().size, self.get_struct().format))
|
||||
for f in self.get_tuple()._fields:
|
||||
s += ("\t%s\n" % f)
|
||||
return (s)
|
||||
|
||||
def main():
|
||||
# Instantiate the object and dump out some interesting info
|
||||
x = SystemSettings()
|
||||
print (x)
|
||||
|
||||
if __name__ == "__main__":
|
||||
#import pdb ; pdb.run('main()')
|
||||
main()
|
@ -19,7 +19,15 @@ HEADERS += uavobjects_global.h \
|
||||
systemstats.h \
|
||||
systemalarms.h \
|
||||
objectpersistence.h \
|
||||
telemetrysettings.h
|
||||
telemetrysettings.h \
|
||||
systemsettings.h \
|
||||
stabilizationsettings.h \
|
||||
manualcontrolsettings.h \
|
||||
manualcontrolcommand.h \
|
||||
attitudedesired.h \
|
||||
actuatorsettings.h \
|
||||
actuatordesired.h \
|
||||
actuatorcommand.h
|
||||
SOURCES += uavobject.cpp \
|
||||
uavmetaobject.cpp \
|
||||
uavobjectmanager.cpp \
|
||||
@ -36,6 +44,14 @@ SOURCES += uavobject.cpp \
|
||||
systemstats.cpp \
|
||||
systemalarms.cpp \
|
||||
objectpersistence.cpp \
|
||||
telemetrysettings.cpp
|
||||
telemetrysettings.cpp \
|
||||
systemsettings.cpp \
|
||||
stabilizationsettings.cpp \
|
||||
manualcontrolsettings.cpp \
|
||||
manualcontrolcommand.cpp \
|
||||
attitudedesired.cpp \
|
||||
actuatorsettings.cpp \
|
||||
actuatordesired.cpp \
|
||||
actuatorcommand.cpp
|
||||
DEFINES += UAVOBJECTS_LIBRARY
|
||||
OTHER_FILES += UAVObjects.pluginspec
|
||||
|
@ -30,14 +30,22 @@
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include "uavobjectsinit.h"
|
||||
#include "actuatorcommand.h"
|
||||
#include "actuatordesired.h"
|
||||
#include "actuatorsettings.h"
|
||||
#include "attitudedesired.h"
|
||||
#include "exampleobject1.h"
|
||||
#include "exampleobject2.h"
|
||||
#include "examplesettings.h"
|
||||
#include "flighttelemetrystats.h"
|
||||
#include "gcstelemetrystats.h"
|
||||
#include "gpsobject.h"
|
||||
#include "manualcontrolcommand.h"
|
||||
#include "manualcontrolsettings.h"
|
||||
#include "objectpersistence.h"
|
||||
#include "stabilizationsettings.h"
|
||||
#include "systemalarms.h"
|
||||
#include "systemsettings.h"
|
||||
#include "systemstats.h"
|
||||
#include "telemetrysettings.h"
|
||||
|
||||
@ -48,14 +56,22 @@
|
||||
*/
|
||||
void UAVObjectsInitialize(UAVObjectManager* objMngr)
|
||||
{
|
||||
objMngr->registerObject( new ActuatorCommand() );
|
||||
objMngr->registerObject( new ActuatorDesired() );
|
||||
objMngr->registerObject( new ActuatorSettings() );
|
||||
objMngr->registerObject( new AttitudeDesired() );
|
||||
objMngr->registerObject( new ExampleObject1() );
|
||||
objMngr->registerObject( new ExampleObject2() );
|
||||
objMngr->registerObject( new ExampleSettings() );
|
||||
objMngr->registerObject( new FlightTelemetryStats() );
|
||||
objMngr->registerObject( new GCSTelemetryStats() );
|
||||
objMngr->registerObject( new GpsObject() );
|
||||
objMngr->registerObject( new ManualControlCommand() );
|
||||
objMngr->registerObject( new ManualControlSettings() );
|
||||
objMngr->registerObject( new ObjectPersistence() );
|
||||
objMngr->registerObject( new StabilizationSettings() );
|
||||
objMngr->registerObject( new SystemAlarms() );
|
||||
objMngr->registerObject( new SystemSettings() );
|
||||
objMngr->registerObject( new SystemStats() );
|
||||
objMngr->registerObject( new TelemetrySettings() );
|
||||
|
||||
|
@ -0,0 +1,8 @@
|
||||
<xml>
|
||||
<object name="ActuatorCommand" singleinstance="true" settings="false">
|
||||
<field name="Channel" units="us" type="int16" elements="8"/>
|
||||
<telemetrygcs acked="true" updatemode="manual" period="0"/>
|
||||
<telemetryflight acked="true" updatemode="periodic" period="1000"/>
|
||||
<logging updatemode="never" period="0"/>
|
||||
</object>
|
||||
</xml>
|
11
ground/src/shared/uavobjectdefinition/actuatordesired.xml
Normal file
11
ground/src/shared/uavobjectdefinition/actuatordesired.xml
Normal file
@ -0,0 +1,11 @@
|
||||
<xml>
|
||||
<object name="ActuatorDesired" singleinstance="true" settings="false">
|
||||
<field name="Roll" units="%" type="float" elements="1"/>
|
||||
<field name="Pitch" units="%" type="float" elements="1"/>
|
||||
<field name="Yaw" units="%" type="float" elements="1"/>
|
||||
<field name="Throttle" units="%" type="float" elements="1"/>
|
||||
<telemetrygcs acked="true" updatemode="manual" period="0"/>
|
||||
<telemetryflight acked="true" updatemode="periodic" period="1000"/>
|
||||
<logging updatemode="never" period="0"/>
|
||||
</object>
|
||||
</xml>
|
25
ground/src/shared/uavobjectdefinition/actuatorsettings.xml
Normal file
25
ground/src/shared/uavobjectdefinition/actuatorsettings.xml
Normal file
@ -0,0 +1,25 @@
|
||||
<xml>
|
||||
<object name="ActuatorSettings" singleinstance="true" settings="true">
|
||||
<field name="FixedWingRoll1" units="channel" type="enum" elements="1" options="Channel1,Channel2,Channel3,Channel4,Channel5,Channel6,Channel7,Channel8,None" defaultvalue="None"/>
|
||||
<field name="FixedWingRoll2" units="channel" type="enum" elements="1" options="Channel1,Channel2,Channel3,Channel4,Channel5,Channel6,Channel7,Channel8,None" defaultvalue="None"/>
|
||||
<field name="FixedWingPitch1" units="channel" type="enum" elements="1" options="Channel1,Channel2,Channel3,Channel4,Channel5,Channel6,Channel7,Channel8,None" defaultvalue="None"/>
|
||||
<field name="FixedWingPitch2" units="channel" type="enum" elements="1" options="Channel1,Channel2,Channel3,Channel4,Channel5,Channel6,Channel7,Channel8,None" defaultvalue="None"/>
|
||||
<field name="FixedWingYaw" units="channel" type="enum" elements="1" options="Channel1,Channel2,Channel3,Channel4,Channel5,Channel6,Channel7,Channel8,None" defaultvalue="None"/>
|
||||
<field name="FixedWingThrottle" units="channel" type="enum" elements="1" options="Channel1,Channel2,Channel3,Channel4,Channel5,Channel6,Channel7,Channel8,None" defaultvalue="None"/>
|
||||
<field name="VTOLMotorN" units="channel" type="enum" elements="1" options="Channel1,Channel2,Channel3,Channel4,Channel5,Channel6,Channel7,Channel8,None" defaultvalue="None"/>
|
||||
<field name="VTOLMotorNE" units="channel" type="enum" elements="1" options="Channel1,Channel2,Channel3,Channel4,Channel5,Channel6,Channel7,Channel8,None" defaultvalue="None"/>
|
||||
<field name="VTOLMotorE" units="channel" type="enum" elements="1" options="Channel1,Channel2,Channel3,Channel4,Channel5,Channel6,Channel7,Channel8,None" defaultvalue="None"/>
|
||||
<field name="VTOLMotorSE" units="channel" type="enum" elements="1" options="Channel1,Channel2,Channel3,Channel4,Channel5,Channel6,Channel7,Channel8,None" defaultvalue="None"/>
|
||||
<field name="VTOLMotorS" units="channel" type="enum" elements="1" options="Channel1,Channel2,Channel3,Channel4,Channel5,Channel6,Channel7,Channel8,None" defaultvalue="None"/>
|
||||
<field name="VTOLMotorSW" units="channel" type="enum" elements="1" options="Channel1,Channel2,Channel3,Channel4,Channel5,Channel6,Channel7,Channel8,None" defaultvalue="None"/>
|
||||
<field name="VTOLMotorW" units="channel" type="enum" elements="1" options="Channel1,Channel2,Channel3,Channel4,Channel5,Channel6,Channel7,Channel8,None" defaultvalue="None"/>
|
||||
<field name="VTOLMotorNW" units="channel" type="enum" elements="1" options="Channel1,Channel2,Channel3,Channel4,Channel5,Channel6,Channel7,Channel8,None" defaultvalue="None"/>
|
||||
<field name="ChannelUpdateFreq" units="Hz" type="int16" elements="2" defaultvalue="50"/>
|
||||
<field name="ChannelMax" units="us" type="int16" elements="8" defaultvalue="2000"/>
|
||||
<field name="ChannelNeutral" units="us" type="int16" elements="8" defaultvalue="1500"/>
|
||||
<field name="ChannelMin" units="us" type="int16" elements="8" defaultvalue="1000"/>
|
||||
<telemetrygcs acked="true" updatemode="onchange" period="0"/>
|
||||
<telemetryflight acked="true" updatemode="onchange" period="0"/>
|
||||
<logging updatemode="never" period="0"/>
|
||||
</object>
|
||||
</xml>
|
11
ground/src/shared/uavobjectdefinition/attitudedesired.xml
Normal file
11
ground/src/shared/uavobjectdefinition/attitudedesired.xml
Normal file
@ -0,0 +1,11 @@
|
||||
<xml>
|
||||
<object name="AttitudeDesired" singleinstance="true" settings="false">
|
||||
<field name="Roll" units="degrees" type="float" elements="1"/>
|
||||
<field name="Pitch" units="degrees" type="float" elements="1"/>
|
||||
<field name="Yaw" units="degrees" type="float" elements="1"/>
|
||||
<field name="Throttle" units="%" type="float" elements="1"/>
|
||||
<telemetrygcs acked="true" updatemode="manual" period="0"/>
|
||||
<telemetryflight acked="true" updatemode="periodic" period="1000"/>
|
||||
<logging updatemode="never" period="0"/>
|
||||
</object>
|
||||
</xml>
|
@ -0,0 +1,14 @@
|
||||
<xml>
|
||||
<object name="ManualControlCommand" singleinstance="true" settings="false">
|
||||
<field name="Connected" units="" type="enum" elements="1" options="False,True"/>
|
||||
<field name="Roll" units="%" type="float" elements="1"/>
|
||||
<field name="Pitch" units="%" type="float" elements="1"/>
|
||||
<field name="Yaw" units="%" type="float" elements="1"/>
|
||||
<field name="Throttle" units="%" type="float" elements="1"/>
|
||||
<field name="FlightMode" units="" type="enum" elements="1" options="Manual,Stabilized,Auto"/>
|
||||
<field name="Channel" units="us" type="int16" elements="8"/>
|
||||
<telemetrygcs acked="true" updatemode="manual" period="0"/>
|
||||
<telemetryflight acked="true" updatemode="periodic" period="3000"/>
|
||||
<logging updatemode="never" period="0"/>
|
||||
</object>
|
||||
</xml>
|
@ -0,0 +1,16 @@
|
||||
<xml>
|
||||
<object name="ManualControlSettings" singleinstance="true" settings="true">
|
||||
<field name="InputMode" units="" type="enum" elements="1" options="PWM,PPM,Spektrum" defaultvalue="PWM"/>
|
||||
<field name="Roll" units="channel" type="enum" elements="1" options="Channel1,Channel2,Channel3,Channel4,Channel5,Channel6,Channel7,Channel8,None" defaultvalue="Channel1"/>
|
||||
<field name="Pitch" units="channel" type="enum" elements="1" options="Channel1,Channel2,Channel3,Channel4,Channel5,Channel6,Channel7,Channel8,None" defaultvalue="Channel2"/>
|
||||
<field name="Yaw" units="channel" type="enum" elements="1" options="Channel1,Channel2,Channel3,Channel4,Channel5,Channel6,Channel7,Channel8,None" defaultvalue="Channel3"/>
|
||||
<field name="Throttle" units="channel" type="enum" elements="1" options="Channel1,Channel2,Channel3,Channel4,Channel5,Channel6,Channel7,Channel8,None" defaultvalue="Channel4"/>
|
||||
<field name="FlightMode" units="channel" type="enum" elements="1" options="Channel1,Channel2,Channel3,Channel4,Channel5,Channel6,Channel7,Channel8,None" defaultvalue="Channel5"/>
|
||||
<field name="ChannelMax" units="us" type="int16" elements="8" defaultvalue="2000"/>
|
||||
<field name="ChannelNeutral" units="us" type="int16" elements="8" defaultvalue="1500"/>
|
||||
<field name="ChannelMin" units="us" type="int16" elements="8" defaultvalue="1000"/>
|
||||
<telemetrygcs acked="true" updatemode="onchange" period="0"/>
|
||||
<telemetryflight acked="true" updatemode="onchange" period="0"/>
|
||||
<logging updatemode="never" period="0"/>
|
||||
</object>
|
||||
</xml>
|
@ -0,0 +1,10 @@
|
||||
<xml>
|
||||
<object name="StabilizationSettings" singleinstance="true" settings="true">
|
||||
<field name="RollMax" units="degrees" type="float" elements="1" defaultvalue="35"/>
|
||||
<field name="PitchMax" units="degrees" type="float" elements="1" defaultvalue="35"/>
|
||||
<field name="ThrottleMax" units="%" type="float" elements="1" defaultvalue="100.0"/>
|
||||
<telemetrygcs acked="true" updatemode="onchange" period="0"/>
|
||||
<telemetryflight acked="true" updatemode="onchange" period="0"/>
|
||||
<logging updatemode="never" period="0"/>
|
||||
</object>
|
||||
</xml>
|
@ -1,7 +1,7 @@
|
||||
<xml>
|
||||
<object name="SystemAlarms" singleinstance="true" settings="false">
|
||||
<field name="Alarm" units="" type="enum" options="OK,Warning,Error,Critical"
|
||||
elementnames="OutOfMemory,StackOverflow,CPUOverload,EventSystem,SDCard,Telemetry"/>
|
||||
elementnames="OutOfMemory,StackOverflow,CPUOverload,EventSystem,SDCard,Telemetry,ManualControl,Actuator"/>
|
||||
<telemetrygcs acked="true" updatemode="onchange" period="0"/>
|
||||
<telemetryflight acked="true" updatemode="periodic" period="4000"/>
|
||||
<logging updatemode="periodic" period="1000"/>
|
||||
|
8
ground/src/shared/uavobjectdefinition/systemsettings.xml
Normal file
8
ground/src/shared/uavobjectdefinition/systemsettings.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<xml>
|
||||
<object name="SystemSettings" singleinstance="true" settings="true">
|
||||
<field name="AirframeType" units="" type="enum" elements="1" options="FixedWing,FixedWingElevon,VTOL" defaultvalue="FixedWing"/>
|
||||
<telemetrygcs acked="true" updatemode="onchange" period="0"/>
|
||||
<telemetryflight acked="true" updatemode="onchange" period="0"/>
|
||||
<logging updatemode="never" period="0"/>
|
||||
</object>
|
||||
</xml>
|
Loading…
x
Reference in New Issue
Block a user