mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-17 02:52:12 +01:00
More updates to the java objects. Also checking in the auto generated code for
now to make things easier.
This commit is contained in:
parent
5220ddc201
commit
b98bdb9be0
@ -0,0 +1,243 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* Contains the calibration settings for the @ref AHRSCommsModule
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
Contains the calibration settings for the @ref AHRSCommsModule
|
||||
|
||||
generated from ahrscalibration.xml
|
||||
**/
|
||||
public class AHRSCalibration extends UAVDataObject {
|
||||
|
||||
public AHRSCalibration() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> measure_varElemNames = new ArrayList<String>();
|
||||
measure_varElemNames.add("0");
|
||||
List<String> measure_varEnumOptions = new ArrayList<String>();
|
||||
measure_varEnumOptions.add("SET");
|
||||
measure_varEnumOptions.add("MEASURE");
|
||||
fields.add( new UAVObjectField("measure_var", "", UAVObjectField.FieldType.ENUM, measure_varElemNames, measure_varEnumOptions) );
|
||||
|
||||
List<String> accel_biasElemNames = new ArrayList<String>();
|
||||
accel_biasElemNames.add("X");
|
||||
accel_biasElemNames.add("Y");
|
||||
accel_biasElemNames.add("Z");
|
||||
fields.add( new UAVObjectField("accel_bias", "m/s^2", UAVObjectField.FieldType.FLOAT32, accel_biasElemNames, null) );
|
||||
|
||||
List<String> accel_scaleElemNames = new ArrayList<String>();
|
||||
accel_scaleElemNames.add("X");
|
||||
accel_scaleElemNames.add("Y");
|
||||
accel_scaleElemNames.add("Z");
|
||||
fields.add( new UAVObjectField("accel_scale", "(m/s^2)/lsb", UAVObjectField.FieldType.FLOAT32, accel_scaleElemNames, null) );
|
||||
|
||||
List<String> accel_varElemNames = new ArrayList<String>();
|
||||
accel_varElemNames.add("X");
|
||||
accel_varElemNames.add("Y");
|
||||
accel_varElemNames.add("Z");
|
||||
fields.add( new UAVObjectField("accel_var", "(m/s^2)^2", UAVObjectField.FieldType.FLOAT32, accel_varElemNames, null) );
|
||||
|
||||
List<String> gyro_biasElemNames = new ArrayList<String>();
|
||||
gyro_biasElemNames.add("X");
|
||||
gyro_biasElemNames.add("Y");
|
||||
gyro_biasElemNames.add("Z");
|
||||
fields.add( new UAVObjectField("gyro_bias", "rad/s", UAVObjectField.FieldType.FLOAT32, gyro_biasElemNames, null) );
|
||||
|
||||
List<String> gyro_scaleElemNames = new ArrayList<String>();
|
||||
gyro_scaleElemNames.add("X");
|
||||
gyro_scaleElemNames.add("Y");
|
||||
gyro_scaleElemNames.add("Z");
|
||||
fields.add( new UAVObjectField("gyro_scale", "(rad/s)/lsb", UAVObjectField.FieldType.FLOAT32, gyro_scaleElemNames, null) );
|
||||
|
||||
List<String> gyro_varElemNames = new ArrayList<String>();
|
||||
gyro_varElemNames.add("X");
|
||||
gyro_varElemNames.add("Y");
|
||||
gyro_varElemNames.add("Z");
|
||||
fields.add( new UAVObjectField("gyro_var", "(rad/s)^2", UAVObjectField.FieldType.FLOAT32, gyro_varElemNames, null) );
|
||||
|
||||
List<String> gyro_tempcompfactorElemNames = new ArrayList<String>();
|
||||
gyro_tempcompfactorElemNames.add("X");
|
||||
gyro_tempcompfactorElemNames.add("Y");
|
||||
gyro_tempcompfactorElemNames.add("Z");
|
||||
fields.add( new UAVObjectField("gyro_tempcompfactor", "raw/raw", UAVObjectField.FieldType.FLOAT32, gyro_tempcompfactorElemNames, null) );
|
||||
|
||||
List<String> mag_biasElemNames = new ArrayList<String>();
|
||||
mag_biasElemNames.add("X");
|
||||
mag_biasElemNames.add("Y");
|
||||
mag_biasElemNames.add("Z");
|
||||
fields.add( new UAVObjectField("mag_bias", "mGau", UAVObjectField.FieldType.FLOAT32, mag_biasElemNames, null) );
|
||||
|
||||
List<String> mag_scaleElemNames = new ArrayList<String>();
|
||||
mag_scaleElemNames.add("X");
|
||||
mag_scaleElemNames.add("Y");
|
||||
mag_scaleElemNames.add("Z");
|
||||
fields.add( new UAVObjectField("mag_scale", "(mGau)/lsb", UAVObjectField.FieldType.FLOAT32, mag_scaleElemNames, null) );
|
||||
|
||||
List<String> mag_varElemNames = new ArrayList<String>();
|
||||
mag_varElemNames.add("X");
|
||||
mag_varElemNames.add("Y");
|
||||
mag_varElemNames.add("Z");
|
||||
fields.add( new UAVObjectField("mag_var", "mGau^2", UAVObjectField.FieldType.FLOAT32, mag_varElemNames, null) );
|
||||
|
||||
List<String> vel_varElemNames = new ArrayList<String>();
|
||||
vel_varElemNames.add("0");
|
||||
fields.add( new UAVObjectField("vel_var", "(m/s)^2", UAVObjectField.FieldType.FLOAT32, vel_varElemNames, null) );
|
||||
|
||||
List<String> pos_varElemNames = new ArrayList<String>();
|
||||
pos_varElemNames.add("0");
|
||||
fields.add( new UAVObjectField("pos_var", "m^2", UAVObjectField.FieldType.FLOAT32, pos_varElemNames, null) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.TRUE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.TRUE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
|
||||
metadata.flightTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.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.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
getField("measure_var").setValue(0);
|
||||
getField("accel_bias").setValue(-73.5,0);
|
||||
getField("accel_bias").setValue(-73.5,1);
|
||||
getField("accel_bias").setValue(73.5,2);
|
||||
getField("accel_scale").setValue(0.0359,0);
|
||||
getField("accel_scale").setValue(0.0359,1);
|
||||
getField("accel_scale").setValue(-0.0359,2);
|
||||
getField("accel_var").setValue(0.0005,0);
|
||||
getField("accel_var").setValue(0.0005,1);
|
||||
getField("accel_var").setValue(0.0005,2);
|
||||
getField("gyro_bias").setValue(23,0);
|
||||
getField("gyro_bias").setValue(-23,1);
|
||||
getField("gyro_bias").setValue(23,2);
|
||||
getField("gyro_scale").setValue(-0.017,0);
|
||||
getField("gyro_scale").setValue(0.017,1);
|
||||
getField("gyro_scale").setValue(-0.017,2);
|
||||
getField("gyro_var").setValue(0.0001,0);
|
||||
getField("gyro_var").setValue(0.0001,1);
|
||||
getField("gyro_var").setValue(0.0001,2);
|
||||
getField("gyro_tempcompfactor").setValue(0,0);
|
||||
getField("gyro_tempcompfactor").setValue(0,1);
|
||||
getField("gyro_tempcompfactor").setValue(0,2);
|
||||
getField("mag_bias").setValue(0,0);
|
||||
getField("mag_bias").setValue(0,1);
|
||||
getField("mag_bias").setValue(0,2);
|
||||
getField("mag_scale").setValue(-2,0);
|
||||
getField("mag_scale").setValue(-2,1);
|
||||
getField("mag_scale").setValue(-2,2);
|
||||
getField("mag_var").setValue(50,0);
|
||||
getField("mag_var").setValue(50,1);
|
||||
getField("mag_var").setValue(50,2);
|
||||
getField("vel_var").setValue(0.4);
|
||||
getField("pos_var").setValue(0.4);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
AHRSCalibration obj = new AHRSCalibration();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public AHRSCalibration GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (AHRSCalibration)(objMngr.getObject(AHRSCalibration.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0x30101BB2;
|
||||
protected static final String NAME = "AHRSCalibration";
|
||||
protected static String DESCRIPTION = "Contains the calibration settings for the @ref AHRSCommsModule";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 1 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,178 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* Settings for the @ref AHRSCommsModule to control the algorithm and what is updated
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
Settings for the @ref AHRSCommsModule to control the algorithm and what is updated
|
||||
|
||||
generated from ahrssettings.xml
|
||||
**/
|
||||
public class AHRSSettings extends UAVDataObject {
|
||||
|
||||
public AHRSSettings() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> AlgorithmElemNames = new ArrayList<String>();
|
||||
AlgorithmElemNames.add("0");
|
||||
List<String> AlgorithmEnumOptions = new ArrayList<String>();
|
||||
AlgorithmEnumOptions.add("SIMPLE");
|
||||
AlgorithmEnumOptions.add("INSGPS_INDOOR_NOMAG");
|
||||
AlgorithmEnumOptions.add("INSGPS_INDOOR");
|
||||
AlgorithmEnumOptions.add("INSGPS_OUTDOOR");
|
||||
fields.add( new UAVObjectField("Algorithm", "", UAVObjectField.FieldType.ENUM, AlgorithmElemNames, AlgorithmEnumOptions) );
|
||||
|
||||
List<String> DownsamplingElemNames = new ArrayList<String>();
|
||||
DownsamplingElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Downsampling", "", UAVObjectField.FieldType.UINT8, DownsamplingElemNames, null) );
|
||||
|
||||
List<String> UpdatePeriodElemNames = new ArrayList<String>();
|
||||
UpdatePeriodElemNames.add("0");
|
||||
fields.add( new UAVObjectField("UpdatePeriod", "ms", UAVObjectField.FieldType.UINT8, UpdatePeriodElemNames, null) );
|
||||
|
||||
List<String> BiasCorrectedRawElemNames = new ArrayList<String>();
|
||||
BiasCorrectedRawElemNames.add("0");
|
||||
List<String> BiasCorrectedRawEnumOptions = new ArrayList<String>();
|
||||
BiasCorrectedRawEnumOptions.add("TRUE");
|
||||
BiasCorrectedRawEnumOptions.add("FALSE");
|
||||
fields.add( new UAVObjectField("BiasCorrectedRaw", "", UAVObjectField.FieldType.ENUM, BiasCorrectedRawElemNames, BiasCorrectedRawEnumOptions) );
|
||||
|
||||
List<String> YawBiasElemNames = new ArrayList<String>();
|
||||
YawBiasElemNames.add("0");
|
||||
fields.add( new UAVObjectField("YawBias", "", UAVObjectField.FieldType.FLOAT32, YawBiasElemNames, null) );
|
||||
|
||||
List<String> PitchBiasElemNames = new ArrayList<String>();
|
||||
PitchBiasElemNames.add("0");
|
||||
fields.add( new UAVObjectField("PitchBias", "", UAVObjectField.FieldType.FLOAT32, PitchBiasElemNames, null) );
|
||||
|
||||
List<String> RollBiasElemNames = new ArrayList<String>();
|
||||
RollBiasElemNames.add("0");
|
||||
fields.add( new UAVObjectField("RollBias", "", UAVObjectField.FieldType.FLOAT32, RollBiasElemNames, null) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.TRUE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.TRUE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
|
||||
metadata.flightTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.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.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
getField("Algorithm").setValue(1);
|
||||
getField("Downsampling").setValue(20);
|
||||
getField("UpdatePeriod").setValue(1);
|
||||
getField("BiasCorrectedRaw").setValue(0);
|
||||
getField("YawBias").setValue(0);
|
||||
getField("PitchBias").setValue(0);
|
||||
getField("RollBias").setValue(0);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
AHRSSettings obj = new AHRSSettings();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public AHRSSettings GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (AHRSSettings)(objMngr.getObject(AHRSSettings.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0xDEFC5548;
|
||||
protected static final String NAME = "AHRSSettings";
|
||||
protected static String DESCRIPTION = "Settings for the @ref AHRSCommsModule to control the algorithm and what is updated";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 1 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,158 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* Contains the pulse duration sent to each of the channels. Set by @ref ActuatorModule
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
Contains the pulse duration sent to each of the channels. Set by @ref ActuatorModule
|
||||
|
||||
generated from actuatorcommand.xml
|
||||
**/
|
||||
public class ActuatorCommand extends UAVDataObject {
|
||||
|
||||
public ActuatorCommand() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> ChannelElemNames = new ArrayList<String>();
|
||||
ChannelElemNames.add("0");
|
||||
ChannelElemNames.add("1");
|
||||
ChannelElemNames.add("2");
|
||||
ChannelElemNames.add("3");
|
||||
ChannelElemNames.add("4");
|
||||
ChannelElemNames.add("5");
|
||||
ChannelElemNames.add("6");
|
||||
ChannelElemNames.add("7");
|
||||
fields.add( new UAVObjectField("Channel", "us", UAVObjectField.FieldType.INT16, ChannelElemNames, null) );
|
||||
|
||||
List<String> UpdateTimeElemNames = new ArrayList<String>();
|
||||
UpdateTimeElemNames.add("0");
|
||||
fields.add( new UAVObjectField("UpdateTime", "ms", UAVObjectField.FieldType.UINT8, UpdateTimeElemNames, null) );
|
||||
|
||||
List<String> MaxUpdateTimeElemNames = new ArrayList<String>();
|
||||
MaxUpdateTimeElemNames.add("0");
|
||||
fields.add( new UAVObjectField("MaxUpdateTime", "ms", UAVObjectField.FieldType.UINT16, MaxUpdateTimeElemNames, null) );
|
||||
|
||||
List<String> NumFailedUpdatesElemNames = new ArrayList<String>();
|
||||
NumFailedUpdatesElemNames.add("0");
|
||||
fields.add( new UAVObjectField("NumFailedUpdates", "", UAVObjectField.FieldType.UINT8, NumFailedUpdatesElemNames, null) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
|
||||
metadata.flightTelemetryUpdatePeriod = 1000;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.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.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
ActuatorCommand obj = new ActuatorCommand();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public ActuatorCommand GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (ActuatorCommand)(objMngr.getObject(ActuatorCommand.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0xE8E077D8;
|
||||
protected static final String NAME = "ActuatorCommand";
|
||||
protected static String DESCRIPTION = "Contains the pulse duration sent to each of the channels. Set by @ref ActuatorModule";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 0 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,159 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* Desired raw, pitch and yaw actuator settings. Comes from either @ref StabilizationModule or @ref ManualControlModule depending on FlightMode.
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
Desired raw, pitch and yaw actuator settings. Comes from either @ref StabilizationModule or @ref ManualControlModule depending on FlightMode.
|
||||
|
||||
generated from actuatordesired.xml
|
||||
**/
|
||||
public class ActuatorDesired extends UAVDataObject {
|
||||
|
||||
public ActuatorDesired() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> RollElemNames = new ArrayList<String>();
|
||||
RollElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Roll", "%", UAVObjectField.FieldType.FLOAT32, RollElemNames, null) );
|
||||
|
||||
List<String> PitchElemNames = new ArrayList<String>();
|
||||
PitchElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Pitch", "%", UAVObjectField.FieldType.FLOAT32, PitchElemNames, null) );
|
||||
|
||||
List<String> YawElemNames = new ArrayList<String>();
|
||||
YawElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Yaw", "%", UAVObjectField.FieldType.FLOAT32, YawElemNames, null) );
|
||||
|
||||
List<String> ThrottleElemNames = new ArrayList<String>();
|
||||
ThrottleElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Throttle", "%", UAVObjectField.FieldType.FLOAT32, ThrottleElemNames, null) );
|
||||
|
||||
List<String> UpdateTimeElemNames = new ArrayList<String>();
|
||||
UpdateTimeElemNames.add("0");
|
||||
fields.add( new UAVObjectField("UpdateTime", "ms", UAVObjectField.FieldType.FLOAT32, UpdateTimeElemNames, null) );
|
||||
|
||||
List<String> NumLongUpdatesElemNames = new ArrayList<String>();
|
||||
NumLongUpdatesElemNames.add("0");
|
||||
fields.add( new UAVObjectField("NumLongUpdates", "ms", UAVObjectField.FieldType.FLOAT32, NumLongUpdatesElemNames, null) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
|
||||
metadata.flightTelemetryUpdatePeriod = 1000;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.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.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
ActuatorDesired obj = new ActuatorDesired();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public ActuatorDesired GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (ActuatorDesired)(objMngr.getObject(ActuatorDesired.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0xD4516782;
|
||||
protected static final String NAME = "ActuatorDesired";
|
||||
protected static String DESCRIPTION = "Desired raw, pitch and yaw actuator settings. Comes from either @ref StabilizationModule or @ref ManualControlModule depending on FlightMode.";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 0 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,455 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* Settings for the @ref ActuatorModule that controls the channel assignments for the mixer based on AircraftType
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
Settings for the @ref ActuatorModule that controls the channel assignments for the mixer based on AircraftType
|
||||
|
||||
generated from actuatorsettings.xml
|
||||
**/
|
||||
public class ActuatorSettings extends UAVDataObject {
|
||||
|
||||
public ActuatorSettings() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> FixedWingRoll1ElemNames = new ArrayList<String>();
|
||||
FixedWingRoll1ElemNames.add("0");
|
||||
List<String> FixedWingRoll1EnumOptions = new ArrayList<String>();
|
||||
FixedWingRoll1EnumOptions.add("Channel1");
|
||||
FixedWingRoll1EnumOptions.add("Channel2");
|
||||
FixedWingRoll1EnumOptions.add("Channel3");
|
||||
FixedWingRoll1EnumOptions.add("Channel4");
|
||||
FixedWingRoll1EnumOptions.add("Channel5");
|
||||
FixedWingRoll1EnumOptions.add("Channel6");
|
||||
FixedWingRoll1EnumOptions.add("Channel7");
|
||||
FixedWingRoll1EnumOptions.add("Channel8");
|
||||
FixedWingRoll1EnumOptions.add("None");
|
||||
fields.add( new UAVObjectField("FixedWingRoll1", "channel", UAVObjectField.FieldType.ENUM, FixedWingRoll1ElemNames, FixedWingRoll1EnumOptions) );
|
||||
|
||||
List<String> FixedWingRoll2ElemNames = new ArrayList<String>();
|
||||
FixedWingRoll2ElemNames.add("0");
|
||||
List<String> FixedWingRoll2EnumOptions = new ArrayList<String>();
|
||||
FixedWingRoll2EnumOptions.add("Channel1");
|
||||
FixedWingRoll2EnumOptions.add("Channel2");
|
||||
FixedWingRoll2EnumOptions.add("Channel3");
|
||||
FixedWingRoll2EnumOptions.add("Channel4");
|
||||
FixedWingRoll2EnumOptions.add("Channel5");
|
||||
FixedWingRoll2EnumOptions.add("Channel6");
|
||||
FixedWingRoll2EnumOptions.add("Channel7");
|
||||
FixedWingRoll2EnumOptions.add("Channel8");
|
||||
FixedWingRoll2EnumOptions.add("None");
|
||||
fields.add( new UAVObjectField("FixedWingRoll2", "channel", UAVObjectField.FieldType.ENUM, FixedWingRoll2ElemNames, FixedWingRoll2EnumOptions) );
|
||||
|
||||
List<String> FixedWingPitch1ElemNames = new ArrayList<String>();
|
||||
FixedWingPitch1ElemNames.add("0");
|
||||
List<String> FixedWingPitch1EnumOptions = new ArrayList<String>();
|
||||
FixedWingPitch1EnumOptions.add("Channel1");
|
||||
FixedWingPitch1EnumOptions.add("Channel2");
|
||||
FixedWingPitch1EnumOptions.add("Channel3");
|
||||
FixedWingPitch1EnumOptions.add("Channel4");
|
||||
FixedWingPitch1EnumOptions.add("Channel5");
|
||||
FixedWingPitch1EnumOptions.add("Channel6");
|
||||
FixedWingPitch1EnumOptions.add("Channel7");
|
||||
FixedWingPitch1EnumOptions.add("Channel8");
|
||||
FixedWingPitch1EnumOptions.add("None");
|
||||
fields.add( new UAVObjectField("FixedWingPitch1", "channel", UAVObjectField.FieldType.ENUM, FixedWingPitch1ElemNames, FixedWingPitch1EnumOptions) );
|
||||
|
||||
List<String> FixedWingPitch2ElemNames = new ArrayList<String>();
|
||||
FixedWingPitch2ElemNames.add("0");
|
||||
List<String> FixedWingPitch2EnumOptions = new ArrayList<String>();
|
||||
FixedWingPitch2EnumOptions.add("Channel1");
|
||||
FixedWingPitch2EnumOptions.add("Channel2");
|
||||
FixedWingPitch2EnumOptions.add("Channel3");
|
||||
FixedWingPitch2EnumOptions.add("Channel4");
|
||||
FixedWingPitch2EnumOptions.add("Channel5");
|
||||
FixedWingPitch2EnumOptions.add("Channel6");
|
||||
FixedWingPitch2EnumOptions.add("Channel7");
|
||||
FixedWingPitch2EnumOptions.add("Channel8");
|
||||
FixedWingPitch2EnumOptions.add("None");
|
||||
fields.add( new UAVObjectField("FixedWingPitch2", "channel", UAVObjectField.FieldType.ENUM, FixedWingPitch2ElemNames, FixedWingPitch2EnumOptions) );
|
||||
|
||||
List<String> FixedWingYawElemNames = new ArrayList<String>();
|
||||
FixedWingYawElemNames.add("0");
|
||||
List<String> FixedWingYawEnumOptions = new ArrayList<String>();
|
||||
FixedWingYawEnumOptions.add("Channel1");
|
||||
FixedWingYawEnumOptions.add("Channel2");
|
||||
FixedWingYawEnumOptions.add("Channel3");
|
||||
FixedWingYawEnumOptions.add("Channel4");
|
||||
FixedWingYawEnumOptions.add("Channel5");
|
||||
FixedWingYawEnumOptions.add("Channel6");
|
||||
FixedWingYawEnumOptions.add("Channel7");
|
||||
FixedWingYawEnumOptions.add("Channel8");
|
||||
FixedWingYawEnumOptions.add("None");
|
||||
fields.add( new UAVObjectField("FixedWingYaw", "channel", UAVObjectField.FieldType.ENUM, FixedWingYawElemNames, FixedWingYawEnumOptions) );
|
||||
|
||||
List<String> FixedWingThrottleElemNames = new ArrayList<String>();
|
||||
FixedWingThrottleElemNames.add("0");
|
||||
List<String> FixedWingThrottleEnumOptions = new ArrayList<String>();
|
||||
FixedWingThrottleEnumOptions.add("Channel1");
|
||||
FixedWingThrottleEnumOptions.add("Channel2");
|
||||
FixedWingThrottleEnumOptions.add("Channel3");
|
||||
FixedWingThrottleEnumOptions.add("Channel4");
|
||||
FixedWingThrottleEnumOptions.add("Channel5");
|
||||
FixedWingThrottleEnumOptions.add("Channel6");
|
||||
FixedWingThrottleEnumOptions.add("Channel7");
|
||||
FixedWingThrottleEnumOptions.add("Channel8");
|
||||
FixedWingThrottleEnumOptions.add("None");
|
||||
fields.add( new UAVObjectField("FixedWingThrottle", "channel", UAVObjectField.FieldType.ENUM, FixedWingThrottleElemNames, FixedWingThrottleEnumOptions) );
|
||||
|
||||
List<String> VTOLMotorNElemNames = new ArrayList<String>();
|
||||
VTOLMotorNElemNames.add("0");
|
||||
List<String> VTOLMotorNEnumOptions = new ArrayList<String>();
|
||||
VTOLMotorNEnumOptions.add("Channel1");
|
||||
VTOLMotorNEnumOptions.add("Channel2");
|
||||
VTOLMotorNEnumOptions.add("Channel3");
|
||||
VTOLMotorNEnumOptions.add("Channel4");
|
||||
VTOLMotorNEnumOptions.add("Channel5");
|
||||
VTOLMotorNEnumOptions.add("Channel6");
|
||||
VTOLMotorNEnumOptions.add("Channel7");
|
||||
VTOLMotorNEnumOptions.add("Channel8");
|
||||
VTOLMotorNEnumOptions.add("None");
|
||||
fields.add( new UAVObjectField("VTOLMotorN", "channel", UAVObjectField.FieldType.ENUM, VTOLMotorNElemNames, VTOLMotorNEnumOptions) );
|
||||
|
||||
List<String> VTOLMotorNEElemNames = new ArrayList<String>();
|
||||
VTOLMotorNEElemNames.add("0");
|
||||
List<String> VTOLMotorNEEnumOptions = new ArrayList<String>();
|
||||
VTOLMotorNEEnumOptions.add("Channel1");
|
||||
VTOLMotorNEEnumOptions.add("Channel2");
|
||||
VTOLMotorNEEnumOptions.add("Channel3");
|
||||
VTOLMotorNEEnumOptions.add("Channel4");
|
||||
VTOLMotorNEEnumOptions.add("Channel5");
|
||||
VTOLMotorNEEnumOptions.add("Channel6");
|
||||
VTOLMotorNEEnumOptions.add("Channel7");
|
||||
VTOLMotorNEEnumOptions.add("Channel8");
|
||||
VTOLMotorNEEnumOptions.add("None");
|
||||
fields.add( new UAVObjectField("VTOLMotorNE", "channel", UAVObjectField.FieldType.ENUM, VTOLMotorNEElemNames, VTOLMotorNEEnumOptions) );
|
||||
|
||||
List<String> VTOLMotorEElemNames = new ArrayList<String>();
|
||||
VTOLMotorEElemNames.add("0");
|
||||
List<String> VTOLMotorEEnumOptions = new ArrayList<String>();
|
||||
VTOLMotorEEnumOptions.add("Channel1");
|
||||
VTOLMotorEEnumOptions.add("Channel2");
|
||||
VTOLMotorEEnumOptions.add("Channel3");
|
||||
VTOLMotorEEnumOptions.add("Channel4");
|
||||
VTOLMotorEEnumOptions.add("Channel5");
|
||||
VTOLMotorEEnumOptions.add("Channel6");
|
||||
VTOLMotorEEnumOptions.add("Channel7");
|
||||
VTOLMotorEEnumOptions.add("Channel8");
|
||||
VTOLMotorEEnumOptions.add("None");
|
||||
fields.add( new UAVObjectField("VTOLMotorE", "channel", UAVObjectField.FieldType.ENUM, VTOLMotorEElemNames, VTOLMotorEEnumOptions) );
|
||||
|
||||
List<String> VTOLMotorSEElemNames = new ArrayList<String>();
|
||||
VTOLMotorSEElemNames.add("0");
|
||||
List<String> VTOLMotorSEEnumOptions = new ArrayList<String>();
|
||||
VTOLMotorSEEnumOptions.add("Channel1");
|
||||
VTOLMotorSEEnumOptions.add("Channel2");
|
||||
VTOLMotorSEEnumOptions.add("Channel3");
|
||||
VTOLMotorSEEnumOptions.add("Channel4");
|
||||
VTOLMotorSEEnumOptions.add("Channel5");
|
||||
VTOLMotorSEEnumOptions.add("Channel6");
|
||||
VTOLMotorSEEnumOptions.add("Channel7");
|
||||
VTOLMotorSEEnumOptions.add("Channel8");
|
||||
VTOLMotorSEEnumOptions.add("None");
|
||||
fields.add( new UAVObjectField("VTOLMotorSE", "channel", UAVObjectField.FieldType.ENUM, VTOLMotorSEElemNames, VTOLMotorSEEnumOptions) );
|
||||
|
||||
List<String> VTOLMotorSElemNames = new ArrayList<String>();
|
||||
VTOLMotorSElemNames.add("0");
|
||||
List<String> VTOLMotorSEnumOptions = new ArrayList<String>();
|
||||
VTOLMotorSEnumOptions.add("Channel1");
|
||||
VTOLMotorSEnumOptions.add("Channel2");
|
||||
VTOLMotorSEnumOptions.add("Channel3");
|
||||
VTOLMotorSEnumOptions.add("Channel4");
|
||||
VTOLMotorSEnumOptions.add("Channel5");
|
||||
VTOLMotorSEnumOptions.add("Channel6");
|
||||
VTOLMotorSEnumOptions.add("Channel7");
|
||||
VTOLMotorSEnumOptions.add("Channel8");
|
||||
VTOLMotorSEnumOptions.add("None");
|
||||
fields.add( new UAVObjectField("VTOLMotorS", "channel", UAVObjectField.FieldType.ENUM, VTOLMotorSElemNames, VTOLMotorSEnumOptions) );
|
||||
|
||||
List<String> VTOLMotorSWElemNames = new ArrayList<String>();
|
||||
VTOLMotorSWElemNames.add("0");
|
||||
List<String> VTOLMotorSWEnumOptions = new ArrayList<String>();
|
||||
VTOLMotorSWEnumOptions.add("Channel1");
|
||||
VTOLMotorSWEnumOptions.add("Channel2");
|
||||
VTOLMotorSWEnumOptions.add("Channel3");
|
||||
VTOLMotorSWEnumOptions.add("Channel4");
|
||||
VTOLMotorSWEnumOptions.add("Channel5");
|
||||
VTOLMotorSWEnumOptions.add("Channel6");
|
||||
VTOLMotorSWEnumOptions.add("Channel7");
|
||||
VTOLMotorSWEnumOptions.add("Channel8");
|
||||
VTOLMotorSWEnumOptions.add("None");
|
||||
fields.add( new UAVObjectField("VTOLMotorSW", "channel", UAVObjectField.FieldType.ENUM, VTOLMotorSWElemNames, VTOLMotorSWEnumOptions) );
|
||||
|
||||
List<String> VTOLMotorWElemNames = new ArrayList<String>();
|
||||
VTOLMotorWElemNames.add("0");
|
||||
List<String> VTOLMotorWEnumOptions = new ArrayList<String>();
|
||||
VTOLMotorWEnumOptions.add("Channel1");
|
||||
VTOLMotorWEnumOptions.add("Channel2");
|
||||
VTOLMotorWEnumOptions.add("Channel3");
|
||||
VTOLMotorWEnumOptions.add("Channel4");
|
||||
VTOLMotorWEnumOptions.add("Channel5");
|
||||
VTOLMotorWEnumOptions.add("Channel6");
|
||||
VTOLMotorWEnumOptions.add("Channel7");
|
||||
VTOLMotorWEnumOptions.add("Channel8");
|
||||
VTOLMotorWEnumOptions.add("None");
|
||||
fields.add( new UAVObjectField("VTOLMotorW", "channel", UAVObjectField.FieldType.ENUM, VTOLMotorWElemNames, VTOLMotorWEnumOptions) );
|
||||
|
||||
List<String> VTOLMotorNWElemNames = new ArrayList<String>();
|
||||
VTOLMotorNWElemNames.add("0");
|
||||
List<String> VTOLMotorNWEnumOptions = new ArrayList<String>();
|
||||
VTOLMotorNWEnumOptions.add("Channel1");
|
||||
VTOLMotorNWEnumOptions.add("Channel2");
|
||||
VTOLMotorNWEnumOptions.add("Channel3");
|
||||
VTOLMotorNWEnumOptions.add("Channel4");
|
||||
VTOLMotorNWEnumOptions.add("Channel5");
|
||||
VTOLMotorNWEnumOptions.add("Channel6");
|
||||
VTOLMotorNWEnumOptions.add("Channel7");
|
||||
VTOLMotorNWEnumOptions.add("Channel8");
|
||||
VTOLMotorNWEnumOptions.add("None");
|
||||
fields.add( new UAVObjectField("VTOLMotorNW", "channel", UAVObjectField.FieldType.ENUM, VTOLMotorNWElemNames, VTOLMotorNWEnumOptions) );
|
||||
|
||||
List<String> ChannelUpdateFreqElemNames = new ArrayList<String>();
|
||||
ChannelUpdateFreqElemNames.add("0");
|
||||
ChannelUpdateFreqElemNames.add("1");
|
||||
ChannelUpdateFreqElemNames.add("2");
|
||||
ChannelUpdateFreqElemNames.add("3");
|
||||
fields.add( new UAVObjectField("ChannelUpdateFreq", "Hz", UAVObjectField.FieldType.UINT16, ChannelUpdateFreqElemNames, null) );
|
||||
|
||||
List<String> ChannelMaxElemNames = new ArrayList<String>();
|
||||
ChannelMaxElemNames.add("0");
|
||||
ChannelMaxElemNames.add("1");
|
||||
ChannelMaxElemNames.add("2");
|
||||
ChannelMaxElemNames.add("3");
|
||||
ChannelMaxElemNames.add("4");
|
||||
ChannelMaxElemNames.add("5");
|
||||
ChannelMaxElemNames.add("6");
|
||||
ChannelMaxElemNames.add("7");
|
||||
fields.add( new UAVObjectField("ChannelMax", "us", UAVObjectField.FieldType.INT16, ChannelMaxElemNames, null) );
|
||||
|
||||
List<String> ChannelNeutralElemNames = new ArrayList<String>();
|
||||
ChannelNeutralElemNames.add("0");
|
||||
ChannelNeutralElemNames.add("1");
|
||||
ChannelNeutralElemNames.add("2");
|
||||
ChannelNeutralElemNames.add("3");
|
||||
ChannelNeutralElemNames.add("4");
|
||||
ChannelNeutralElemNames.add("5");
|
||||
ChannelNeutralElemNames.add("6");
|
||||
ChannelNeutralElemNames.add("7");
|
||||
fields.add( new UAVObjectField("ChannelNeutral", "us", UAVObjectField.FieldType.INT16, ChannelNeutralElemNames, null) );
|
||||
|
||||
List<String> ChannelMinElemNames = new ArrayList<String>();
|
||||
ChannelMinElemNames.add("0");
|
||||
ChannelMinElemNames.add("1");
|
||||
ChannelMinElemNames.add("2");
|
||||
ChannelMinElemNames.add("3");
|
||||
ChannelMinElemNames.add("4");
|
||||
ChannelMinElemNames.add("5");
|
||||
ChannelMinElemNames.add("6");
|
||||
ChannelMinElemNames.add("7");
|
||||
fields.add( new UAVObjectField("ChannelMin", "us", UAVObjectField.FieldType.INT16, ChannelMinElemNames, null) );
|
||||
|
||||
List<String> ChannelTypeElemNames = new ArrayList<String>();
|
||||
ChannelTypeElemNames.add("0");
|
||||
ChannelTypeElemNames.add("1");
|
||||
ChannelTypeElemNames.add("2");
|
||||
ChannelTypeElemNames.add("3");
|
||||
ChannelTypeElemNames.add("4");
|
||||
ChannelTypeElemNames.add("5");
|
||||
ChannelTypeElemNames.add("6");
|
||||
ChannelTypeElemNames.add("7");
|
||||
List<String> ChannelTypeEnumOptions = new ArrayList<String>();
|
||||
ChannelTypeEnumOptions.add("PWM");
|
||||
ChannelTypeEnumOptions.add("MK");
|
||||
ChannelTypeEnumOptions.add("ASTEC4");
|
||||
fields.add( new UAVObjectField("ChannelType", "", UAVObjectField.FieldType.ENUM, ChannelTypeElemNames, ChannelTypeEnumOptions) );
|
||||
|
||||
List<String> ChannelAddrElemNames = new ArrayList<String>();
|
||||
ChannelAddrElemNames.add("0");
|
||||
ChannelAddrElemNames.add("1");
|
||||
ChannelAddrElemNames.add("2");
|
||||
ChannelAddrElemNames.add("3");
|
||||
ChannelAddrElemNames.add("4");
|
||||
ChannelAddrElemNames.add("5");
|
||||
ChannelAddrElemNames.add("6");
|
||||
ChannelAddrElemNames.add("7");
|
||||
fields.add( new UAVObjectField("ChannelAddr", "", UAVObjectField.FieldType.UINT8, ChannelAddrElemNames, null) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.TRUE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.TRUE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
|
||||
metadata.flightTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.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.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
getField("FixedWingRoll1").setValue(8);
|
||||
getField("FixedWingRoll2").setValue(8);
|
||||
getField("FixedWingPitch1").setValue(8);
|
||||
getField("FixedWingPitch2").setValue(8);
|
||||
getField("FixedWingYaw").setValue(8);
|
||||
getField("FixedWingThrottle").setValue(8);
|
||||
getField("VTOLMotorN").setValue(8);
|
||||
getField("VTOLMotorNE").setValue(8);
|
||||
getField("VTOLMotorE").setValue(8);
|
||||
getField("VTOLMotorSE").setValue(8);
|
||||
getField("VTOLMotorS").setValue(8);
|
||||
getField("VTOLMotorSW").setValue(8);
|
||||
getField("VTOLMotorW").setValue(8);
|
||||
getField("VTOLMotorNW").setValue(8);
|
||||
getField("ChannelUpdateFreq").setValue(50,0);
|
||||
getField("ChannelUpdateFreq").setValue(50,1);
|
||||
getField("ChannelUpdateFreq").setValue(50,2);
|
||||
getField("ChannelUpdateFreq").setValue(50,3);
|
||||
getField("ChannelMax").setValue(1000,0);
|
||||
getField("ChannelMax").setValue(1000,1);
|
||||
getField("ChannelMax").setValue(1000,2);
|
||||
getField("ChannelMax").setValue(1000,3);
|
||||
getField("ChannelMax").setValue(1000,4);
|
||||
getField("ChannelMax").setValue(1000,5);
|
||||
getField("ChannelMax").setValue(1000,6);
|
||||
getField("ChannelMax").setValue(1000,7);
|
||||
getField("ChannelNeutral").setValue(1000,0);
|
||||
getField("ChannelNeutral").setValue(1000,1);
|
||||
getField("ChannelNeutral").setValue(1000,2);
|
||||
getField("ChannelNeutral").setValue(1000,3);
|
||||
getField("ChannelNeutral").setValue(1000,4);
|
||||
getField("ChannelNeutral").setValue(1000,5);
|
||||
getField("ChannelNeutral").setValue(1000,6);
|
||||
getField("ChannelNeutral").setValue(1000,7);
|
||||
getField("ChannelMin").setValue(1000,0);
|
||||
getField("ChannelMin").setValue(1000,1);
|
||||
getField("ChannelMin").setValue(1000,2);
|
||||
getField("ChannelMin").setValue(1000,3);
|
||||
getField("ChannelMin").setValue(1000,4);
|
||||
getField("ChannelMin").setValue(1000,5);
|
||||
getField("ChannelMin").setValue(1000,6);
|
||||
getField("ChannelMin").setValue(1000,7);
|
||||
getField("ChannelType").setValue(0,0);
|
||||
getField("ChannelType").setValue(0,1);
|
||||
getField("ChannelType").setValue(0,2);
|
||||
getField("ChannelType").setValue(0,3);
|
||||
getField("ChannelType").setValue(0,4);
|
||||
getField("ChannelType").setValue(0,5);
|
||||
getField("ChannelType").setValue(0,6);
|
||||
getField("ChannelType").setValue(0,7);
|
||||
getField("ChannelAddr").setValue(0,0);
|
||||
getField("ChannelAddr").setValue(1,1);
|
||||
getField("ChannelAddr").setValue(2,2);
|
||||
getField("ChannelAddr").setValue(3,3);
|
||||
getField("ChannelAddr").setValue(4,4);
|
||||
getField("ChannelAddr").setValue(5,5);
|
||||
getField("ChannelAddr").setValue(6,6);
|
||||
getField("ChannelAddr").setValue(7,7);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
ActuatorSettings obj = new ActuatorSettings();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public ActuatorSettings GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (ActuatorSettings)(objMngr.getObject(ActuatorSettings.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0x1BF864C2;
|
||||
protected static final String NAME = "ActuatorSettings";
|
||||
protected static String DESCRIPTION = "Settings for the @ref ActuatorModule that controls the channel assignments for the mixer based on AircraftType";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 1 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
201
androidgcs/src/org/openpilot/uavtalk/uavobjects/AhrsStatus.java
Normal file
201
androidgcs/src/org/openpilot/uavtalk/uavobjects/AhrsStatus.java
Normal file
@ -0,0 +1,201 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* Status for the @ref AHRSCommsModule, including communication errors
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
Status for the @ref AHRSCommsModule, including communication errors
|
||||
|
||||
generated from ahrsstatus.xml
|
||||
**/
|
||||
public class AhrsStatus extends UAVDataObject {
|
||||
|
||||
public AhrsStatus() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> SerialNumberElemNames = new ArrayList<String>();
|
||||
SerialNumberElemNames.add("0");
|
||||
SerialNumberElemNames.add("1");
|
||||
SerialNumberElemNames.add("2");
|
||||
SerialNumberElemNames.add("3");
|
||||
SerialNumberElemNames.add("4");
|
||||
SerialNumberElemNames.add("5");
|
||||
SerialNumberElemNames.add("6");
|
||||
SerialNumberElemNames.add("7");
|
||||
fields.add( new UAVObjectField("SerialNumber", "", UAVObjectField.FieldType.UINT8, SerialNumberElemNames, null) );
|
||||
|
||||
List<String> CPULoadElemNames = new ArrayList<String>();
|
||||
CPULoadElemNames.add("0");
|
||||
fields.add( new UAVObjectField("CPULoad", "count", UAVObjectField.FieldType.UINT8, CPULoadElemNames, null) );
|
||||
|
||||
List<String> RunningTimeElemNames = new ArrayList<String>();
|
||||
RunningTimeElemNames.add("0");
|
||||
fields.add( new UAVObjectField("RunningTime", "ms", UAVObjectField.FieldType.UINT32, RunningTimeElemNames, null) );
|
||||
|
||||
List<String> IdleTimePerCyleElemNames = new ArrayList<String>();
|
||||
IdleTimePerCyleElemNames.add("0");
|
||||
fields.add( new UAVObjectField("IdleTimePerCyle", "10x ms", UAVObjectField.FieldType.UINT8, IdleTimePerCyleElemNames, null) );
|
||||
|
||||
List<String> RunningTimePerCyleElemNames = new ArrayList<String>();
|
||||
RunningTimePerCyleElemNames.add("0");
|
||||
fields.add( new UAVObjectField("RunningTimePerCyle", "10x ms", UAVObjectField.FieldType.UINT8, RunningTimePerCyleElemNames, null) );
|
||||
|
||||
List<String> DroppedUpdatesElemNames = new ArrayList<String>();
|
||||
DroppedUpdatesElemNames.add("0");
|
||||
fields.add( new UAVObjectField("DroppedUpdates", "count", UAVObjectField.FieldType.UINT8, DroppedUpdatesElemNames, null) );
|
||||
|
||||
List<String> LinkRunningElemNames = new ArrayList<String>();
|
||||
LinkRunningElemNames.add("0");
|
||||
List<String> LinkRunningEnumOptions = new ArrayList<String>();
|
||||
LinkRunningEnumOptions.add("FALSE");
|
||||
LinkRunningEnumOptions.add("TRUE");
|
||||
fields.add( new UAVObjectField("LinkRunning", "", UAVObjectField.FieldType.ENUM, LinkRunningElemNames, LinkRunningEnumOptions) );
|
||||
|
||||
List<String> AhrsKickstartsElemNames = new ArrayList<String>();
|
||||
AhrsKickstartsElemNames.add("0");
|
||||
fields.add( new UAVObjectField("AhrsKickstarts", "count", UAVObjectField.FieldType.UINT8, AhrsKickstartsElemNames, null) );
|
||||
|
||||
List<String> AhrsCrcErrorsElemNames = new ArrayList<String>();
|
||||
AhrsCrcErrorsElemNames.add("0");
|
||||
fields.add( new UAVObjectField("AhrsCrcErrors", "count", UAVObjectField.FieldType.UINT8, AhrsCrcErrorsElemNames, null) );
|
||||
|
||||
List<String> AhrsRetriesElemNames = new ArrayList<String>();
|
||||
AhrsRetriesElemNames.add("0");
|
||||
fields.add( new UAVObjectField("AhrsRetries", "count", UAVObjectField.FieldType.UINT8, AhrsRetriesElemNames, null) );
|
||||
|
||||
List<String> AhrsInvalidPacketsElemNames = new ArrayList<String>();
|
||||
AhrsInvalidPacketsElemNames.add("0");
|
||||
fields.add( new UAVObjectField("AhrsInvalidPackets", "count", UAVObjectField.FieldType.UINT8, AhrsInvalidPacketsElemNames, null) );
|
||||
|
||||
List<String> OpCrcErrorsElemNames = new ArrayList<String>();
|
||||
OpCrcErrorsElemNames.add("0");
|
||||
fields.add( new UAVObjectField("OpCrcErrors", "count", UAVObjectField.FieldType.UINT8, OpCrcErrorsElemNames, null) );
|
||||
|
||||
List<String> OpRetriesElemNames = new ArrayList<String>();
|
||||
OpRetriesElemNames.add("0");
|
||||
fields.add( new UAVObjectField("OpRetries", "count", UAVObjectField.FieldType.UINT8, OpRetriesElemNames, null) );
|
||||
|
||||
List<String> OpInvalidPacketsElemNames = new ArrayList<String>();
|
||||
OpInvalidPacketsElemNames.add("0");
|
||||
fields.add( new UAVObjectField("OpInvalidPackets", "count", UAVObjectField.FieldType.UINT8, OpInvalidPacketsElemNames, null) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
|
||||
metadata.flightTelemetryUpdatePeriod = 1000;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
|
||||
metadata.loggingUpdatePeriod = 1000;
|
||||
return metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize object fields with the default values.
|
||||
* If a default value is not specified the object fields
|
||||
* will be initialized to zero.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
AhrsStatus obj = new AhrsStatus();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public AhrsStatus GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (AhrsStatus)(objMngr.getObject(AhrsStatus.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0x37A5F7A2;
|
||||
protected static final String NAME = "AhrsStatus";
|
||||
protected static String DESCRIPTION = "Status for the @ref AHRSCommsModule, including communication errors";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 0 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,163 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* The updated Attitude estimation from @ref AHRSCommsModule.
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
The updated Attitude estimation from @ref AHRSCommsModule.
|
||||
|
||||
generated from attitudeactual.xml
|
||||
**/
|
||||
public class AttitudeActual extends UAVDataObject {
|
||||
|
||||
public AttitudeActual() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> q1ElemNames = new ArrayList<String>();
|
||||
q1ElemNames.add("0");
|
||||
fields.add( new UAVObjectField("q1", "", UAVObjectField.FieldType.FLOAT32, q1ElemNames, null) );
|
||||
|
||||
List<String> q2ElemNames = new ArrayList<String>();
|
||||
q2ElemNames.add("0");
|
||||
fields.add( new UAVObjectField("q2", "", UAVObjectField.FieldType.FLOAT32, q2ElemNames, null) );
|
||||
|
||||
List<String> q3ElemNames = new ArrayList<String>();
|
||||
q3ElemNames.add("0");
|
||||
fields.add( new UAVObjectField("q3", "", UAVObjectField.FieldType.FLOAT32, q3ElemNames, null) );
|
||||
|
||||
List<String> q4ElemNames = new ArrayList<String>();
|
||||
q4ElemNames.add("0");
|
||||
fields.add( new UAVObjectField("q4", "", UAVObjectField.FieldType.FLOAT32, q4ElemNames, null) );
|
||||
|
||||
List<String> RollElemNames = new ArrayList<String>();
|
||||
RollElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Roll", "degrees", UAVObjectField.FieldType.FLOAT32, RollElemNames, null) );
|
||||
|
||||
List<String> PitchElemNames = new ArrayList<String>();
|
||||
PitchElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Pitch", "degrees", UAVObjectField.FieldType.FLOAT32, PitchElemNames, null) );
|
||||
|
||||
List<String> YawElemNames = new ArrayList<String>();
|
||||
YawElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Yaw", "degrees", UAVObjectField.FieldType.FLOAT32, YawElemNames, null) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
|
||||
metadata.flightTelemetryUpdatePeriod = 500;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.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.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
AttitudeActual obj = new AttitudeActual();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public AttitudeActual GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (AttitudeActual)(objMngr.getObject(AttitudeActual.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0xFC5B8CF4;
|
||||
protected static final String NAME = "AttitudeActual";
|
||||
protected static String DESCRIPTION = "The updated Attitude estimation from @ref AHRSCommsModule.";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 0 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
158
androidgcs/src/org/openpilot/uavtalk/uavobjects/AttitudeRaw.java
Normal file
158
androidgcs/src/org/openpilot/uavtalk/uavobjects/AttitudeRaw.java
Normal file
@ -0,0 +1,158 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* The raw attitude sensor data from @ref AHRSCommsModule. Not always updated.
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
The raw attitude sensor data from @ref AHRSCommsModule. Not always updated.
|
||||
|
||||
generated from attituderaw.xml
|
||||
**/
|
||||
public class AttitudeRaw extends UAVDataObject {
|
||||
|
||||
public AttitudeRaw() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> magnetometersElemNames = new ArrayList<String>();
|
||||
magnetometersElemNames.add("X");
|
||||
magnetometersElemNames.add("Y");
|
||||
magnetometersElemNames.add("Z");
|
||||
fields.add( new UAVObjectField("magnetometers", "mGa", UAVObjectField.FieldType.INT16, magnetometersElemNames, null) );
|
||||
|
||||
List<String> gyrosElemNames = new ArrayList<String>();
|
||||
gyrosElemNames.add("X");
|
||||
gyrosElemNames.add("Y");
|
||||
gyrosElemNames.add("Z");
|
||||
fields.add( new UAVObjectField("gyros", "deg/s", UAVObjectField.FieldType.FLOAT32, gyrosElemNames, null) );
|
||||
|
||||
List<String> gyrotempElemNames = new ArrayList<String>();
|
||||
gyrotempElemNames.add("XY");
|
||||
gyrotempElemNames.add("Z");
|
||||
fields.add( new UAVObjectField("gyrotemp", "raw", UAVObjectField.FieldType.UINT16, gyrotempElemNames, null) );
|
||||
|
||||
List<String> accelsElemNames = new ArrayList<String>();
|
||||
accelsElemNames.add("X");
|
||||
accelsElemNames.add("Y");
|
||||
accelsElemNames.add("Z");
|
||||
fields.add( new UAVObjectField("accels", "m/s^2", UAVObjectField.FieldType.FLOAT32, accelsElemNames, null) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
|
||||
metadata.flightTelemetryUpdatePeriod = 1000;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.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.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
AttitudeRaw obj = new AttitudeRaw();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public AttitudeRaw GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (AttitudeRaw)(objMngr.getObject(AttitudeRaw.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0x37747DE6;
|
||||
protected static final String NAME = "AttitudeRaw";
|
||||
protected static String DESCRIPTION = "The raw attitude sensor data from @ref AHRSCommsModule. Not always updated.";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 0 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,159 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* Settings for the @ref Attitude module used on CopterControl
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
Settings for the @ref Attitude module used on CopterControl
|
||||
|
||||
generated from attitudesettings.xml
|
||||
**/
|
||||
public class AttitudeSettings extends UAVDataObject {
|
||||
|
||||
public AttitudeSettings() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> AccelBiasElemNames = new ArrayList<String>();
|
||||
AccelBiasElemNames.add("X");
|
||||
AccelBiasElemNames.add("Y");
|
||||
AccelBiasElemNames.add("Z");
|
||||
fields.add( new UAVObjectField("AccelBias", "lsb", UAVObjectField.FieldType.INT16, AccelBiasElemNames, null) );
|
||||
|
||||
List<String> GyroGainElemNames = new ArrayList<String>();
|
||||
GyroGainElemNames.add("0");
|
||||
fields.add( new UAVObjectField("GyroGain", "(rad/s)/lsb", UAVObjectField.FieldType.FLOAT32, GyroGainElemNames, null) );
|
||||
|
||||
List<String> AccelKpElemNames = new ArrayList<String>();
|
||||
AccelKpElemNames.add("0");
|
||||
fields.add( new UAVObjectField("AccelKp", "channel", UAVObjectField.FieldType.FLOAT32, AccelKpElemNames, null) );
|
||||
|
||||
List<String> AccelKiElemNames = new ArrayList<String>();
|
||||
AccelKiElemNames.add("0");
|
||||
fields.add( new UAVObjectField("AccelKi", "channel", UAVObjectField.FieldType.FLOAT32, AccelKiElemNames, null) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.TRUE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.TRUE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
|
||||
metadata.flightTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.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.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
getField("AccelBias").setValue(0,0);
|
||||
getField("AccelBias").setValue(0,1);
|
||||
getField("AccelBias").setValue(0,2);
|
||||
getField("GyroGain").setValue(0.42);
|
||||
getField("AccelKp").setValue(0.01);
|
||||
getField("AccelKi").setValue(0.0001);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
AttitudeSettings obj = new AttitudeSettings();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public AttitudeSettings GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (AttitudeSettings)(objMngr.getObject(AttitudeSettings.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0x327BF29A;
|
||||
protected static final String NAME = "AttitudeSettings";
|
||||
protected static String DESCRIPTION = "Settings for the @ref Attitude module used on CopterControl";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 1 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,147 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* The raw data from the barometric sensor with pressure, temperature and altitude estimate.
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
The raw data from the barometric sensor with pressure, temperature and altitude estimate.
|
||||
|
||||
generated from baroaltitude.xml
|
||||
**/
|
||||
public class BaroAltitude extends UAVDataObject {
|
||||
|
||||
public BaroAltitude() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> AltitudeElemNames = new ArrayList<String>();
|
||||
AltitudeElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Altitude", "m", UAVObjectField.FieldType.FLOAT32, AltitudeElemNames, null) );
|
||||
|
||||
List<String> TemperatureElemNames = new ArrayList<String>();
|
||||
TemperatureElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Temperature", "C", UAVObjectField.FieldType.FLOAT32, TemperatureElemNames, null) );
|
||||
|
||||
List<String> PressureElemNames = new ArrayList<String>();
|
||||
PressureElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Pressure", "kPa", UAVObjectField.FieldType.FLOAT32, PressureElemNames, null) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
|
||||
metadata.flightTelemetryUpdatePeriod = 1000;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.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.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
BaroAltitude obj = new BaroAltitude();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public BaroAltitude GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (BaroAltitude)(objMngr.getObject(BaroAltitude.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0xED4424F6;
|
||||
protected static final String NAME = "BaroAltitude";
|
||||
protected static String DESCRIPTION = "The raw data from the barometric sensor with pressure, temperature and altitude estimate.";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 0 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,163 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* Battery configuration information.
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
Battery configuration information.
|
||||
|
||||
generated from batterysettings.xml
|
||||
**/
|
||||
public class BatterySettings extends UAVDataObject {
|
||||
|
||||
public BatterySettings() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> BatteryVoltageElemNames = new ArrayList<String>();
|
||||
BatteryVoltageElemNames.add("0");
|
||||
fields.add( new UAVObjectField("BatteryVoltage", "V", UAVObjectField.FieldType.FLOAT32, BatteryVoltageElemNames, null) );
|
||||
|
||||
List<String> BatteryCapacityElemNames = new ArrayList<String>();
|
||||
BatteryCapacityElemNames.add("0");
|
||||
fields.add( new UAVObjectField("BatteryCapacity", "mAh", UAVObjectField.FieldType.UINT32, BatteryCapacityElemNames, null) );
|
||||
|
||||
List<String> BatteryTypeElemNames = new ArrayList<String>();
|
||||
BatteryTypeElemNames.add("0");
|
||||
List<String> BatteryTypeEnumOptions = new ArrayList<String>();
|
||||
BatteryTypeEnumOptions.add("LiPo");
|
||||
BatteryTypeEnumOptions.add("A123");
|
||||
BatteryTypeEnumOptions.add("LiCo");
|
||||
BatteryTypeEnumOptions.add("LiFeSO4");
|
||||
BatteryTypeEnumOptions.add("None");
|
||||
fields.add( new UAVObjectField("BatteryType", "", UAVObjectField.FieldType.ENUM, BatteryTypeElemNames, BatteryTypeEnumOptions) );
|
||||
|
||||
List<String> CalibrationsElemNames = new ArrayList<String>();
|
||||
CalibrationsElemNames.add("Voltage");
|
||||
CalibrationsElemNames.add("Current");
|
||||
fields.add( new UAVObjectField("Calibrations", "", UAVObjectField.FieldType.FLOAT32, CalibrationsElemNames, null) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.TRUE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.TRUE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
|
||||
metadata.flightTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.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.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
getField("BatteryVoltage").setValue(11.1);
|
||||
getField("BatteryCapacity").setValue(2200);
|
||||
getField("BatteryType").setValue(0);
|
||||
getField("Calibrations").setValue(1,0);
|
||||
getField("Calibrations").setValue(1,1);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
BatterySettings obj = new BatterySettings();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public BatterySettings GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (BatterySettings)(objMngr.getObject(BatterySettings.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0xA5FF1D9A;
|
||||
protected static final String NAME = "BatterySettings";
|
||||
protected static String DESCRIPTION = "Battery configuration information.";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 1 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,258 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* Firmware IAP
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
Firmware IAP
|
||||
|
||||
generated from firmwareiapobj.xml
|
||||
**/
|
||||
public class FirmwareIAPObj extends UAVDataObject {
|
||||
|
||||
public FirmwareIAPObj() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> CommandElemNames = new ArrayList<String>();
|
||||
CommandElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Command", "", UAVObjectField.FieldType.UINT16, CommandElemNames, null) );
|
||||
|
||||
List<String> DescriptionElemNames = new ArrayList<String>();
|
||||
DescriptionElemNames.add("0");
|
||||
DescriptionElemNames.add("1");
|
||||
DescriptionElemNames.add("2");
|
||||
DescriptionElemNames.add("3");
|
||||
DescriptionElemNames.add("4");
|
||||
DescriptionElemNames.add("5");
|
||||
DescriptionElemNames.add("6");
|
||||
DescriptionElemNames.add("7");
|
||||
DescriptionElemNames.add("8");
|
||||
DescriptionElemNames.add("9");
|
||||
DescriptionElemNames.add("10");
|
||||
DescriptionElemNames.add("11");
|
||||
DescriptionElemNames.add("12");
|
||||
DescriptionElemNames.add("13");
|
||||
DescriptionElemNames.add("14");
|
||||
DescriptionElemNames.add("15");
|
||||
DescriptionElemNames.add("16");
|
||||
DescriptionElemNames.add("17");
|
||||
DescriptionElemNames.add("18");
|
||||
DescriptionElemNames.add("19");
|
||||
DescriptionElemNames.add("20");
|
||||
DescriptionElemNames.add("21");
|
||||
DescriptionElemNames.add("22");
|
||||
DescriptionElemNames.add("23");
|
||||
DescriptionElemNames.add("24");
|
||||
DescriptionElemNames.add("25");
|
||||
DescriptionElemNames.add("26");
|
||||
DescriptionElemNames.add("27");
|
||||
DescriptionElemNames.add("28");
|
||||
DescriptionElemNames.add("29");
|
||||
DescriptionElemNames.add("30");
|
||||
DescriptionElemNames.add("31");
|
||||
DescriptionElemNames.add("32");
|
||||
DescriptionElemNames.add("33");
|
||||
DescriptionElemNames.add("34");
|
||||
DescriptionElemNames.add("35");
|
||||
DescriptionElemNames.add("36");
|
||||
DescriptionElemNames.add("37");
|
||||
DescriptionElemNames.add("38");
|
||||
DescriptionElemNames.add("39");
|
||||
DescriptionElemNames.add("40");
|
||||
DescriptionElemNames.add("41");
|
||||
DescriptionElemNames.add("42");
|
||||
DescriptionElemNames.add("43");
|
||||
DescriptionElemNames.add("44");
|
||||
DescriptionElemNames.add("45");
|
||||
DescriptionElemNames.add("46");
|
||||
DescriptionElemNames.add("47");
|
||||
DescriptionElemNames.add("48");
|
||||
DescriptionElemNames.add("49");
|
||||
DescriptionElemNames.add("50");
|
||||
DescriptionElemNames.add("51");
|
||||
DescriptionElemNames.add("52");
|
||||
DescriptionElemNames.add("53");
|
||||
DescriptionElemNames.add("54");
|
||||
DescriptionElemNames.add("55");
|
||||
DescriptionElemNames.add("56");
|
||||
DescriptionElemNames.add("57");
|
||||
DescriptionElemNames.add("58");
|
||||
DescriptionElemNames.add("59");
|
||||
DescriptionElemNames.add("60");
|
||||
DescriptionElemNames.add("61");
|
||||
DescriptionElemNames.add("62");
|
||||
DescriptionElemNames.add("63");
|
||||
DescriptionElemNames.add("64");
|
||||
DescriptionElemNames.add("65");
|
||||
DescriptionElemNames.add("66");
|
||||
DescriptionElemNames.add("67");
|
||||
DescriptionElemNames.add("68");
|
||||
DescriptionElemNames.add("69");
|
||||
DescriptionElemNames.add("70");
|
||||
DescriptionElemNames.add("71");
|
||||
DescriptionElemNames.add("72");
|
||||
DescriptionElemNames.add("73");
|
||||
DescriptionElemNames.add("74");
|
||||
DescriptionElemNames.add("75");
|
||||
DescriptionElemNames.add("76");
|
||||
DescriptionElemNames.add("77");
|
||||
DescriptionElemNames.add("78");
|
||||
DescriptionElemNames.add("79");
|
||||
DescriptionElemNames.add("80");
|
||||
DescriptionElemNames.add("81");
|
||||
DescriptionElemNames.add("82");
|
||||
DescriptionElemNames.add("83");
|
||||
DescriptionElemNames.add("84");
|
||||
DescriptionElemNames.add("85");
|
||||
DescriptionElemNames.add("86");
|
||||
DescriptionElemNames.add("87");
|
||||
DescriptionElemNames.add("88");
|
||||
DescriptionElemNames.add("89");
|
||||
DescriptionElemNames.add("90");
|
||||
DescriptionElemNames.add("91");
|
||||
DescriptionElemNames.add("92");
|
||||
DescriptionElemNames.add("93");
|
||||
DescriptionElemNames.add("94");
|
||||
DescriptionElemNames.add("95");
|
||||
DescriptionElemNames.add("96");
|
||||
DescriptionElemNames.add("97");
|
||||
DescriptionElemNames.add("98");
|
||||
DescriptionElemNames.add("99");
|
||||
fields.add( new UAVObjectField("Description", "", UAVObjectField.FieldType.UINT8, DescriptionElemNames, null) );
|
||||
|
||||
List<String> BoardRevisionElemNames = new ArrayList<String>();
|
||||
BoardRevisionElemNames.add("0");
|
||||
fields.add( new UAVObjectField("BoardRevision", "", UAVObjectField.FieldType.UINT16, BoardRevisionElemNames, null) );
|
||||
|
||||
List<String> BoardTypeElemNames = new ArrayList<String>();
|
||||
BoardTypeElemNames.add("0");
|
||||
fields.add( new UAVObjectField("BoardType", "", UAVObjectField.FieldType.UINT8, BoardTypeElemNames, null) );
|
||||
|
||||
List<String> ArmResetElemNames = new ArrayList<String>();
|
||||
ArmResetElemNames.add("0");
|
||||
fields.add( new UAVObjectField("ArmReset", "", UAVObjectField.FieldType.UINT8, ArmResetElemNames, null) );
|
||||
|
||||
List<String> crcElemNames = new ArrayList<String>();
|
||||
crcElemNames.add("0");
|
||||
fields.add( new UAVObjectField("crc", "", UAVObjectField.FieldType.UINT32, crcElemNames, null) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.TRUE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.TRUE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
|
||||
metadata.flightTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.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.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
FirmwareIAPObj obj = new FirmwareIAPObj();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public FirmwareIAPObj GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (FirmwareIAPObj)(objMngr.getObject(FirmwareIAPObj.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0x1A8ECC2;
|
||||
protected static final String NAME = "FirmwareIAPObj";
|
||||
protected static String DESCRIPTION = "Firmware IAP";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 0 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,165 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* Battery status information.
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
Battery status information.
|
||||
|
||||
generated from flightbatterystate.xml
|
||||
**/
|
||||
public class FlightBatteryState extends UAVDataObject {
|
||||
|
||||
public FlightBatteryState() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> VoltageElemNames = new ArrayList<String>();
|
||||
VoltageElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Voltage", "V", UAVObjectField.FieldType.FLOAT32, VoltageElemNames, null) );
|
||||
|
||||
List<String> CurrentElemNames = new ArrayList<String>();
|
||||
CurrentElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Current", "A", UAVObjectField.FieldType.FLOAT32, CurrentElemNames, null) );
|
||||
|
||||
List<String> PeakCurrentElemNames = new ArrayList<String>();
|
||||
PeakCurrentElemNames.add("0");
|
||||
fields.add( new UAVObjectField("PeakCurrent", "A", UAVObjectField.FieldType.FLOAT32, PeakCurrentElemNames, null) );
|
||||
|
||||
List<String> AvgCurrentElemNames = new ArrayList<String>();
|
||||
AvgCurrentElemNames.add("0");
|
||||
fields.add( new UAVObjectField("AvgCurrent", "A", UAVObjectField.FieldType.FLOAT32, AvgCurrentElemNames, null) );
|
||||
|
||||
List<String> ConsumedEnergyElemNames = new ArrayList<String>();
|
||||
ConsumedEnergyElemNames.add("0");
|
||||
fields.add( new UAVObjectField("ConsumedEnergy", "mAh", UAVObjectField.FieldType.FLOAT32, ConsumedEnergyElemNames, null) );
|
||||
|
||||
List<String> EstimatedFlightTimeElemNames = new ArrayList<String>();
|
||||
EstimatedFlightTimeElemNames.add("0");
|
||||
fields.add( new UAVObjectField("EstimatedFlightTime", "sec", UAVObjectField.FieldType.FLOAT32, EstimatedFlightTimeElemNames, null) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READONLY;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
|
||||
metadata.flightTelemetryUpdatePeriod = 1000;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.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.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
getField("Voltage").setValue(0);
|
||||
getField("Current").setValue(0);
|
||||
getField("PeakCurrent").setValue(0);
|
||||
getField("AvgCurrent").setValue(0);
|
||||
getField("ConsumedEnergy").setValue(0);
|
||||
getField("EstimatedFlightTime").setValue(0);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
FlightBatteryState obj = new FlightBatteryState();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public FlightBatteryState GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (FlightBatteryState)(objMngr.getObject(FlightBatteryState.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0x791A50E;
|
||||
protected static final String NAME = "FlightBatteryState";
|
||||
protected static String DESCRIPTION = "Battery status information.";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 0 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,144 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* Control the flight plan script
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
Control the flight plan script
|
||||
|
||||
generated from flightplancontrol.xml
|
||||
**/
|
||||
public class FlightPlanControl extends UAVDataObject {
|
||||
|
||||
public FlightPlanControl() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> CommandElemNames = new ArrayList<String>();
|
||||
CommandElemNames.add("0");
|
||||
List<String> CommandEnumOptions = new ArrayList<String>();
|
||||
CommandEnumOptions.add("Start");
|
||||
CommandEnumOptions.add("Stop");
|
||||
CommandEnumOptions.add("Kill");
|
||||
fields.add( new UAVObjectField("Command", "", UAVObjectField.FieldType.ENUM, CommandElemNames, CommandEnumOptions) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.TRUE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.TRUE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
|
||||
metadata.flightTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.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.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
getField("Command").setValue(0);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
FlightPlanControl obj = new FlightPlanControl();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public FlightPlanControl GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (FlightPlanControl)(objMngr.getObject(FlightPlanControl.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0x6B4FE6DA;
|
||||
protected static final String NAME = "FlightPlanControl";
|
||||
protected static String DESCRIPTION = "Control the flight plan script";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 0 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,140 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* Settings for the flight plan module, control the execution of the script
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
Settings for the flight plan module, control the execution of the script
|
||||
|
||||
generated from flightplansettings.xml
|
||||
**/
|
||||
public class FlightPlanSettings extends UAVDataObject {
|
||||
|
||||
public FlightPlanSettings() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> TestElemNames = new ArrayList<String>();
|
||||
TestElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Test", "", UAVObjectField.FieldType.FLOAT32, TestElemNames, null) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.TRUE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.TRUE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
|
||||
metadata.flightTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.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.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
getField("Test").setValue(0);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
FlightPlanSettings obj = new FlightPlanSettings();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public FlightPlanSettings GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (FlightPlanSettings)(objMngr.getObject(FlightPlanSettings.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0x85368422;
|
||||
protected static final String NAME = "FlightPlanSettings";
|
||||
protected static String DESCRIPTION = "Settings for the flight plan module, control the execution of the script";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 1 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,187 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* Status of the flight plan script
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
Status of the flight plan script
|
||||
|
||||
generated from flightplanstatus.xml
|
||||
**/
|
||||
public class FlightPlanStatus extends UAVDataObject {
|
||||
|
||||
public FlightPlanStatus() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> StatusElemNames = new ArrayList<String>();
|
||||
StatusElemNames.add("0");
|
||||
List<String> StatusEnumOptions = new ArrayList<String>();
|
||||
StatusEnumOptions.add("Stopped");
|
||||
StatusEnumOptions.add("Running");
|
||||
StatusEnumOptions.add("Error");
|
||||
fields.add( new UAVObjectField("Status", "", UAVObjectField.FieldType.ENUM, StatusElemNames, StatusEnumOptions) );
|
||||
|
||||
List<String> ErrorTypeElemNames = new ArrayList<String>();
|
||||
ErrorTypeElemNames.add("0");
|
||||
List<String> ErrorTypeEnumOptions = new ArrayList<String>();
|
||||
ErrorTypeEnumOptions.add("None");
|
||||
ErrorTypeEnumOptions.add("VMInitError");
|
||||
ErrorTypeEnumOptions.add("Exception");
|
||||
ErrorTypeEnumOptions.add("IOError");
|
||||
ErrorTypeEnumOptions.add("DivByZero");
|
||||
ErrorTypeEnumOptions.add("AssertError");
|
||||
ErrorTypeEnumOptions.add("AttributeError");
|
||||
ErrorTypeEnumOptions.add("ImportError");
|
||||
ErrorTypeEnumOptions.add("IndexError");
|
||||
ErrorTypeEnumOptions.add("KeyError");
|
||||
ErrorTypeEnumOptions.add("MemoryError");
|
||||
ErrorTypeEnumOptions.add("NameError");
|
||||
ErrorTypeEnumOptions.add("SyntaxError");
|
||||
ErrorTypeEnumOptions.add("SystemError");
|
||||
ErrorTypeEnumOptions.add("TypeError");
|
||||
ErrorTypeEnumOptions.add("ValueError");
|
||||
ErrorTypeEnumOptions.add("StopIteration");
|
||||
ErrorTypeEnumOptions.add("Warning");
|
||||
ErrorTypeEnumOptions.add("UnknownError");
|
||||
fields.add( new UAVObjectField("ErrorType", "", UAVObjectField.FieldType.ENUM, ErrorTypeElemNames, ErrorTypeEnumOptions) );
|
||||
|
||||
List<String> ErrorFileIDElemNames = new ArrayList<String>();
|
||||
ErrorFileIDElemNames.add("0");
|
||||
fields.add( new UAVObjectField("ErrorFileID", "", UAVObjectField.FieldType.UINT32, ErrorFileIDElemNames, null) );
|
||||
|
||||
List<String> ErrorLineNumElemNames = new ArrayList<String>();
|
||||
ErrorLineNumElemNames.add("0");
|
||||
fields.add( new UAVObjectField("ErrorLineNum", "", UAVObjectField.FieldType.UINT32, ErrorLineNumElemNames, null) );
|
||||
|
||||
List<String> Debug1ElemNames = new ArrayList<String>();
|
||||
Debug1ElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Debug1", "", UAVObjectField.FieldType.FLOAT32, Debug1ElemNames, null) );
|
||||
|
||||
List<String> Debug2ElemNames = new ArrayList<String>();
|
||||
Debug2ElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Debug2", "", UAVObjectField.FieldType.FLOAT32, Debug2ElemNames, null) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
|
||||
metadata.flightTelemetryUpdatePeriod = 2000;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.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.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
getField("Status").setValue(0);
|
||||
getField("ErrorType").setValue(0);
|
||||
getField("Debug1").setValue(0);
|
||||
getField("Debug2").setValue(0);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
FlightPlanStatus obj = new FlightPlanStatus();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public FlightPlanStatus GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (FlightPlanStatus)(objMngr.getObject(FlightPlanStatus.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0x9FC14812;
|
||||
protected static final String NAME = "FlightPlanStatus";
|
||||
protected static String DESCRIPTION = "Status of the flight plan script";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 0 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,164 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* Maintains the telemetry statistics from the OpenPilot flight computer.
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
Maintains the telemetry statistics from the OpenPilot flight computer.
|
||||
|
||||
generated from flighttelemetrystats.xml
|
||||
**/
|
||||
public class FlightTelemetryStats extends UAVDataObject {
|
||||
|
||||
public FlightTelemetryStats() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> StatusElemNames = new ArrayList<String>();
|
||||
StatusElemNames.add("0");
|
||||
List<String> StatusEnumOptions = new ArrayList<String>();
|
||||
StatusEnumOptions.add("Disconnected");
|
||||
StatusEnumOptions.add("HandshakeReq");
|
||||
StatusEnumOptions.add("HandshakeAck");
|
||||
StatusEnumOptions.add("Connected");
|
||||
fields.add( new UAVObjectField("Status", "", UAVObjectField.FieldType.ENUM, StatusElemNames, StatusEnumOptions) );
|
||||
|
||||
List<String> TxDataRateElemNames = new ArrayList<String>();
|
||||
TxDataRateElemNames.add("0");
|
||||
fields.add( new UAVObjectField("TxDataRate", "bytes/sec", UAVObjectField.FieldType.FLOAT32, TxDataRateElemNames, null) );
|
||||
|
||||
List<String> RxDataRateElemNames = new ArrayList<String>();
|
||||
RxDataRateElemNames.add("0");
|
||||
fields.add( new UAVObjectField("RxDataRate", "bytes/sec", UAVObjectField.FieldType.FLOAT32, RxDataRateElemNames, null) );
|
||||
|
||||
List<String> TxFailuresElemNames = new ArrayList<String>();
|
||||
TxFailuresElemNames.add("0");
|
||||
fields.add( new UAVObjectField("TxFailures", "count", UAVObjectField.FieldType.UINT32, TxFailuresElemNames, null) );
|
||||
|
||||
List<String> RxFailuresElemNames = new ArrayList<String>();
|
||||
RxFailuresElemNames.add("0");
|
||||
fields.add( new UAVObjectField("RxFailures", "count", UAVObjectField.FieldType.UINT32, RxFailuresElemNames, null) );
|
||||
|
||||
List<String> TxRetriesElemNames = new ArrayList<String>();
|
||||
TxRetriesElemNames.add("0");
|
||||
fields.add( new UAVObjectField("TxRetries", "count", UAVObjectField.FieldType.UINT32, TxRetriesElemNames, null) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.TRUE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.TRUE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
|
||||
metadata.flightTelemetryUpdatePeriod = 5000;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
|
||||
metadata.loggingUpdatePeriod = 5000;
|
||||
return metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize object fields with the default values.
|
||||
* If a default value is not specified the object fields
|
||||
* will be initialized to zero.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
FlightTelemetryStats obj = new FlightTelemetryStats();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public FlightTelemetryStats GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (FlightTelemetryStats)(objMngr.getObject(FlightTelemetryStats.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0x660C265E;
|
||||
protected static final String NAME = "FlightTelemetryStats";
|
||||
protected static String DESCRIPTION = "Maintains the telemetry statistics from the OpenPilot flight computer.";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 0 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,164 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* The telemetry statistics from the ground computer
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
The telemetry statistics from the ground computer
|
||||
|
||||
generated from gcstelemetrystats.xml
|
||||
**/
|
||||
public class GCSTelemetryStats extends UAVDataObject {
|
||||
|
||||
public GCSTelemetryStats() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> StatusElemNames = new ArrayList<String>();
|
||||
StatusElemNames.add("0");
|
||||
List<String> StatusEnumOptions = new ArrayList<String>();
|
||||
StatusEnumOptions.add("Disconnected");
|
||||
StatusEnumOptions.add("HandshakeReq");
|
||||
StatusEnumOptions.add("HandshakeAck");
|
||||
StatusEnumOptions.add("Connected");
|
||||
fields.add( new UAVObjectField("Status", "", UAVObjectField.FieldType.ENUM, StatusElemNames, StatusEnumOptions) );
|
||||
|
||||
List<String> TxDataRateElemNames = new ArrayList<String>();
|
||||
TxDataRateElemNames.add("0");
|
||||
fields.add( new UAVObjectField("TxDataRate", "bytes/sec", UAVObjectField.FieldType.FLOAT32, TxDataRateElemNames, null) );
|
||||
|
||||
List<String> RxDataRateElemNames = new ArrayList<String>();
|
||||
RxDataRateElemNames.add("0");
|
||||
fields.add( new UAVObjectField("RxDataRate", "bytes/sec", UAVObjectField.FieldType.FLOAT32, RxDataRateElemNames, null) );
|
||||
|
||||
List<String> TxFailuresElemNames = new ArrayList<String>();
|
||||
TxFailuresElemNames.add("0");
|
||||
fields.add( new UAVObjectField("TxFailures", "count", UAVObjectField.FieldType.UINT32, TxFailuresElemNames, null) );
|
||||
|
||||
List<String> RxFailuresElemNames = new ArrayList<String>();
|
||||
RxFailuresElemNames.add("0");
|
||||
fields.add( new UAVObjectField("RxFailures", "count", UAVObjectField.FieldType.UINT32, RxFailuresElemNames, null) );
|
||||
|
||||
List<String> TxRetriesElemNames = new ArrayList<String>();
|
||||
TxRetriesElemNames.add("0");
|
||||
fields.add( new UAVObjectField("TxRetries", "count", UAVObjectField.FieldType.UINT32, TxRetriesElemNames, null) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.TRUE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
|
||||
metadata.gcsTelemetryUpdatePeriod = 5000;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.TRUE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
|
||||
metadata.flightTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.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.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
GCSTelemetryStats obj = new GCSTelemetryStats();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public GCSTelemetryStats GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (GCSTelemetryStats)(objMngr.getObject(GCSTelemetryStats.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0x771E1046;
|
||||
protected static final String NAME = "GCSTelemetryStats";
|
||||
protected static String DESCRIPTION = "The telemetry statistics from the ground computer";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 0 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
184
androidgcs/src/org/openpilot/uavtalk/uavobjects/GPSPosition.java
Normal file
184
androidgcs/src/org/openpilot/uavtalk/uavobjects/GPSPosition.java
Normal file
@ -0,0 +1,184 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* Raw GPS data from @ref GPSModule. Should only be used by @ref AHRSCommsModule.
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
Raw GPS data from @ref GPSModule. Should only be used by @ref AHRSCommsModule.
|
||||
|
||||
generated from gpsposition.xml
|
||||
**/
|
||||
public class GPSPosition extends UAVDataObject {
|
||||
|
||||
public GPSPosition() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> StatusElemNames = new ArrayList<String>();
|
||||
StatusElemNames.add("0");
|
||||
List<String> StatusEnumOptions = new ArrayList<String>();
|
||||
StatusEnumOptions.add("NoGPS");
|
||||
StatusEnumOptions.add("NoFix");
|
||||
StatusEnumOptions.add("Fix2D");
|
||||
StatusEnumOptions.add("Fix3D");
|
||||
fields.add( new UAVObjectField("Status", "", UAVObjectField.FieldType.ENUM, StatusElemNames, StatusEnumOptions) );
|
||||
|
||||
List<String> LatitudeElemNames = new ArrayList<String>();
|
||||
LatitudeElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Latitude", "degrees x 10^-7", UAVObjectField.FieldType.INT32, LatitudeElemNames, null) );
|
||||
|
||||
List<String> LongitudeElemNames = new ArrayList<String>();
|
||||
LongitudeElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Longitude", "degrees x 10^-7", UAVObjectField.FieldType.INT32, LongitudeElemNames, null) );
|
||||
|
||||
List<String> AltitudeElemNames = new ArrayList<String>();
|
||||
AltitudeElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Altitude", "meters", UAVObjectField.FieldType.FLOAT32, AltitudeElemNames, null) );
|
||||
|
||||
List<String> GeoidSeparationElemNames = new ArrayList<String>();
|
||||
GeoidSeparationElemNames.add("0");
|
||||
fields.add( new UAVObjectField("GeoidSeparation", "meters", UAVObjectField.FieldType.FLOAT32, GeoidSeparationElemNames, null) );
|
||||
|
||||
List<String> HeadingElemNames = new ArrayList<String>();
|
||||
HeadingElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Heading", "degrees", UAVObjectField.FieldType.FLOAT32, HeadingElemNames, null) );
|
||||
|
||||
List<String> GroundspeedElemNames = new ArrayList<String>();
|
||||
GroundspeedElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Groundspeed", "m/s", UAVObjectField.FieldType.FLOAT32, GroundspeedElemNames, null) );
|
||||
|
||||
List<String> SatellitesElemNames = new ArrayList<String>();
|
||||
SatellitesElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Satellites", "", UAVObjectField.FieldType.INT8, SatellitesElemNames, null) );
|
||||
|
||||
List<String> PDOPElemNames = new ArrayList<String>();
|
||||
PDOPElemNames.add("0");
|
||||
fields.add( new UAVObjectField("PDOP", "", UAVObjectField.FieldType.FLOAT32, PDOPElemNames, null) );
|
||||
|
||||
List<String> HDOPElemNames = new ArrayList<String>();
|
||||
HDOPElemNames.add("0");
|
||||
fields.add( new UAVObjectField("HDOP", "", UAVObjectField.FieldType.FLOAT32, HDOPElemNames, null) );
|
||||
|
||||
List<String> VDOPElemNames = new ArrayList<String>();
|
||||
VDOPElemNames.add("0");
|
||||
fields.add( new UAVObjectField("VDOP", "", UAVObjectField.FieldType.FLOAT32, VDOPElemNames, null) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
|
||||
metadata.flightTelemetryUpdatePeriod = 1000;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
|
||||
metadata.loggingUpdatePeriod = 1000;
|
||||
return metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize object fields with the default values.
|
||||
* If a default value is not specified the object fields
|
||||
* will be initialized to zero.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
GPSPosition obj = new GPSPosition();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public GPSPosition GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (GPSPosition)(objMngr.getObject(GPSPosition.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0xB5495042;
|
||||
protected static final String NAME = "GPSPosition";
|
||||
protected static String DESCRIPTION = "Raw GPS data from @ref GPSModule. Should only be used by @ref AHRSCommsModule.";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 0 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,215 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* Contains information about the GPS satellites in view from @ref GPSModule.
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
Contains information about the GPS satellites in view from @ref GPSModule.
|
||||
|
||||
generated from gpssatellites.xml
|
||||
**/
|
||||
public class GPSSatellites extends UAVDataObject {
|
||||
|
||||
public GPSSatellites() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> SatsInViewElemNames = new ArrayList<String>();
|
||||
SatsInViewElemNames.add("0");
|
||||
fields.add( new UAVObjectField("SatsInView", "", UAVObjectField.FieldType.INT8, SatsInViewElemNames, null) );
|
||||
|
||||
List<String> PRNElemNames = new ArrayList<String>();
|
||||
PRNElemNames.add("0");
|
||||
PRNElemNames.add("1");
|
||||
PRNElemNames.add("2");
|
||||
PRNElemNames.add("3");
|
||||
PRNElemNames.add("4");
|
||||
PRNElemNames.add("5");
|
||||
PRNElemNames.add("6");
|
||||
PRNElemNames.add("7");
|
||||
PRNElemNames.add("8");
|
||||
PRNElemNames.add("9");
|
||||
PRNElemNames.add("10");
|
||||
PRNElemNames.add("11");
|
||||
PRNElemNames.add("12");
|
||||
PRNElemNames.add("13");
|
||||
PRNElemNames.add("14");
|
||||
PRNElemNames.add("15");
|
||||
fields.add( new UAVObjectField("PRN", "", UAVObjectField.FieldType.INT8, PRNElemNames, null) );
|
||||
|
||||
List<String> ElevationElemNames = new ArrayList<String>();
|
||||
ElevationElemNames.add("0");
|
||||
ElevationElemNames.add("1");
|
||||
ElevationElemNames.add("2");
|
||||
ElevationElemNames.add("3");
|
||||
ElevationElemNames.add("4");
|
||||
ElevationElemNames.add("5");
|
||||
ElevationElemNames.add("6");
|
||||
ElevationElemNames.add("7");
|
||||
ElevationElemNames.add("8");
|
||||
ElevationElemNames.add("9");
|
||||
ElevationElemNames.add("10");
|
||||
ElevationElemNames.add("11");
|
||||
ElevationElemNames.add("12");
|
||||
ElevationElemNames.add("13");
|
||||
ElevationElemNames.add("14");
|
||||
ElevationElemNames.add("15");
|
||||
fields.add( new UAVObjectField("Elevation", "degrees", UAVObjectField.FieldType.FLOAT32, ElevationElemNames, null) );
|
||||
|
||||
List<String> AzimuthElemNames = new ArrayList<String>();
|
||||
AzimuthElemNames.add("0");
|
||||
AzimuthElemNames.add("1");
|
||||
AzimuthElemNames.add("2");
|
||||
AzimuthElemNames.add("3");
|
||||
AzimuthElemNames.add("4");
|
||||
AzimuthElemNames.add("5");
|
||||
AzimuthElemNames.add("6");
|
||||
AzimuthElemNames.add("7");
|
||||
AzimuthElemNames.add("8");
|
||||
AzimuthElemNames.add("9");
|
||||
AzimuthElemNames.add("10");
|
||||
AzimuthElemNames.add("11");
|
||||
AzimuthElemNames.add("12");
|
||||
AzimuthElemNames.add("13");
|
||||
AzimuthElemNames.add("14");
|
||||
AzimuthElemNames.add("15");
|
||||
fields.add( new UAVObjectField("Azimuth", "degrees", UAVObjectField.FieldType.FLOAT32, AzimuthElemNames, null) );
|
||||
|
||||
List<String> SNRElemNames = new ArrayList<String>();
|
||||
SNRElemNames.add("0");
|
||||
SNRElemNames.add("1");
|
||||
SNRElemNames.add("2");
|
||||
SNRElemNames.add("3");
|
||||
SNRElemNames.add("4");
|
||||
SNRElemNames.add("5");
|
||||
SNRElemNames.add("6");
|
||||
SNRElemNames.add("7");
|
||||
SNRElemNames.add("8");
|
||||
SNRElemNames.add("9");
|
||||
SNRElemNames.add("10");
|
||||
SNRElemNames.add("11");
|
||||
SNRElemNames.add("12");
|
||||
SNRElemNames.add("13");
|
||||
SNRElemNames.add("14");
|
||||
SNRElemNames.add("15");
|
||||
fields.add( new UAVObjectField("SNR", "", UAVObjectField.FieldType.INT8, SNRElemNames, null) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
|
||||
metadata.flightTelemetryUpdatePeriod = 10000;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
|
||||
metadata.loggingUpdatePeriod = 30000;
|
||||
return metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize object fields with the default values.
|
||||
* If a default value is not specified the object fields
|
||||
* will be initialized to zero.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
GPSSatellites obj = new GPSSatellites();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public GPSSatellites GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (GPSSatellites)(objMngr.getObject(GPSSatellites.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0xD62FA3AE;
|
||||
protected static final String NAME = "GPSSatellites";
|
||||
protected static String DESCRIPTION = "Contains information about the GPS satellites in view from @ref GPSModule.";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 0 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
159
androidgcs/src/org/openpilot/uavtalk/uavobjects/GPSTime.java
Normal file
159
androidgcs/src/org/openpilot/uavtalk/uavobjects/GPSTime.java
Normal file
@ -0,0 +1,159 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* Contains the GPS time from @ref GPSModule. Required to compute the world magnetic model correctly when setting the home location.
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
Contains the GPS time from @ref GPSModule. Required to compute the world magnetic model correctly when setting the home location.
|
||||
|
||||
generated from gpstime.xml
|
||||
**/
|
||||
public class GPSTime extends UAVDataObject {
|
||||
|
||||
public GPSTime() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> MonthElemNames = new ArrayList<String>();
|
||||
MonthElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Month", "", UAVObjectField.FieldType.INT8, MonthElemNames, null) );
|
||||
|
||||
List<String> DayElemNames = new ArrayList<String>();
|
||||
DayElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Day", "", UAVObjectField.FieldType.INT8, DayElemNames, null) );
|
||||
|
||||
List<String> YearElemNames = new ArrayList<String>();
|
||||
YearElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Year", "", UAVObjectField.FieldType.INT16, YearElemNames, null) );
|
||||
|
||||
List<String> HourElemNames = new ArrayList<String>();
|
||||
HourElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Hour", "", UAVObjectField.FieldType.INT8, HourElemNames, null) );
|
||||
|
||||
List<String> MinuteElemNames = new ArrayList<String>();
|
||||
MinuteElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Minute", "", UAVObjectField.FieldType.INT8, MinuteElemNames, null) );
|
||||
|
||||
List<String> SecondElemNames = new ArrayList<String>();
|
||||
SecondElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Second", "", UAVObjectField.FieldType.INT8, SecondElemNames, null) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
|
||||
metadata.flightTelemetryUpdatePeriod = 10000;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
|
||||
metadata.loggingUpdatePeriod = 30000;
|
||||
return metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize object fields with the default values.
|
||||
* If a default value is not specified the object fields
|
||||
* will be initialized to zero.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
GPSTime obj = new GPSTime();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public GPSTime GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (GPSTime)(objMngr.getObject(GPSTime.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0x56FFF0A2;
|
||||
protected static final String NAME = "GPSTime";
|
||||
protected static String DESCRIPTION = "Contains the GPS time from @ref GPSModule. Required to compute the world magnetic model correctly when setting the home location.";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 0 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,197 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* Settings for the @ref GuidanceModule
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
Settings for the @ref GuidanceModule
|
||||
|
||||
generated from guidancesettings.xml
|
||||
**/
|
||||
public class GuidanceSettings extends UAVDataObject {
|
||||
|
||||
public GuidanceSettings() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> GuidanceModeElemNames = new ArrayList<String>();
|
||||
GuidanceModeElemNames.add("0");
|
||||
List<String> GuidanceModeEnumOptions = new ArrayList<String>();
|
||||
GuidanceModeEnumOptions.add("DUAL_LOOP");
|
||||
GuidanceModeEnumOptions.add("VELOCITY_CONTROL");
|
||||
fields.add( new UAVObjectField("GuidanceMode", "", UAVObjectField.FieldType.ENUM, GuidanceModeElemNames, GuidanceModeEnumOptions) );
|
||||
|
||||
List<String> HorizontalPElemNames = new ArrayList<String>();
|
||||
HorizontalPElemNames.add("Kp");
|
||||
HorizontalPElemNames.add("Max");
|
||||
fields.add( new UAVObjectField("HorizontalP", "", UAVObjectField.FieldType.FLOAT32, HorizontalPElemNames, null) );
|
||||
|
||||
List<String> HorizontalVelPIDElemNames = new ArrayList<String>();
|
||||
HorizontalVelPIDElemNames.add("Kp");
|
||||
HorizontalVelPIDElemNames.add("Ki");
|
||||
HorizontalVelPIDElemNames.add("Kd");
|
||||
HorizontalVelPIDElemNames.add("ILimit");
|
||||
fields.add( new UAVObjectField("HorizontalVelPID", "", UAVObjectField.FieldType.FLOAT32, HorizontalVelPIDElemNames, null) );
|
||||
|
||||
List<String> VerticalPElemNames = new ArrayList<String>();
|
||||
VerticalPElemNames.add("Kp");
|
||||
VerticalPElemNames.add("Max");
|
||||
fields.add( new UAVObjectField("VerticalP", "", UAVObjectField.FieldType.FLOAT32, VerticalPElemNames, null) );
|
||||
|
||||
List<String> VerticalVelPIDElemNames = new ArrayList<String>();
|
||||
VerticalVelPIDElemNames.add("Kp");
|
||||
VerticalVelPIDElemNames.add("Ki");
|
||||
VerticalVelPIDElemNames.add("Kd");
|
||||
VerticalVelPIDElemNames.add("ILimit");
|
||||
fields.add( new UAVObjectField("VerticalVelPID", "", UAVObjectField.FieldType.FLOAT32, VerticalVelPIDElemNames, null) );
|
||||
|
||||
List<String> ThrottleControlElemNames = new ArrayList<String>();
|
||||
ThrottleControlElemNames.add("0");
|
||||
List<String> ThrottleControlEnumOptions = new ArrayList<String>();
|
||||
ThrottleControlEnumOptions.add("FALSE");
|
||||
ThrottleControlEnumOptions.add("TRUE");
|
||||
fields.add( new UAVObjectField("ThrottleControl", "", UAVObjectField.FieldType.ENUM, ThrottleControlElemNames, ThrottleControlEnumOptions) );
|
||||
|
||||
List<String> MaxRollPitchElemNames = new ArrayList<String>();
|
||||
MaxRollPitchElemNames.add("0");
|
||||
fields.add( new UAVObjectField("MaxRollPitch", "deg", UAVObjectField.FieldType.FLOAT32, MaxRollPitchElemNames, null) );
|
||||
|
||||
List<String> UpdatePeriodElemNames = new ArrayList<String>();
|
||||
UpdatePeriodElemNames.add("0");
|
||||
fields.add( new UAVObjectField("UpdatePeriod", "", UAVObjectField.FieldType.INT32, UpdatePeriodElemNames, null) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.TRUE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.TRUE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
|
||||
metadata.flightTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.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.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
getField("GuidanceMode").setValue(0);
|
||||
getField("HorizontalP").setValue(0.2,0);
|
||||
getField("HorizontalP").setValue(150,1);
|
||||
getField("HorizontalVelPID").setValue(0.1,0);
|
||||
getField("HorizontalVelPID").setValue(0.002,1);
|
||||
getField("HorizontalVelPID").setValue(0,2);
|
||||
getField("HorizontalVelPID").setValue(1000,3);
|
||||
getField("VerticalP").setValue(0.1,0);
|
||||
getField("VerticalP").setValue(200,1);
|
||||
getField("VerticalVelPID").setValue(0.1,0);
|
||||
getField("VerticalVelPID").setValue(0,1);
|
||||
getField("VerticalVelPID").setValue(0,2);
|
||||
getField("VerticalVelPID").setValue(0,3);
|
||||
getField("ThrottleControl").setValue(0);
|
||||
getField("MaxRollPitch").setValue(10);
|
||||
getField("UpdatePeriod").setValue(100);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
GuidanceSettings obj = new GuidanceSettings();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public GuidanceSettings GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (GuidanceSettings)(objMngr.getObject(GuidanceSettings.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0x74740AA2;
|
||||
protected static final String NAME = "GuidanceSettings";
|
||||
protected static String DESCRIPTION = "Settings for the @ref GuidanceModule";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 1 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,197 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* HomeLocation setting which contains the constants to tranlate from longitutde and latitude to NED reference frame. Automatically set by @ref GPSModule after acquiring a 3D lock. Used by @ref AHRSCommsModule.
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
HomeLocation setting which contains the constants to tranlate from longitutde and latitude to NED reference frame. Automatically set by @ref GPSModule after acquiring a 3D lock. Used by @ref AHRSCommsModule.
|
||||
|
||||
generated from homelocation.xml
|
||||
**/
|
||||
public class HomeLocation extends UAVDataObject {
|
||||
|
||||
public HomeLocation() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> SetElemNames = new ArrayList<String>();
|
||||
SetElemNames.add("0");
|
||||
List<String> SetEnumOptions = new ArrayList<String>();
|
||||
SetEnumOptions.add("FALSE");
|
||||
SetEnumOptions.add("TRUE");
|
||||
fields.add( new UAVObjectField("Set", "", UAVObjectField.FieldType.ENUM, SetElemNames, SetEnumOptions) );
|
||||
|
||||
List<String> LatitudeElemNames = new ArrayList<String>();
|
||||
LatitudeElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Latitude", "deg * 10e6", UAVObjectField.FieldType.INT32, LatitudeElemNames, null) );
|
||||
|
||||
List<String> LongitudeElemNames = new ArrayList<String>();
|
||||
LongitudeElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Longitude", "deg * 10e6", UAVObjectField.FieldType.INT32, LongitudeElemNames, null) );
|
||||
|
||||
List<String> AltitudeElemNames = new ArrayList<String>();
|
||||
AltitudeElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Altitude", "m over geoid", UAVObjectField.FieldType.FLOAT32, AltitudeElemNames, null) );
|
||||
|
||||
List<String> ECEFElemNames = new ArrayList<String>();
|
||||
ECEFElemNames.add("0");
|
||||
ECEFElemNames.add("1");
|
||||
ECEFElemNames.add("2");
|
||||
fields.add( new UAVObjectField("ECEF", "cm", UAVObjectField.FieldType.INT32, ECEFElemNames, null) );
|
||||
|
||||
List<String> RNEElemNames = new ArrayList<String>();
|
||||
RNEElemNames.add("0");
|
||||
RNEElemNames.add("1");
|
||||
RNEElemNames.add("2");
|
||||
RNEElemNames.add("3");
|
||||
RNEElemNames.add("4");
|
||||
RNEElemNames.add("5");
|
||||
RNEElemNames.add("6");
|
||||
RNEElemNames.add("7");
|
||||
RNEElemNames.add("8");
|
||||
fields.add( new UAVObjectField("RNE", "", UAVObjectField.FieldType.FLOAT32, RNEElemNames, null) );
|
||||
|
||||
List<String> BeElemNames = new ArrayList<String>();
|
||||
BeElemNames.add("0");
|
||||
BeElemNames.add("1");
|
||||
BeElemNames.add("2");
|
||||
fields.add( new UAVObjectField("Be", "", UAVObjectField.FieldType.FLOAT32, BeElemNames, null) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.TRUE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.TRUE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
|
||||
metadata.flightTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.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.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
getField("Set").setValue(0);
|
||||
getField("Latitude").setValue(0);
|
||||
getField("Longitude").setValue(0);
|
||||
getField("Altitude").setValue(0);
|
||||
getField("ECEF").setValue(0,0);
|
||||
getField("ECEF").setValue(0,1);
|
||||
getField("ECEF").setValue(0,2);
|
||||
getField("RNE").setValue(0,0);
|
||||
getField("RNE").setValue(0,1);
|
||||
getField("RNE").setValue(0,2);
|
||||
getField("RNE").setValue(0,3);
|
||||
getField("RNE").setValue(0,4);
|
||||
getField("RNE").setValue(0,5);
|
||||
getField("RNE").setValue(0,6);
|
||||
getField("RNE").setValue(0,7);
|
||||
getField("RNE").setValue(0,8);
|
||||
getField("Be").setValue(0,0);
|
||||
getField("Be").setValue(0,1);
|
||||
getField("Be").setValue(0,2);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
HomeLocation obj = new HomeLocation();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public HomeLocation GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (HomeLocation)(objMngr.getObject(HomeLocation.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0xD6008ED2;
|
||||
protected static final String NAME = "HomeLocation";
|
||||
protected static String DESCRIPTION = "HomeLocation setting which contains the constants to tranlate from longitutde and latitude to NED reference frame. Automatically set by @ref GPSModule after acquiring a 3D lock. Used by @ref AHRSCommsModule.";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 1 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
238
androidgcs/src/org/openpilot/uavtalk/uavobjects/I2CStats.java
Normal file
238
androidgcs/src/org/openpilot/uavtalk/uavobjects/I2CStats.java
Normal file
@ -0,0 +1,238 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* Tracks statistics on the I2C bus.
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
Tracks statistics on the I2C bus.
|
||||
|
||||
generated from i2cstats.xml
|
||||
**/
|
||||
public class I2CStats extends UAVDataObject {
|
||||
|
||||
public I2CStats() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> event_errorsElemNames = new ArrayList<String>();
|
||||
event_errorsElemNames.add("0");
|
||||
fields.add( new UAVObjectField("event_errors", "", UAVObjectField.FieldType.UINT8, event_errorsElemNames, null) );
|
||||
|
||||
List<String> fsm_errorsElemNames = new ArrayList<String>();
|
||||
fsm_errorsElemNames.add("0");
|
||||
fields.add( new UAVObjectField("fsm_errors", "", UAVObjectField.FieldType.UINT8, fsm_errorsElemNames, null) );
|
||||
|
||||
List<String> irq_errorsElemNames = new ArrayList<String>();
|
||||
irq_errorsElemNames.add("0");
|
||||
fields.add( new UAVObjectField("irq_errors", "", UAVObjectField.FieldType.UINT8, irq_errorsElemNames, null) );
|
||||
|
||||
List<String> nacksElemNames = new ArrayList<String>();
|
||||
nacksElemNames.add("0");
|
||||
fields.add( new UAVObjectField("nacks", "", UAVObjectField.FieldType.UINT8, nacksElemNames, null) );
|
||||
|
||||
List<String> timeoutsElemNames = new ArrayList<String>();
|
||||
timeoutsElemNames.add("0");
|
||||
fields.add( new UAVObjectField("timeouts", "", UAVObjectField.FieldType.UINT8, timeoutsElemNames, null) );
|
||||
|
||||
List<String> last_error_typeElemNames = new ArrayList<String>();
|
||||
last_error_typeElemNames.add("0");
|
||||
List<String> last_error_typeEnumOptions = new ArrayList<String>();
|
||||
last_error_typeEnumOptions.add("EVENT");
|
||||
last_error_typeEnumOptions.add("FSM");
|
||||
last_error_typeEnumOptions.add("INTERRUPT");
|
||||
fields.add( new UAVObjectField("last_error_type", "", UAVObjectField.FieldType.ENUM, last_error_typeElemNames, last_error_typeEnumOptions) );
|
||||
|
||||
List<String> evirq_logElemNames = new ArrayList<String>();
|
||||
evirq_logElemNames.add("0");
|
||||
evirq_logElemNames.add("1");
|
||||
evirq_logElemNames.add("2");
|
||||
evirq_logElemNames.add("3");
|
||||
evirq_logElemNames.add("4");
|
||||
fields.add( new UAVObjectField("evirq_log", "", UAVObjectField.FieldType.UINT32, evirq_logElemNames, null) );
|
||||
|
||||
List<String> erirq_logElemNames = new ArrayList<String>();
|
||||
erirq_logElemNames.add("0");
|
||||
erirq_logElemNames.add("1");
|
||||
erirq_logElemNames.add("2");
|
||||
erirq_logElemNames.add("3");
|
||||
erirq_logElemNames.add("4");
|
||||
fields.add( new UAVObjectField("erirq_log", "", UAVObjectField.FieldType.UINT32, erirq_logElemNames, null) );
|
||||
|
||||
List<String> event_logElemNames = new ArrayList<String>();
|
||||
event_logElemNames.add("0");
|
||||
event_logElemNames.add("1");
|
||||
event_logElemNames.add("2");
|
||||
event_logElemNames.add("3");
|
||||
event_logElemNames.add("4");
|
||||
List<String> event_logEnumOptions = new ArrayList<String>();
|
||||
event_logEnumOptions.add("I2C_EVENT_BUS_ERROR");
|
||||
event_logEnumOptions.add("I2C_EVENT_START");
|
||||
event_logEnumOptions.add("I2C_EVENT_STARTED_MORE_TXN_READ");
|
||||
event_logEnumOptions.add("I2C_EVENT_STARTED_MORE_TXN_WRITE");
|
||||
event_logEnumOptions.add("I2C_EVENT_STARTED_LAST_TXN_READ");
|
||||
event_logEnumOptions.add("I2C_EVENT_STARTED_LAST_TXN_WRITE");
|
||||
event_logEnumOptions.add("I2C_EVENT_ADDR_SENT_LEN_EQ_0");
|
||||
event_logEnumOptions.add("I2C_EVENT_ADDR_SENT_LEN_EQ_1");
|
||||
event_logEnumOptions.add("I2C_EVENT_ADDR_SENT_LEN_EQ_2");
|
||||
event_logEnumOptions.add("I2C_EVENT_ADDR_SENT_LEN_GT_2");
|
||||
event_logEnumOptions.add("I2C_EVENT_TRANSFER_DONE_LEN_EQ_0");
|
||||
event_logEnumOptions.add("I2C_EVENT_TRANSFER_DONE_LEN_EQ_1");
|
||||
event_logEnumOptions.add("I2C_EVENT_TRANSFER_DONE_LEN_EQ_2");
|
||||
event_logEnumOptions.add("I2C_EVENT_TRANSFER_DONE_LEN_GT_2");
|
||||
event_logEnumOptions.add("I2C_EVENT_NACK");
|
||||
event_logEnumOptions.add("I2C_EVENT_STOPPED");
|
||||
event_logEnumOptions.add("I2C_EVENT_AUTO");
|
||||
fields.add( new UAVObjectField("event_log", "", UAVObjectField.FieldType.ENUM, event_logElemNames, event_logEnumOptions) );
|
||||
|
||||
List<String> state_logElemNames = new ArrayList<String>();
|
||||
state_logElemNames.add("0");
|
||||
state_logElemNames.add("1");
|
||||
state_logElemNames.add("2");
|
||||
state_logElemNames.add("3");
|
||||
state_logElemNames.add("4");
|
||||
List<String> state_logEnumOptions = new ArrayList<String>();
|
||||
state_logEnumOptions.add("I2C_STATE_FSM_FAULT");
|
||||
state_logEnumOptions.add("I2C_STATE_BUS_ERROR");
|
||||
state_logEnumOptions.add("I2C_STATE_STOPPED");
|
||||
state_logEnumOptions.add("I2C_STATE_STOPPING");
|
||||
state_logEnumOptions.add("I2C_STATE_STARTING");
|
||||
state_logEnumOptions.add("I2C_STATE_R_MORE_TXN_ADDR");
|
||||
state_logEnumOptions.add("I2C_STATE_R_MORE_TXN_PRE_ONE");
|
||||
state_logEnumOptions.add("I2C_STATE_R_MORE_TXN_PRE_FIRST");
|
||||
state_logEnumOptions.add("I2C_STATE_R_MORE_TXN_PRE_MIDDLE");
|
||||
state_logEnumOptions.add("I2C_STATE_R_MORE_TXN_LAST");
|
||||
state_logEnumOptions.add("I2C_STATE_R_MORE_TXN_POST_LAST");
|
||||
state_logEnumOptions.add("R_LAST_TXN_ADDR");
|
||||
state_logEnumOptions.add("I2C_STATE_R_LAST_TXN_PRE_ONE");
|
||||
state_logEnumOptions.add("I2C_STATE_R_LAST_TXN_PRE_FIRST");
|
||||
state_logEnumOptions.add("I2C_STATE_R_LAST_TXN_PRE_MIDDLE");
|
||||
state_logEnumOptions.add("I2C_STATE_R_LAST_TXN_PRE_LAST");
|
||||
state_logEnumOptions.add("I2C_STATE_R_LAST_TXN_POST_LAST");
|
||||
state_logEnumOptions.add("I2C_STATE_W_MORE_TXN_ADDR");
|
||||
state_logEnumOptions.add("I2C_STATE_W_MORE_TXN_MIDDLE");
|
||||
state_logEnumOptions.add("I2C_STATE_W_MORE_TXN_LAST");
|
||||
state_logEnumOptions.add("I2C_STATE_W_LAST_TXN_ADDR");
|
||||
state_logEnumOptions.add("I2C_STATE_W_LAST_TXN_MIDDLE");
|
||||
state_logEnumOptions.add("I2C_STATE_W_LAST_TXN_LAST");
|
||||
state_logEnumOptions.add("I2C_STATE_NACK");
|
||||
fields.add( new UAVObjectField("state_log", "", UAVObjectField.FieldType.ENUM, state_logElemNames, state_logEnumOptions) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
|
||||
metadata.flightTelemetryUpdatePeriod = 10000;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
|
||||
metadata.loggingUpdatePeriod = 30000;
|
||||
return metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize object fields with the default values.
|
||||
* If a default value is not specified the object fields
|
||||
* will be initialized to zero.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
I2CStats obj = new I2CStats();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public I2CStats GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (I2CStats)(objMngr.getObject(I2CStats.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0x23CE9E9C;
|
||||
protected static final String NAME = "I2CStats";
|
||||
protected static String DESCRIPTION = "Tracks statistics on the I2C bus.";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 0 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,199 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* The output from the @ref ManualControlModule which descodes the receiver inputs. Overriden by GCS for fly-by-wire control.
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
The output from the @ref ManualControlModule which descodes the receiver inputs. Overriden by GCS for fly-by-wire control.
|
||||
|
||||
generated from manualcontrolcommand.xml
|
||||
**/
|
||||
public class ManualControlCommand extends UAVDataObject {
|
||||
|
||||
public ManualControlCommand() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> ConnectedElemNames = new ArrayList<String>();
|
||||
ConnectedElemNames.add("0");
|
||||
List<String> ConnectedEnumOptions = new ArrayList<String>();
|
||||
ConnectedEnumOptions.add("False");
|
||||
ConnectedEnumOptions.add("True");
|
||||
fields.add( new UAVObjectField("Connected", "", UAVObjectField.FieldType.ENUM, ConnectedElemNames, ConnectedEnumOptions) );
|
||||
|
||||
List<String> ArmedElemNames = new ArrayList<String>();
|
||||
ArmedElemNames.add("0");
|
||||
List<String> ArmedEnumOptions = new ArrayList<String>();
|
||||
ArmedEnumOptions.add("False");
|
||||
ArmedEnumOptions.add("True");
|
||||
fields.add( new UAVObjectField("Armed", "", UAVObjectField.FieldType.ENUM, ArmedElemNames, ArmedEnumOptions) );
|
||||
|
||||
List<String> RollElemNames = new ArrayList<String>();
|
||||
RollElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Roll", "%", UAVObjectField.FieldType.FLOAT32, RollElemNames, null) );
|
||||
|
||||
List<String> PitchElemNames = new ArrayList<String>();
|
||||
PitchElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Pitch", "%", UAVObjectField.FieldType.FLOAT32, PitchElemNames, null) );
|
||||
|
||||
List<String> YawElemNames = new ArrayList<String>();
|
||||
YawElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Yaw", "%", UAVObjectField.FieldType.FLOAT32, YawElemNames, null) );
|
||||
|
||||
List<String> ThrottleElemNames = new ArrayList<String>();
|
||||
ThrottleElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Throttle", "%", UAVObjectField.FieldType.FLOAT32, ThrottleElemNames, null) );
|
||||
|
||||
List<String> FlightModeElemNames = new ArrayList<String>();
|
||||
FlightModeElemNames.add("0");
|
||||
List<String> FlightModeEnumOptions = new ArrayList<String>();
|
||||
FlightModeEnumOptions.add("Manual");
|
||||
FlightModeEnumOptions.add("Stabilized1");
|
||||
FlightModeEnumOptions.add("Stabilized2");
|
||||
FlightModeEnumOptions.add("Stabilized3");
|
||||
FlightModeEnumOptions.add("VelocityControl");
|
||||
FlightModeEnumOptions.add("PositionHold");
|
||||
fields.add( new UAVObjectField("FlightMode", "", UAVObjectField.FieldType.ENUM, FlightModeElemNames, FlightModeEnumOptions) );
|
||||
|
||||
List<String> Accessory1ElemNames = new ArrayList<String>();
|
||||
Accessory1ElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Accessory1", "%", UAVObjectField.FieldType.FLOAT32, Accessory1ElemNames, null) );
|
||||
|
||||
List<String> Accessory2ElemNames = new ArrayList<String>();
|
||||
Accessory2ElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Accessory2", "%", UAVObjectField.FieldType.FLOAT32, Accessory2ElemNames, null) );
|
||||
|
||||
List<String> Accessory3ElemNames = new ArrayList<String>();
|
||||
Accessory3ElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Accessory3", "%", UAVObjectField.FieldType.FLOAT32, Accessory3ElemNames, null) );
|
||||
|
||||
List<String> ChannelElemNames = new ArrayList<String>();
|
||||
ChannelElemNames.add("0");
|
||||
ChannelElemNames.add("1");
|
||||
ChannelElemNames.add("2");
|
||||
ChannelElemNames.add("3");
|
||||
ChannelElemNames.add("4");
|
||||
ChannelElemNames.add("5");
|
||||
ChannelElemNames.add("6");
|
||||
ChannelElemNames.add("7");
|
||||
fields.add( new UAVObjectField("Channel", "us", UAVObjectField.FieldType.UINT16, ChannelElemNames, null) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
|
||||
metadata.flightTelemetryUpdatePeriod = 2000;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.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.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
ManualControlCommand obj = new ManualControlCommand();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public ManualControlCommand GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (ManualControlCommand)(objMngr.getObject(ManualControlCommand.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0x926794;
|
||||
protected static final String NAME = "ManualControlCommand";
|
||||
protected static String DESCRIPTION = "The output from the @ref ManualControlModule which descodes the receiver inputs. Overriden by GCS for fly-by-wire control.";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 0 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,395 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* Settings to indicate how to decode receiver input by @ref ManualControlModule.
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
Settings to indicate how to decode receiver input by @ref ManualControlModule.
|
||||
|
||||
generated from manualcontrolsettings.xml
|
||||
**/
|
||||
public class ManualControlSettings extends UAVDataObject {
|
||||
|
||||
public ManualControlSettings() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> InputModeElemNames = new ArrayList<String>();
|
||||
InputModeElemNames.add("0");
|
||||
List<String> InputModeEnumOptions = new ArrayList<String>();
|
||||
InputModeEnumOptions.add("PWM");
|
||||
InputModeEnumOptions.add("PPM");
|
||||
InputModeEnumOptions.add("Spektrum");
|
||||
fields.add( new UAVObjectField("InputMode", "", UAVObjectField.FieldType.ENUM, InputModeElemNames, InputModeEnumOptions) );
|
||||
|
||||
List<String> RollElemNames = new ArrayList<String>();
|
||||
RollElemNames.add("0");
|
||||
List<String> RollEnumOptions = new ArrayList<String>();
|
||||
RollEnumOptions.add("Channel1");
|
||||
RollEnumOptions.add("Channel2");
|
||||
RollEnumOptions.add("Channel3");
|
||||
RollEnumOptions.add("Channel4");
|
||||
RollEnumOptions.add("Channel5");
|
||||
RollEnumOptions.add("Channel6");
|
||||
RollEnumOptions.add("Channel7");
|
||||
RollEnumOptions.add("Channel8");
|
||||
RollEnumOptions.add("None");
|
||||
fields.add( new UAVObjectField("Roll", "channel", UAVObjectField.FieldType.ENUM, RollElemNames, RollEnumOptions) );
|
||||
|
||||
List<String> PitchElemNames = new ArrayList<String>();
|
||||
PitchElemNames.add("0");
|
||||
List<String> PitchEnumOptions = new ArrayList<String>();
|
||||
PitchEnumOptions.add("Channel1");
|
||||
PitchEnumOptions.add("Channel2");
|
||||
PitchEnumOptions.add("Channel3");
|
||||
PitchEnumOptions.add("Channel4");
|
||||
PitchEnumOptions.add("Channel5");
|
||||
PitchEnumOptions.add("Channel6");
|
||||
PitchEnumOptions.add("Channel7");
|
||||
PitchEnumOptions.add("Channel8");
|
||||
PitchEnumOptions.add("None");
|
||||
fields.add( new UAVObjectField("Pitch", "channel", UAVObjectField.FieldType.ENUM, PitchElemNames, PitchEnumOptions) );
|
||||
|
||||
List<String> YawElemNames = new ArrayList<String>();
|
||||
YawElemNames.add("0");
|
||||
List<String> YawEnumOptions = new ArrayList<String>();
|
||||
YawEnumOptions.add("Channel1");
|
||||
YawEnumOptions.add("Channel2");
|
||||
YawEnumOptions.add("Channel3");
|
||||
YawEnumOptions.add("Channel4");
|
||||
YawEnumOptions.add("Channel5");
|
||||
YawEnumOptions.add("Channel6");
|
||||
YawEnumOptions.add("Channel7");
|
||||
YawEnumOptions.add("Channel8");
|
||||
YawEnumOptions.add("None");
|
||||
fields.add( new UAVObjectField("Yaw", "channel", UAVObjectField.FieldType.ENUM, YawElemNames, YawEnumOptions) );
|
||||
|
||||
List<String> ThrottleElemNames = new ArrayList<String>();
|
||||
ThrottleElemNames.add("0");
|
||||
List<String> ThrottleEnumOptions = new ArrayList<String>();
|
||||
ThrottleEnumOptions.add("Channel1");
|
||||
ThrottleEnumOptions.add("Channel2");
|
||||
ThrottleEnumOptions.add("Channel3");
|
||||
ThrottleEnumOptions.add("Channel4");
|
||||
ThrottleEnumOptions.add("Channel5");
|
||||
ThrottleEnumOptions.add("Channel6");
|
||||
ThrottleEnumOptions.add("Channel7");
|
||||
ThrottleEnumOptions.add("Channel8");
|
||||
ThrottleEnumOptions.add("None");
|
||||
fields.add( new UAVObjectField("Throttle", "channel", UAVObjectField.FieldType.ENUM, ThrottleElemNames, ThrottleEnumOptions) );
|
||||
|
||||
List<String> FlightModeElemNames = new ArrayList<String>();
|
||||
FlightModeElemNames.add("0");
|
||||
List<String> FlightModeEnumOptions = new ArrayList<String>();
|
||||
FlightModeEnumOptions.add("Channel1");
|
||||
FlightModeEnumOptions.add("Channel2");
|
||||
FlightModeEnumOptions.add("Channel3");
|
||||
FlightModeEnumOptions.add("Channel4");
|
||||
FlightModeEnumOptions.add("Channel5");
|
||||
FlightModeEnumOptions.add("Channel6");
|
||||
FlightModeEnumOptions.add("Channel7");
|
||||
FlightModeEnumOptions.add("Channel8");
|
||||
FlightModeEnumOptions.add("None");
|
||||
fields.add( new UAVObjectField("FlightMode", "channel", UAVObjectField.FieldType.ENUM, FlightModeElemNames, FlightModeEnumOptions) );
|
||||
|
||||
List<String> Accessory1ElemNames = new ArrayList<String>();
|
||||
Accessory1ElemNames.add("0");
|
||||
List<String> Accessory1EnumOptions = new ArrayList<String>();
|
||||
Accessory1EnumOptions.add("Channel1");
|
||||
Accessory1EnumOptions.add("Channel2");
|
||||
Accessory1EnumOptions.add("Channel3");
|
||||
Accessory1EnumOptions.add("Channel4");
|
||||
Accessory1EnumOptions.add("Channel5");
|
||||
Accessory1EnumOptions.add("Channel6");
|
||||
Accessory1EnumOptions.add("Channel7");
|
||||
Accessory1EnumOptions.add("Channel8");
|
||||
Accessory1EnumOptions.add("None");
|
||||
fields.add( new UAVObjectField("Accessory1", "channel", UAVObjectField.FieldType.ENUM, Accessory1ElemNames, Accessory1EnumOptions) );
|
||||
|
||||
List<String> Accessory2ElemNames = new ArrayList<String>();
|
||||
Accessory2ElemNames.add("0");
|
||||
List<String> Accessory2EnumOptions = new ArrayList<String>();
|
||||
Accessory2EnumOptions.add("Channel1");
|
||||
Accessory2EnumOptions.add("Channel2");
|
||||
Accessory2EnumOptions.add("Channel3");
|
||||
Accessory2EnumOptions.add("Channel4");
|
||||
Accessory2EnumOptions.add("Channel5");
|
||||
Accessory2EnumOptions.add("Channel6");
|
||||
Accessory2EnumOptions.add("Channel7");
|
||||
Accessory2EnumOptions.add("Channel8");
|
||||
Accessory2EnumOptions.add("None");
|
||||
fields.add( new UAVObjectField("Accessory2", "channel", UAVObjectField.FieldType.ENUM, Accessory2ElemNames, Accessory2EnumOptions) );
|
||||
|
||||
List<String> Accessory3ElemNames = new ArrayList<String>();
|
||||
Accessory3ElemNames.add("0");
|
||||
List<String> Accessory3EnumOptions = new ArrayList<String>();
|
||||
Accessory3EnumOptions.add("Channel1");
|
||||
Accessory3EnumOptions.add("Channel2");
|
||||
Accessory3EnumOptions.add("Channel3");
|
||||
Accessory3EnumOptions.add("Channel4");
|
||||
Accessory3EnumOptions.add("Channel5");
|
||||
Accessory3EnumOptions.add("Channel6");
|
||||
Accessory3EnumOptions.add("Channel7");
|
||||
Accessory3EnumOptions.add("Channel8");
|
||||
Accessory3EnumOptions.add("None");
|
||||
fields.add( new UAVObjectField("Accessory3", "channel", UAVObjectField.FieldType.ENUM, Accessory3ElemNames, Accessory3EnumOptions) );
|
||||
|
||||
List<String> ArmingElemNames = new ArrayList<String>();
|
||||
ArmingElemNames.add("0");
|
||||
List<String> ArmingEnumOptions = new ArrayList<String>();
|
||||
ArmingEnumOptions.add("Always Disarmed");
|
||||
ArmingEnumOptions.add("Always Armed");
|
||||
ArmingEnumOptions.add("Roll Left");
|
||||
ArmingEnumOptions.add("Roll Right");
|
||||
ArmingEnumOptions.add("Pitch Forward");
|
||||
ArmingEnumOptions.add("Pitch Aft");
|
||||
ArmingEnumOptions.add("Yaw Left");
|
||||
ArmingEnumOptions.add("Yaw Right");
|
||||
fields.add( new UAVObjectField("Arming", "", UAVObjectField.FieldType.ENUM, ArmingElemNames, ArmingEnumOptions) );
|
||||
|
||||
List<String> Stabilization1SettingsElemNames = new ArrayList<String>();
|
||||
Stabilization1SettingsElemNames.add("Roll");
|
||||
Stabilization1SettingsElemNames.add("Pitch");
|
||||
Stabilization1SettingsElemNames.add("Yaw");
|
||||
List<String> Stabilization1SettingsEnumOptions = new ArrayList<String>();
|
||||
Stabilization1SettingsEnumOptions.add("None");
|
||||
Stabilization1SettingsEnumOptions.add("Rate");
|
||||
Stabilization1SettingsEnumOptions.add("Attitude");
|
||||
fields.add( new UAVObjectField("Stabilization1Settings", "", UAVObjectField.FieldType.ENUM, Stabilization1SettingsElemNames, Stabilization1SettingsEnumOptions) );
|
||||
|
||||
List<String> Stabilization2SettingsElemNames = new ArrayList<String>();
|
||||
Stabilization2SettingsElemNames.add("Roll");
|
||||
Stabilization2SettingsElemNames.add("Pitch");
|
||||
Stabilization2SettingsElemNames.add("Yaw");
|
||||
List<String> Stabilization2SettingsEnumOptions = new ArrayList<String>();
|
||||
Stabilization2SettingsEnumOptions.add("None");
|
||||
Stabilization2SettingsEnumOptions.add("Rate");
|
||||
Stabilization2SettingsEnumOptions.add("Attitude");
|
||||
fields.add( new UAVObjectField("Stabilization2Settings", "", UAVObjectField.FieldType.ENUM, Stabilization2SettingsElemNames, Stabilization2SettingsEnumOptions) );
|
||||
|
||||
List<String> Stabilization3SettingsElemNames = new ArrayList<String>();
|
||||
Stabilization3SettingsElemNames.add("Roll");
|
||||
Stabilization3SettingsElemNames.add("Pitch");
|
||||
Stabilization3SettingsElemNames.add("Yaw");
|
||||
List<String> Stabilization3SettingsEnumOptions = new ArrayList<String>();
|
||||
Stabilization3SettingsEnumOptions.add("None");
|
||||
Stabilization3SettingsEnumOptions.add("Rate");
|
||||
Stabilization3SettingsEnumOptions.add("Attitude");
|
||||
fields.add( new UAVObjectField("Stabilization3Settings", "", UAVObjectField.FieldType.ENUM, Stabilization3SettingsElemNames, Stabilization3SettingsEnumOptions) );
|
||||
|
||||
List<String> FlightModePositionElemNames = new ArrayList<String>();
|
||||
FlightModePositionElemNames.add("0");
|
||||
FlightModePositionElemNames.add("1");
|
||||
FlightModePositionElemNames.add("2");
|
||||
List<String> FlightModePositionEnumOptions = new ArrayList<String>();
|
||||
FlightModePositionEnumOptions.add("Manual");
|
||||
FlightModePositionEnumOptions.add("Stabilized1");
|
||||
FlightModePositionEnumOptions.add("Stabilized2");
|
||||
FlightModePositionEnumOptions.add("Stabilized3");
|
||||
FlightModePositionEnumOptions.add("VelocityControl");
|
||||
FlightModePositionEnumOptions.add("PositionHold");
|
||||
fields.add( new UAVObjectField("FlightModePosition", "", UAVObjectField.FieldType.ENUM, FlightModePositionElemNames, FlightModePositionEnumOptions) );
|
||||
|
||||
List<String> ChannelMaxElemNames = new ArrayList<String>();
|
||||
ChannelMaxElemNames.add("0");
|
||||
ChannelMaxElemNames.add("1");
|
||||
ChannelMaxElemNames.add("2");
|
||||
ChannelMaxElemNames.add("3");
|
||||
ChannelMaxElemNames.add("4");
|
||||
ChannelMaxElemNames.add("5");
|
||||
ChannelMaxElemNames.add("6");
|
||||
ChannelMaxElemNames.add("7");
|
||||
fields.add( new UAVObjectField("ChannelMax", "us", UAVObjectField.FieldType.INT16, ChannelMaxElemNames, null) );
|
||||
|
||||
List<String> ChannelNeutralElemNames = new ArrayList<String>();
|
||||
ChannelNeutralElemNames.add("0");
|
||||
ChannelNeutralElemNames.add("1");
|
||||
ChannelNeutralElemNames.add("2");
|
||||
ChannelNeutralElemNames.add("3");
|
||||
ChannelNeutralElemNames.add("4");
|
||||
ChannelNeutralElemNames.add("5");
|
||||
ChannelNeutralElemNames.add("6");
|
||||
ChannelNeutralElemNames.add("7");
|
||||
fields.add( new UAVObjectField("ChannelNeutral", "us", UAVObjectField.FieldType.INT16, ChannelNeutralElemNames, null) );
|
||||
|
||||
List<String> ChannelMinElemNames = new ArrayList<String>();
|
||||
ChannelMinElemNames.add("0");
|
||||
ChannelMinElemNames.add("1");
|
||||
ChannelMinElemNames.add("2");
|
||||
ChannelMinElemNames.add("3");
|
||||
ChannelMinElemNames.add("4");
|
||||
ChannelMinElemNames.add("5");
|
||||
ChannelMinElemNames.add("6");
|
||||
ChannelMinElemNames.add("7");
|
||||
fields.add( new UAVObjectField("ChannelMin", "us", UAVObjectField.FieldType.INT16, ChannelMinElemNames, null) );
|
||||
|
||||
List<String> ArmedTimeoutElemNames = new ArrayList<String>();
|
||||
ArmedTimeoutElemNames.add("0");
|
||||
fields.add( new UAVObjectField("ArmedTimeout", "ms", UAVObjectField.FieldType.UINT16, ArmedTimeoutElemNames, null) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.TRUE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.TRUE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
|
||||
metadata.flightTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.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.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
getField("InputMode").setValue(0);
|
||||
getField("Roll").setValue(0);
|
||||
getField("Pitch").setValue(1);
|
||||
getField("Yaw").setValue(2);
|
||||
getField("Throttle").setValue(3);
|
||||
getField("FlightMode").setValue(4);
|
||||
getField("Accessory1").setValue(8);
|
||||
getField("Accessory2").setValue(8);
|
||||
getField("Accessory3").setValue(8);
|
||||
getField("Arming").setValue(0);
|
||||
getField("Stabilization1Settings").setValue(2,0);
|
||||
getField("Stabilization1Settings").setValue(2,1);
|
||||
getField("Stabilization1Settings").setValue(2,2);
|
||||
getField("Stabilization2Settings").setValue(2,0);
|
||||
getField("Stabilization2Settings").setValue(2,1);
|
||||
getField("Stabilization2Settings").setValue(2,2);
|
||||
getField("Stabilization3Settings").setValue(2,0);
|
||||
getField("Stabilization3Settings").setValue(2,1);
|
||||
getField("Stabilization3Settings").setValue(2,2);
|
||||
getField("FlightModePosition").setValue(0,0);
|
||||
getField("FlightModePosition").setValue(1,1);
|
||||
getField("FlightModePosition").setValue(2,2);
|
||||
getField("ChannelMax").setValue(2000,0);
|
||||
getField("ChannelMax").setValue(2000,1);
|
||||
getField("ChannelMax").setValue(2000,2);
|
||||
getField("ChannelMax").setValue(2000,3);
|
||||
getField("ChannelMax").setValue(2000,4);
|
||||
getField("ChannelMax").setValue(2000,5);
|
||||
getField("ChannelMax").setValue(2000,6);
|
||||
getField("ChannelMax").setValue(2000,7);
|
||||
getField("ChannelNeutral").setValue(1500,0);
|
||||
getField("ChannelNeutral").setValue(1500,1);
|
||||
getField("ChannelNeutral").setValue(1500,2);
|
||||
getField("ChannelNeutral").setValue(1500,3);
|
||||
getField("ChannelNeutral").setValue(1500,4);
|
||||
getField("ChannelNeutral").setValue(1500,5);
|
||||
getField("ChannelNeutral").setValue(1500,6);
|
||||
getField("ChannelNeutral").setValue(1500,7);
|
||||
getField("ChannelMin").setValue(1000,0);
|
||||
getField("ChannelMin").setValue(1000,1);
|
||||
getField("ChannelMin").setValue(1000,2);
|
||||
getField("ChannelMin").setValue(1000,3);
|
||||
getField("ChannelMin").setValue(1000,4);
|
||||
getField("ChannelMin").setValue(1000,5);
|
||||
getField("ChannelMin").setValue(1000,6);
|
||||
getField("ChannelMin").setValue(1000,7);
|
||||
getField("ArmedTimeout").setValue(30000);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
ManualControlSettings obj = new ManualControlSettings();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public ManualControlSettings GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (ManualControlSettings)(objMngr.getObject(ManualControlSettings.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0x2B82102;
|
||||
protected static final String NAME = "ManualControlSettings";
|
||||
protected static String DESCRIPTION = "Settings to indicate how to decode receiver input by @ref ManualControlModule.";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 1 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,357 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* Settings for the @ref ActuatorModule that controls the channel assignments for the mixer based on AircraftType
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
Settings for the @ref ActuatorModule that controls the channel assignments for the mixer based on AircraftType
|
||||
|
||||
generated from mixersettings.xml
|
||||
**/
|
||||
public class MixerSettings extends UAVDataObject {
|
||||
|
||||
public MixerSettings() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> MaxAccelElemNames = new ArrayList<String>();
|
||||
MaxAccelElemNames.add("0");
|
||||
fields.add( new UAVObjectField("MaxAccel", "units/sec", UAVObjectField.FieldType.FLOAT32, MaxAccelElemNames, null) );
|
||||
|
||||
List<String> FeedForwardElemNames = new ArrayList<String>();
|
||||
FeedForwardElemNames.add("0");
|
||||
fields.add( new UAVObjectField("FeedForward", "", UAVObjectField.FieldType.FLOAT32, FeedForwardElemNames, null) );
|
||||
|
||||
List<String> AccelTimeElemNames = new ArrayList<String>();
|
||||
AccelTimeElemNames.add("0");
|
||||
fields.add( new UAVObjectField("AccelTime", "ms", UAVObjectField.FieldType.FLOAT32, AccelTimeElemNames, null) );
|
||||
|
||||
List<String> DecelTimeElemNames = new ArrayList<String>();
|
||||
DecelTimeElemNames.add("0");
|
||||
fields.add( new UAVObjectField("DecelTime", "ms", UAVObjectField.FieldType.FLOAT32, DecelTimeElemNames, null) );
|
||||
|
||||
List<String> ThrottleCurve1ElemNames = new ArrayList<String>();
|
||||
ThrottleCurve1ElemNames.add("0");
|
||||
ThrottleCurve1ElemNames.add("25");
|
||||
ThrottleCurve1ElemNames.add("50");
|
||||
ThrottleCurve1ElemNames.add("75");
|
||||
ThrottleCurve1ElemNames.add("100");
|
||||
fields.add( new UAVObjectField("ThrottleCurve1", "percent", UAVObjectField.FieldType.FLOAT32, ThrottleCurve1ElemNames, null) );
|
||||
|
||||
List<String> ThrottleCurve2ElemNames = new ArrayList<String>();
|
||||
ThrottleCurve2ElemNames.add("0");
|
||||
ThrottleCurve2ElemNames.add("25");
|
||||
ThrottleCurve2ElemNames.add("50");
|
||||
ThrottleCurve2ElemNames.add("75");
|
||||
ThrottleCurve2ElemNames.add("100");
|
||||
fields.add( new UAVObjectField("ThrottleCurve2", "percent", UAVObjectField.FieldType.FLOAT32, ThrottleCurve2ElemNames, null) );
|
||||
|
||||
List<String> Mixer1TypeElemNames = new ArrayList<String>();
|
||||
Mixer1TypeElemNames.add("0");
|
||||
List<String> Mixer1TypeEnumOptions = new ArrayList<String>();
|
||||
Mixer1TypeEnumOptions.add("Disabled");
|
||||
Mixer1TypeEnumOptions.add("Motor");
|
||||
Mixer1TypeEnumOptions.add("Servo");
|
||||
fields.add( new UAVObjectField("Mixer1Type", "", UAVObjectField.FieldType.ENUM, Mixer1TypeElemNames, Mixer1TypeEnumOptions) );
|
||||
|
||||
List<String> Mixer1VectorElemNames = new ArrayList<String>();
|
||||
Mixer1VectorElemNames.add("ThrottleCurve1");
|
||||
Mixer1VectorElemNames.add("ThrottleCurve2");
|
||||
Mixer1VectorElemNames.add("Roll");
|
||||
Mixer1VectorElemNames.add("Pitch");
|
||||
Mixer1VectorElemNames.add("Yaw");
|
||||
fields.add( new UAVObjectField("Mixer1Vector", "", UAVObjectField.FieldType.INT8, Mixer1VectorElemNames, null) );
|
||||
|
||||
List<String> Mixer2TypeElemNames = new ArrayList<String>();
|
||||
Mixer2TypeElemNames.add("0");
|
||||
List<String> Mixer2TypeEnumOptions = new ArrayList<String>();
|
||||
Mixer2TypeEnumOptions.add("Disabled");
|
||||
Mixer2TypeEnumOptions.add("Motor");
|
||||
Mixer2TypeEnumOptions.add("Servo");
|
||||
fields.add( new UAVObjectField("Mixer2Type", "", UAVObjectField.FieldType.ENUM, Mixer2TypeElemNames, Mixer2TypeEnumOptions) );
|
||||
|
||||
List<String> Mixer2VectorElemNames = new ArrayList<String>();
|
||||
Mixer2VectorElemNames.add("ThrottleCurve1");
|
||||
Mixer2VectorElemNames.add("ThrottleCurve2");
|
||||
Mixer2VectorElemNames.add("Roll");
|
||||
Mixer2VectorElemNames.add("Pitch");
|
||||
Mixer2VectorElemNames.add("Yaw");
|
||||
fields.add( new UAVObjectField("Mixer2Vector", "", UAVObjectField.FieldType.INT8, Mixer2VectorElemNames, null) );
|
||||
|
||||
List<String> Mixer3TypeElemNames = new ArrayList<String>();
|
||||
Mixer3TypeElemNames.add("0");
|
||||
List<String> Mixer3TypeEnumOptions = new ArrayList<String>();
|
||||
Mixer3TypeEnumOptions.add("Disabled");
|
||||
Mixer3TypeEnumOptions.add("Motor");
|
||||
Mixer3TypeEnumOptions.add("Servo");
|
||||
fields.add( new UAVObjectField("Mixer3Type", "", UAVObjectField.FieldType.ENUM, Mixer3TypeElemNames, Mixer3TypeEnumOptions) );
|
||||
|
||||
List<String> Mixer3VectorElemNames = new ArrayList<String>();
|
||||
Mixer3VectorElemNames.add("ThrottleCurve1");
|
||||
Mixer3VectorElemNames.add("ThrottleCurve2");
|
||||
Mixer3VectorElemNames.add("Roll");
|
||||
Mixer3VectorElemNames.add("Pitch");
|
||||
Mixer3VectorElemNames.add("Yaw");
|
||||
fields.add( new UAVObjectField("Mixer3Vector", "", UAVObjectField.FieldType.INT8, Mixer3VectorElemNames, null) );
|
||||
|
||||
List<String> Mixer4TypeElemNames = new ArrayList<String>();
|
||||
Mixer4TypeElemNames.add("0");
|
||||
List<String> Mixer4TypeEnumOptions = new ArrayList<String>();
|
||||
Mixer4TypeEnumOptions.add("Disabled");
|
||||
Mixer4TypeEnumOptions.add("Motor");
|
||||
Mixer4TypeEnumOptions.add("Servo");
|
||||
fields.add( new UAVObjectField("Mixer4Type", "", UAVObjectField.FieldType.ENUM, Mixer4TypeElemNames, Mixer4TypeEnumOptions) );
|
||||
|
||||
List<String> Mixer4VectorElemNames = new ArrayList<String>();
|
||||
Mixer4VectorElemNames.add("ThrottleCurve1");
|
||||
Mixer4VectorElemNames.add("ThrottleCurve2");
|
||||
Mixer4VectorElemNames.add("Roll");
|
||||
Mixer4VectorElemNames.add("Pitch");
|
||||
Mixer4VectorElemNames.add("Yaw");
|
||||
fields.add( new UAVObjectField("Mixer4Vector", "", UAVObjectField.FieldType.INT8, Mixer4VectorElemNames, null) );
|
||||
|
||||
List<String> Mixer5TypeElemNames = new ArrayList<String>();
|
||||
Mixer5TypeElemNames.add("0");
|
||||
List<String> Mixer5TypeEnumOptions = new ArrayList<String>();
|
||||
Mixer5TypeEnumOptions.add("Disabled");
|
||||
Mixer5TypeEnumOptions.add("Motor");
|
||||
Mixer5TypeEnumOptions.add("Servo");
|
||||
fields.add( new UAVObjectField("Mixer5Type", "", UAVObjectField.FieldType.ENUM, Mixer5TypeElemNames, Mixer5TypeEnumOptions) );
|
||||
|
||||
List<String> Mixer5VectorElemNames = new ArrayList<String>();
|
||||
Mixer5VectorElemNames.add("ThrottleCurve1");
|
||||
Mixer5VectorElemNames.add("ThrottleCurve2");
|
||||
Mixer5VectorElemNames.add("Roll");
|
||||
Mixer5VectorElemNames.add("Pitch");
|
||||
Mixer5VectorElemNames.add("Yaw");
|
||||
fields.add( new UAVObjectField("Mixer5Vector", "", UAVObjectField.FieldType.INT8, Mixer5VectorElemNames, null) );
|
||||
|
||||
List<String> Mixer6TypeElemNames = new ArrayList<String>();
|
||||
Mixer6TypeElemNames.add("0");
|
||||
List<String> Mixer6TypeEnumOptions = new ArrayList<String>();
|
||||
Mixer6TypeEnumOptions.add("Disabled");
|
||||
Mixer6TypeEnumOptions.add("Motor");
|
||||
Mixer6TypeEnumOptions.add("Servo");
|
||||
fields.add( new UAVObjectField("Mixer6Type", "", UAVObjectField.FieldType.ENUM, Mixer6TypeElemNames, Mixer6TypeEnumOptions) );
|
||||
|
||||
List<String> Mixer6VectorElemNames = new ArrayList<String>();
|
||||
Mixer6VectorElemNames.add("ThrottleCurve1");
|
||||
Mixer6VectorElemNames.add("ThrottleCurve2");
|
||||
Mixer6VectorElemNames.add("Roll");
|
||||
Mixer6VectorElemNames.add("Pitch");
|
||||
Mixer6VectorElemNames.add("Yaw");
|
||||
fields.add( new UAVObjectField("Mixer6Vector", "", UAVObjectField.FieldType.INT8, Mixer6VectorElemNames, null) );
|
||||
|
||||
List<String> Mixer7TypeElemNames = new ArrayList<String>();
|
||||
Mixer7TypeElemNames.add("0");
|
||||
List<String> Mixer7TypeEnumOptions = new ArrayList<String>();
|
||||
Mixer7TypeEnumOptions.add("Disabled");
|
||||
Mixer7TypeEnumOptions.add("Motor");
|
||||
Mixer7TypeEnumOptions.add("Servo");
|
||||
fields.add( new UAVObjectField("Mixer7Type", "", UAVObjectField.FieldType.ENUM, Mixer7TypeElemNames, Mixer7TypeEnumOptions) );
|
||||
|
||||
List<String> Mixer7VectorElemNames = new ArrayList<String>();
|
||||
Mixer7VectorElemNames.add("ThrottleCurve1");
|
||||
Mixer7VectorElemNames.add("ThrottleCurve2");
|
||||
Mixer7VectorElemNames.add("Roll");
|
||||
Mixer7VectorElemNames.add("Pitch");
|
||||
Mixer7VectorElemNames.add("Yaw");
|
||||
fields.add( new UAVObjectField("Mixer7Vector", "", UAVObjectField.FieldType.INT8, Mixer7VectorElemNames, null) );
|
||||
|
||||
List<String> Mixer8TypeElemNames = new ArrayList<String>();
|
||||
Mixer8TypeElemNames.add("0");
|
||||
List<String> Mixer8TypeEnumOptions = new ArrayList<String>();
|
||||
Mixer8TypeEnumOptions.add("Disabled");
|
||||
Mixer8TypeEnumOptions.add("Motor");
|
||||
Mixer8TypeEnumOptions.add("Servo");
|
||||
fields.add( new UAVObjectField("Mixer8Type", "", UAVObjectField.FieldType.ENUM, Mixer8TypeElemNames, Mixer8TypeEnumOptions) );
|
||||
|
||||
List<String> Mixer8VectorElemNames = new ArrayList<String>();
|
||||
Mixer8VectorElemNames.add("ThrottleCurve1");
|
||||
Mixer8VectorElemNames.add("ThrottleCurve2");
|
||||
Mixer8VectorElemNames.add("Roll");
|
||||
Mixer8VectorElemNames.add("Pitch");
|
||||
Mixer8VectorElemNames.add("Yaw");
|
||||
fields.add( new UAVObjectField("Mixer8Vector", "", UAVObjectField.FieldType.INT8, Mixer8VectorElemNames, null) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.TRUE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.TRUE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
|
||||
metadata.flightTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.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.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
getField("MaxAccel").setValue(1000);
|
||||
getField("FeedForward").setValue(0);
|
||||
getField("AccelTime").setValue(0);
|
||||
getField("DecelTime").setValue(0);
|
||||
getField("ThrottleCurve1").setValue(0,0);
|
||||
getField("ThrottleCurve1").setValue(0.25,1);
|
||||
getField("ThrottleCurve1").setValue(0.5,2);
|
||||
getField("ThrottleCurve1").setValue(0.75,3);
|
||||
getField("ThrottleCurve1").setValue(1,4);
|
||||
getField("ThrottleCurve2").setValue(0,0);
|
||||
getField("ThrottleCurve2").setValue(0.25,1);
|
||||
getField("ThrottleCurve2").setValue(0.5,2);
|
||||
getField("ThrottleCurve2").setValue(0.75,3);
|
||||
getField("ThrottleCurve2").setValue(1,4);
|
||||
getField("Mixer1Type").setValue(0);
|
||||
getField("Mixer1Vector").setValue(0,0);
|
||||
getField("Mixer1Vector").setValue(0,1);
|
||||
getField("Mixer1Vector").setValue(0,2);
|
||||
getField("Mixer1Vector").setValue(0,3);
|
||||
getField("Mixer1Vector").setValue(0,4);
|
||||
getField("Mixer2Type").setValue(0);
|
||||
getField("Mixer2Vector").setValue(0,0);
|
||||
getField("Mixer2Vector").setValue(0,1);
|
||||
getField("Mixer2Vector").setValue(0,2);
|
||||
getField("Mixer2Vector").setValue(0,3);
|
||||
getField("Mixer2Vector").setValue(0,4);
|
||||
getField("Mixer3Type").setValue(0);
|
||||
getField("Mixer3Vector").setValue(0,0);
|
||||
getField("Mixer3Vector").setValue(0,1);
|
||||
getField("Mixer3Vector").setValue(0,2);
|
||||
getField("Mixer3Vector").setValue(0,3);
|
||||
getField("Mixer3Vector").setValue(0,4);
|
||||
getField("Mixer4Type").setValue(0);
|
||||
getField("Mixer4Vector").setValue(0,0);
|
||||
getField("Mixer4Vector").setValue(0,1);
|
||||
getField("Mixer4Vector").setValue(0,2);
|
||||
getField("Mixer4Vector").setValue(0,3);
|
||||
getField("Mixer4Vector").setValue(0,4);
|
||||
getField("Mixer5Type").setValue(0);
|
||||
getField("Mixer5Vector").setValue(0,0);
|
||||
getField("Mixer5Vector").setValue(0,1);
|
||||
getField("Mixer5Vector").setValue(0,2);
|
||||
getField("Mixer5Vector").setValue(0,3);
|
||||
getField("Mixer5Vector").setValue(0,4);
|
||||
getField("Mixer6Type").setValue(0);
|
||||
getField("Mixer6Vector").setValue(0,0);
|
||||
getField("Mixer6Vector").setValue(0,1);
|
||||
getField("Mixer6Vector").setValue(0,2);
|
||||
getField("Mixer6Vector").setValue(0,3);
|
||||
getField("Mixer6Vector").setValue(0,4);
|
||||
getField("Mixer7Type").setValue(0);
|
||||
getField("Mixer7Vector").setValue(0,0);
|
||||
getField("Mixer7Vector").setValue(0,1);
|
||||
getField("Mixer7Vector").setValue(0,2);
|
||||
getField("Mixer7Vector").setValue(0,3);
|
||||
getField("Mixer7Vector").setValue(0,4);
|
||||
getField("Mixer8Type").setValue(0);
|
||||
getField("Mixer8Vector").setValue(0,0);
|
||||
getField("Mixer8Vector").setValue(0,1);
|
||||
getField("Mixer8Vector").setValue(0,2);
|
||||
getField("Mixer8Vector").setValue(0,3);
|
||||
getField("Mixer8Vector").setValue(0,4);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
MixerSettings obj = new MixerSettings();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public MixerSettings GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (MixerSettings)(objMngr.getObject(MixerSettings.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0x4FAE374E;
|
||||
protected static final String NAME = "MixerSettings";
|
||||
protected static String DESCRIPTION = "Settings for the @ref ActuatorModule that controls the channel assignments for the mixer based on AircraftType";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 1 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
167
androidgcs/src/org/openpilot/uavtalk/uavobjects/MixerStatus.java
Normal file
167
androidgcs/src/org/openpilot/uavtalk/uavobjects/MixerStatus.java
Normal file
@ -0,0 +1,167 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* Status for the matrix mixer showing the output of each mixer after all scaling
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
Status for the matrix mixer showing the output of each mixer after all scaling
|
||||
|
||||
generated from mixerstatus.xml
|
||||
**/
|
||||
public class MixerStatus extends UAVDataObject {
|
||||
|
||||
public MixerStatus() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> Mixer1ElemNames = new ArrayList<String>();
|
||||
Mixer1ElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Mixer1", "", UAVObjectField.FieldType.FLOAT32, Mixer1ElemNames, null) );
|
||||
|
||||
List<String> Mixer2ElemNames = new ArrayList<String>();
|
||||
Mixer2ElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Mixer2", "", UAVObjectField.FieldType.FLOAT32, Mixer2ElemNames, null) );
|
||||
|
||||
List<String> Mixer3ElemNames = new ArrayList<String>();
|
||||
Mixer3ElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Mixer3", "", UAVObjectField.FieldType.FLOAT32, Mixer3ElemNames, null) );
|
||||
|
||||
List<String> Mixer4ElemNames = new ArrayList<String>();
|
||||
Mixer4ElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Mixer4", "", UAVObjectField.FieldType.FLOAT32, Mixer4ElemNames, null) );
|
||||
|
||||
List<String> Mixer5ElemNames = new ArrayList<String>();
|
||||
Mixer5ElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Mixer5", "", UAVObjectField.FieldType.FLOAT32, Mixer5ElemNames, null) );
|
||||
|
||||
List<String> Mixer6ElemNames = new ArrayList<String>();
|
||||
Mixer6ElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Mixer6", "", UAVObjectField.FieldType.FLOAT32, Mixer6ElemNames, null) );
|
||||
|
||||
List<String> Mixer7ElemNames = new ArrayList<String>();
|
||||
Mixer7ElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Mixer7", "", UAVObjectField.FieldType.FLOAT32, Mixer7ElemNames, null) );
|
||||
|
||||
List<String> Mixer8ElemNames = new ArrayList<String>();
|
||||
Mixer8ElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Mixer8", "", UAVObjectField.FieldType.FLOAT32, Mixer8ElemNames, null) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
|
||||
metadata.flightTelemetryUpdatePeriod = 1000;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
|
||||
metadata.loggingUpdatePeriod = 1000;
|
||||
return metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize object fields with the default values.
|
||||
* If a default value is not specified the object fields
|
||||
* will be initialized to zero.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
MixerStatus obj = new MixerStatus();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public MixerStatus GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (MixerStatus)(objMngr.getObject(MixerStatus.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0xF6A33F10;
|
||||
protected static final String NAME = "MixerStatus";
|
||||
protected static String DESCRIPTION = "Status for the matrix mixer showing the output of each mixer after all scaling";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 0 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
147
androidgcs/src/org/openpilot/uavtalk/uavobjects/NedAccel.java
Normal file
147
androidgcs/src/org/openpilot/uavtalk/uavobjects/NedAccel.java
Normal file
@ -0,0 +1,147 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* The projection of acceleration in the NED reference frame used by @ref Guidance.
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
The projection of acceleration in the NED reference frame used by @ref Guidance.
|
||||
|
||||
generated from nedaccel.xml
|
||||
**/
|
||||
public class NedAccel extends UAVDataObject {
|
||||
|
||||
public NedAccel() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> NorthElemNames = new ArrayList<String>();
|
||||
NorthElemNames.add("0");
|
||||
fields.add( new UAVObjectField("North", "cm/s^2", UAVObjectField.FieldType.FLOAT32, NorthElemNames, null) );
|
||||
|
||||
List<String> EastElemNames = new ArrayList<String>();
|
||||
EastElemNames.add("0");
|
||||
fields.add( new UAVObjectField("East", "cm/s^2", UAVObjectField.FieldType.FLOAT32, EastElemNames, null) );
|
||||
|
||||
List<String> DownElemNames = new ArrayList<String>();
|
||||
DownElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Down", "cm/s^2", UAVObjectField.FieldType.FLOAT32, DownElemNames, null) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
|
||||
metadata.flightTelemetryUpdatePeriod = 10001;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.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.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
NedAccel obj = new NedAccel();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public NedAccel GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (NedAccel)(objMngr.getObject(NedAccel.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0x8E852CE8;
|
||||
protected static final String NAME = "NedAccel";
|
||||
protected static String DESCRIPTION = "The projection of acceleration in the NED reference frame used by @ref Guidance.";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 0 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,160 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* Someone who knows please enter this
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
Someone who knows please enter this
|
||||
|
||||
generated from objectpersistence.xml
|
||||
**/
|
||||
public class ObjectPersistence extends UAVDataObject {
|
||||
|
||||
public ObjectPersistence() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> OperationElemNames = new ArrayList<String>();
|
||||
OperationElemNames.add("0");
|
||||
List<String> OperationEnumOptions = new ArrayList<String>();
|
||||
OperationEnumOptions.add("Load");
|
||||
OperationEnumOptions.add("Save");
|
||||
OperationEnumOptions.add("Delete");
|
||||
fields.add( new UAVObjectField("Operation", "", UAVObjectField.FieldType.ENUM, OperationElemNames, OperationEnumOptions) );
|
||||
|
||||
List<String> SelectionElemNames = new ArrayList<String>();
|
||||
SelectionElemNames.add("0");
|
||||
List<String> SelectionEnumOptions = new ArrayList<String>();
|
||||
SelectionEnumOptions.add("SingleObject");
|
||||
SelectionEnumOptions.add("AllSettings");
|
||||
SelectionEnumOptions.add("AllMetaObjects");
|
||||
SelectionEnumOptions.add("AllObjects");
|
||||
fields.add( new UAVObjectField("Selection", "", UAVObjectField.FieldType.ENUM, SelectionElemNames, SelectionEnumOptions) );
|
||||
|
||||
List<String> ObjectIDElemNames = new ArrayList<String>();
|
||||
ObjectIDElemNames.add("0");
|
||||
fields.add( new UAVObjectField("ObjectID", "", UAVObjectField.FieldType.UINT32, ObjectIDElemNames, null) );
|
||||
|
||||
List<String> InstanceIDElemNames = new ArrayList<String>();
|
||||
InstanceIDElemNames.add("0");
|
||||
fields.add( new UAVObjectField("InstanceID", "", UAVObjectField.FieldType.UINT32, InstanceIDElemNames, null) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.TRUE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.TRUE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
|
||||
metadata.flightTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.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.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
ObjectPersistence obj = new ObjectPersistence();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public ObjectPersistence GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (ObjectPersistence)(objMngr.getObject(ObjectPersistence.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0x22216832;
|
||||
protected static final String NAME = "ObjectPersistence";
|
||||
protected static String DESCRIPTION = "Someone who knows please enter this";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 0 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,147 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* Contains the current position relative to @ref HomeLocation
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
Contains the current position relative to @ref HomeLocation
|
||||
|
||||
generated from positionactual.xml
|
||||
**/
|
||||
public class PositionActual extends UAVDataObject {
|
||||
|
||||
public PositionActual() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> NorthElemNames = new ArrayList<String>();
|
||||
NorthElemNames.add("0");
|
||||
fields.add( new UAVObjectField("North", "cm", UAVObjectField.FieldType.INT32, NorthElemNames, null) );
|
||||
|
||||
List<String> EastElemNames = new ArrayList<String>();
|
||||
EastElemNames.add("0");
|
||||
fields.add( new UAVObjectField("East", "cm", UAVObjectField.FieldType.INT32, EastElemNames, null) );
|
||||
|
||||
List<String> DownElemNames = new ArrayList<String>();
|
||||
DownElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Down", "cm", UAVObjectField.FieldType.INT32, DownElemNames, null) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
|
||||
metadata.flightTelemetryUpdatePeriod = 1000;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
|
||||
metadata.loggingUpdatePeriod = 1000;
|
||||
return metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize object fields with the default values.
|
||||
* If a default value is not specified the object fields
|
||||
* will be initialized to zero.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
PositionActual obj = new PositionActual();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public PositionActual GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (PositionActual)(objMngr.getObject(PositionActual.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0xE0739636;
|
||||
protected static final String NAME = "PositionActual";
|
||||
protected static String DESCRIPTION = "Contains the current position relative to @ref HomeLocation";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 0 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,147 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* The position the craft is trying t achieve. Can come from GCS or @ref PathPlanner
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
The position the craft is trying t achieve. Can come from GCS or @ref PathPlanner
|
||||
|
||||
generated from positiondesired.xml
|
||||
**/
|
||||
public class PositionDesired extends UAVDataObject {
|
||||
|
||||
public PositionDesired() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> NorthElemNames = new ArrayList<String>();
|
||||
NorthElemNames.add("0");
|
||||
fields.add( new UAVObjectField("North", "cm", UAVObjectField.FieldType.INT32, NorthElemNames, null) );
|
||||
|
||||
List<String> EastElemNames = new ArrayList<String>();
|
||||
EastElemNames.add("0");
|
||||
fields.add( new UAVObjectField("East", "cm", UAVObjectField.FieldType.INT32, EastElemNames, null) );
|
||||
|
||||
List<String> DownElemNames = new ArrayList<String>();
|
||||
DownElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Down", "cm", UAVObjectField.FieldType.INT32, DownElemNames, null) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
|
||||
metadata.flightTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
|
||||
metadata.loggingUpdatePeriod = 1000;
|
||||
return metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize object fields with the default values.
|
||||
* If a default value is not specified the object fields
|
||||
* will be initialized to zero.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
PositionDesired obj = new PositionDesired();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public PositionDesired GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (PositionDesired)(objMngr.getObject(PositionDesired.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0x2FC4E5BA;
|
||||
protected static final String NAME = "PositionDesired";
|
||||
protected static String DESCRIPTION = "The position the craft is trying t achieve. Can come from GCS or @ref PathPlanner ";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 0 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
147
androidgcs/src/org/openpilot/uavtalk/uavobjects/RateDesired.java
Normal file
147
androidgcs/src/org/openpilot/uavtalk/uavobjects/RateDesired.java
Normal file
@ -0,0 +1,147 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* Status for the matrix mixer showing the output of each mixer after all scaling
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
Status for the matrix mixer showing the output of each mixer after all scaling
|
||||
|
||||
generated from ratedesired.xml
|
||||
**/
|
||||
public class RateDesired extends UAVDataObject {
|
||||
|
||||
public RateDesired() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> RollElemNames = new ArrayList<String>();
|
||||
RollElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Roll", "deg/s", UAVObjectField.FieldType.FLOAT32, RollElemNames, null) );
|
||||
|
||||
List<String> PitchElemNames = new ArrayList<String>();
|
||||
PitchElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Pitch", "deg/s", UAVObjectField.FieldType.FLOAT32, PitchElemNames, null) );
|
||||
|
||||
List<String> YawElemNames = new ArrayList<String>();
|
||||
YawElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Yaw", "deg/s", UAVObjectField.FieldType.FLOAT32, YawElemNames, null) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
|
||||
metadata.flightTelemetryUpdatePeriod = 1000;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
|
||||
metadata.loggingUpdatePeriod = 1000;
|
||||
return metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize object fields with the default values.
|
||||
* If a default value is not specified the object fields
|
||||
* will be initialized to zero.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
RateDesired obj = new RateDesired();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public RateDesired GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (RateDesired)(objMngr.getObject(RateDesired.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0xBA41B51C;
|
||||
protected static final String NAME = "RateDesired";
|
||||
protected static String DESCRIPTION = "Status for the matrix mixer showing the output of each mixer after all scaling";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 0 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,139 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* The raw data from the ultrasound sonar sensor with altitude estimate.
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
The raw data from the ultrasound sonar sensor with altitude estimate.
|
||||
|
||||
generated from sonaraltitude.xml
|
||||
**/
|
||||
public class SonarAltitude extends UAVDataObject {
|
||||
|
||||
public SonarAltitude() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> AltitudeElemNames = new ArrayList<String>();
|
||||
AltitudeElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Altitude", "m", UAVObjectField.FieldType.FLOAT32, AltitudeElemNames, null) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
|
||||
metadata.flightTelemetryUpdatePeriod = 1000;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.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.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
SonarAltitude obj = new SonarAltitude();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public SonarAltitude GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (SonarAltitude)(objMngr.getObject(SonarAltitude.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0x1FDD844C;
|
||||
protected static final String NAME = "SonarAltitude";
|
||||
protected static String DESCRIPTION = "The raw data from the ultrasound sonar sensor with altitude estimate.";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 0 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,161 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* The desired attitude that @ref StabilizationModule will try and achieve if FlightMode is Stabilized. Comes from @ref ManaulControlModule.
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
The desired attitude that @ref StabilizationModule will try and achieve if FlightMode is Stabilized. Comes from @ref ManaulControlModule.
|
||||
|
||||
generated from stabilizationdesired.xml
|
||||
**/
|
||||
public class StabilizationDesired extends UAVDataObject {
|
||||
|
||||
public StabilizationDesired() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> RollElemNames = new ArrayList<String>();
|
||||
RollElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Roll", "degrees", UAVObjectField.FieldType.FLOAT32, RollElemNames, null) );
|
||||
|
||||
List<String> PitchElemNames = new ArrayList<String>();
|
||||
PitchElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Pitch", "degrees", UAVObjectField.FieldType.FLOAT32, PitchElemNames, null) );
|
||||
|
||||
List<String> YawElemNames = new ArrayList<String>();
|
||||
YawElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Yaw", "degrees", UAVObjectField.FieldType.FLOAT32, YawElemNames, null) );
|
||||
|
||||
List<String> ThrottleElemNames = new ArrayList<String>();
|
||||
ThrottleElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Throttle", "%", UAVObjectField.FieldType.FLOAT32, ThrottleElemNames, null) );
|
||||
|
||||
List<String> StabilizationModeElemNames = new ArrayList<String>();
|
||||
StabilizationModeElemNames.add("Roll");
|
||||
StabilizationModeElemNames.add("Pitch");
|
||||
StabilizationModeElemNames.add("Yaw");
|
||||
List<String> StabilizationModeEnumOptions = new ArrayList<String>();
|
||||
StabilizationModeEnumOptions.add("None");
|
||||
StabilizationModeEnumOptions.add("Rate");
|
||||
StabilizationModeEnumOptions.add("Attitude");
|
||||
fields.add( new UAVObjectField("StabilizationMode", "", UAVObjectField.FieldType.ENUM, StabilizationModeElemNames, StabilizationModeEnumOptions) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
|
||||
metadata.flightTelemetryUpdatePeriod = 1000;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.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.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
StabilizationDesired obj = new StabilizationDesired();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public StabilizationDesired GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (StabilizationDesired)(objMngr.getObject(StabilizationDesired.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0x41AA9DC2;
|
||||
protected static final String NAME = "StabilizationDesired";
|
||||
protected static String DESCRIPTION = "The desired attitude that @ref StabilizationModule will try and achieve if FlightMode is Stabilized. Comes from @ref ManaulControlModule.";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 0 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,222 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* PID settings used by the Stabilization module to combine the @ref AttitudeActual and @ref AttitudeDesired to compute @ref ActuatorDesired
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
PID settings used by the Stabilization module to combine the @ref AttitudeActual and @ref AttitudeDesired to compute @ref ActuatorDesired
|
||||
|
||||
generated from stabilizationsettings.xml
|
||||
**/
|
||||
public class StabilizationSettings extends UAVDataObject {
|
||||
|
||||
public StabilizationSettings() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> RollMaxElemNames = new ArrayList<String>();
|
||||
RollMaxElemNames.add("0");
|
||||
fields.add( new UAVObjectField("RollMax", "degrees", UAVObjectField.FieldType.UINT8, RollMaxElemNames, null) );
|
||||
|
||||
List<String> PitchMaxElemNames = new ArrayList<String>();
|
||||
PitchMaxElemNames.add("0");
|
||||
fields.add( new UAVObjectField("PitchMax", "degrees", UAVObjectField.FieldType.UINT8, PitchMaxElemNames, null) );
|
||||
|
||||
List<String> YawMaxElemNames = new ArrayList<String>();
|
||||
YawMaxElemNames.add("0");
|
||||
fields.add( new UAVObjectField("YawMax", "degrees", UAVObjectField.FieldType.UINT8, YawMaxElemNames, null) );
|
||||
|
||||
List<String> ManualRateElemNames = new ArrayList<String>();
|
||||
ManualRateElemNames.add("Roll");
|
||||
ManualRateElemNames.add("Pitch");
|
||||
ManualRateElemNames.add("Yaw");
|
||||
fields.add( new UAVObjectField("ManualRate", "degrees/sec", UAVObjectField.FieldType.FLOAT32, ManualRateElemNames, null) );
|
||||
|
||||
List<String> MaximumRateElemNames = new ArrayList<String>();
|
||||
MaximumRateElemNames.add("Roll");
|
||||
MaximumRateElemNames.add("Pitch");
|
||||
MaximumRateElemNames.add("Yaw");
|
||||
fields.add( new UAVObjectField("MaximumRate", "degrees/sec", UAVObjectField.FieldType.FLOAT32, MaximumRateElemNames, null) );
|
||||
|
||||
List<String> RollRatePIElemNames = new ArrayList<String>();
|
||||
RollRatePIElemNames.add("Kp");
|
||||
RollRatePIElemNames.add("Ki");
|
||||
RollRatePIElemNames.add("ILimit");
|
||||
fields.add( new UAVObjectField("RollRatePI", "", UAVObjectField.FieldType.FLOAT32, RollRatePIElemNames, null) );
|
||||
|
||||
List<String> PitchRatePIElemNames = new ArrayList<String>();
|
||||
PitchRatePIElemNames.add("Kp");
|
||||
PitchRatePIElemNames.add("Ki");
|
||||
PitchRatePIElemNames.add("ILimit");
|
||||
fields.add( new UAVObjectField("PitchRatePI", "", UAVObjectField.FieldType.FLOAT32, PitchRatePIElemNames, null) );
|
||||
|
||||
List<String> YawRatePIElemNames = new ArrayList<String>();
|
||||
YawRatePIElemNames.add("Kp");
|
||||
YawRatePIElemNames.add("Ki");
|
||||
YawRatePIElemNames.add("ILimit");
|
||||
fields.add( new UAVObjectField("YawRatePI", "", UAVObjectField.FieldType.FLOAT32, YawRatePIElemNames, null) );
|
||||
|
||||
List<String> RollPIElemNames = new ArrayList<String>();
|
||||
RollPIElemNames.add("Kp");
|
||||
RollPIElemNames.add("Ki");
|
||||
RollPIElemNames.add("ILimit");
|
||||
fields.add( new UAVObjectField("RollPI", "", UAVObjectField.FieldType.FLOAT32, RollPIElemNames, null) );
|
||||
|
||||
List<String> PitchPIElemNames = new ArrayList<String>();
|
||||
PitchPIElemNames.add("Kp");
|
||||
PitchPIElemNames.add("Ki");
|
||||
PitchPIElemNames.add("ILimit");
|
||||
fields.add( new UAVObjectField("PitchPI", "", UAVObjectField.FieldType.FLOAT32, PitchPIElemNames, null) );
|
||||
|
||||
List<String> YawPIElemNames = new ArrayList<String>();
|
||||
YawPIElemNames.add("Kp");
|
||||
YawPIElemNames.add("Ki");
|
||||
YawPIElemNames.add("ILimit");
|
||||
fields.add( new UAVObjectField("YawPI", "", UAVObjectField.FieldType.FLOAT32, YawPIElemNames, null) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.TRUE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.TRUE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
|
||||
metadata.flightTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.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.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
getField("RollMax").setValue(35);
|
||||
getField("PitchMax").setValue(35);
|
||||
getField("YawMax").setValue(35);
|
||||
getField("ManualRate").setValue(150,0);
|
||||
getField("ManualRate").setValue(150,1);
|
||||
getField("ManualRate").setValue(150,2);
|
||||
getField("MaximumRate").setValue(300,0);
|
||||
getField("MaximumRate").setValue(300,1);
|
||||
getField("MaximumRate").setValue(300,2);
|
||||
getField("RollRatePI").setValue(0.0015,0);
|
||||
getField("RollRatePI").setValue(0,1);
|
||||
getField("RollRatePI").setValue(0.3,2);
|
||||
getField("PitchRatePI").setValue(0.0015,0);
|
||||
getField("PitchRatePI").setValue(0,1);
|
||||
getField("PitchRatePI").setValue(0.3,2);
|
||||
getField("YawRatePI").setValue(0.003,0);
|
||||
getField("YawRatePI").setValue(0,1);
|
||||
getField("YawRatePI").setValue(0.3,2);
|
||||
getField("RollPI").setValue(2,0);
|
||||
getField("RollPI").setValue(0,1);
|
||||
getField("RollPI").setValue(50,2);
|
||||
getField("PitchPI").setValue(2,0);
|
||||
getField("PitchPI").setValue(0,1);
|
||||
getField("PitchPI").setValue(50,2);
|
||||
getField("YawPI").setValue(2,0);
|
||||
getField("YawPI").setValue(0,1);
|
||||
getField("YawPI").setValue(50,2);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
StabilizationSettings obj = new StabilizationSettings();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public StabilizationSettings GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (StabilizationSettings)(objMngr.getObject(StabilizationSettings.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0xE2147404;
|
||||
protected static final String NAME = "StabilizationSettings";
|
||||
protected static String DESCRIPTION = "PID settings used by the Stabilization module to combine the @ref AttitudeActual and @ref AttitudeDesired to compute @ref ActuatorDesired";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 1 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,176 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* Alarms from OpenPilot to indicate failure conditions or warnings. Set by various modules.
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
Alarms from OpenPilot to indicate failure conditions or warnings. Set by various modules.
|
||||
|
||||
generated from systemalarms.xml
|
||||
**/
|
||||
public class SystemAlarms extends UAVDataObject {
|
||||
|
||||
public SystemAlarms() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> AlarmElemNames = new ArrayList<String>();
|
||||
AlarmElemNames.add("OutOfMemory");
|
||||
AlarmElemNames.add("StackOverflow");
|
||||
AlarmElemNames.add("CPUOverload");
|
||||
AlarmElemNames.add("EventSystem");
|
||||
AlarmElemNames.add("SDCard");
|
||||
AlarmElemNames.add("Telemetry");
|
||||
AlarmElemNames.add("ManualControl");
|
||||
AlarmElemNames.add("Actuator");
|
||||
AlarmElemNames.add("Attitude");
|
||||
AlarmElemNames.add("Stabilization");
|
||||
AlarmElemNames.add("Guidance");
|
||||
AlarmElemNames.add("AHRSComms");
|
||||
AlarmElemNames.add("Battery");
|
||||
AlarmElemNames.add("FlightTime");
|
||||
AlarmElemNames.add("I2C");
|
||||
AlarmElemNames.add("GPS");
|
||||
List<String> AlarmEnumOptions = new ArrayList<String>();
|
||||
AlarmEnumOptions.add("Uninitialised");
|
||||
AlarmEnumOptions.add("OK");
|
||||
AlarmEnumOptions.add("Warning");
|
||||
AlarmEnumOptions.add("Error");
|
||||
AlarmEnumOptions.add("Critical");
|
||||
fields.add( new UAVObjectField("Alarm", "", UAVObjectField.FieldType.ENUM, AlarmElemNames, AlarmEnumOptions) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.TRUE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.TRUE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
|
||||
metadata.flightTelemetryUpdatePeriod = 4000;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
|
||||
metadata.loggingUpdatePeriod = 1000;
|
||||
return metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize object fields with the default values.
|
||||
* If a default value is not specified the object fields
|
||||
* will be initialized to zero.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
getField("Alarm").setValue(0,0);
|
||||
getField("Alarm").setValue(0,1);
|
||||
getField("Alarm").setValue(0,2);
|
||||
getField("Alarm").setValue(0,3);
|
||||
getField("Alarm").setValue(0,4);
|
||||
getField("Alarm").setValue(0,5);
|
||||
getField("Alarm").setValue(0,6);
|
||||
getField("Alarm").setValue(0,7);
|
||||
getField("Alarm").setValue(0,8);
|
||||
getField("Alarm").setValue(0,9);
|
||||
getField("Alarm").setValue(0,10);
|
||||
getField("Alarm").setValue(0,11);
|
||||
getField("Alarm").setValue(0,12);
|
||||
getField("Alarm").setValue(0,13);
|
||||
getField("Alarm").setValue(0,14);
|
||||
getField("Alarm").setValue(0,15);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
SystemAlarms obj = new SystemAlarms();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public SystemAlarms GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (SystemAlarms)(objMngr.getObject(SystemAlarms.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0x89C3DCB2;
|
||||
protected static final String NAME = "SystemAlarms";
|
||||
protected static String DESCRIPTION = "Alarms from OpenPilot to indicate failure conditions or warnings. Set by various modules.";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 0 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,157 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* Select airframe type. Currently used by @ref ActuatorModule to choose mixing from @ref ActuatorDesired to @ref ActuatorCommand
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
Select airframe type. Currently used by @ref ActuatorModule to choose mixing from @ref ActuatorDesired to @ref ActuatorCommand
|
||||
|
||||
generated from systemsettings.xml
|
||||
**/
|
||||
public class SystemSettings extends UAVDataObject {
|
||||
|
||||
public SystemSettings() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> AirframeTypeElemNames = new ArrayList<String>();
|
||||
AirframeTypeElemNames.add("0");
|
||||
List<String> AirframeTypeEnumOptions = new ArrayList<String>();
|
||||
AirframeTypeEnumOptions.add("FixedWing");
|
||||
AirframeTypeEnumOptions.add("FixedWingElevon");
|
||||
AirframeTypeEnumOptions.add("FixedWingVtail");
|
||||
AirframeTypeEnumOptions.add("VTOL");
|
||||
AirframeTypeEnumOptions.add("HeliCP");
|
||||
AirframeTypeEnumOptions.add("QuadX");
|
||||
AirframeTypeEnumOptions.add("QuadP");
|
||||
AirframeTypeEnumOptions.add("Hexa");
|
||||
AirframeTypeEnumOptions.add("Octo");
|
||||
AirframeTypeEnumOptions.add("Custom");
|
||||
AirframeTypeEnumOptions.add("HexaX");
|
||||
AirframeTypeEnumOptions.add("OctoV");
|
||||
AirframeTypeEnumOptions.add("OctoCoaxP");
|
||||
AirframeTypeEnumOptions.add("OctoCoaxX");
|
||||
AirframeTypeEnumOptions.add("HexaCoax");
|
||||
AirframeTypeEnumOptions.add("Tri");
|
||||
fields.add( new UAVObjectField("AirframeType", "", UAVObjectField.FieldType.ENUM, AirframeTypeElemNames, AirframeTypeEnumOptions) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.TRUE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.TRUE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
|
||||
metadata.flightTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.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.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
getField("AirframeType").setValue(0);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
SystemSettings obj = new SystemSettings();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public SystemSettings GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (SystemSettings)(objMngr.getObject(SystemSettings.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0x3875CEE;
|
||||
protected static final String NAME = "SystemSettings";
|
||||
protected static String DESCRIPTION = "Select airframe type. Currently used by @ref ActuatorModule to choose mixing from @ref ActuatorDesired to @ref ActuatorCommand";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 1 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
151
androidgcs/src/org/openpilot/uavtalk/uavobjects/SystemStats.java
Normal file
151
androidgcs/src/org/openpilot/uavtalk/uavobjects/SystemStats.java
Normal file
@ -0,0 +1,151 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* CPU and memory usage from OpenPilot computer.
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
CPU and memory usage from OpenPilot computer.
|
||||
|
||||
generated from systemstats.xml
|
||||
**/
|
||||
public class SystemStats extends UAVDataObject {
|
||||
|
||||
public SystemStats() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> FlightTimeElemNames = new ArrayList<String>();
|
||||
FlightTimeElemNames.add("0");
|
||||
fields.add( new UAVObjectField("FlightTime", "ms", UAVObjectField.FieldType.UINT32, FlightTimeElemNames, null) );
|
||||
|
||||
List<String> HeapRemainingElemNames = new ArrayList<String>();
|
||||
HeapRemainingElemNames.add("0");
|
||||
fields.add( new UAVObjectField("HeapRemaining", "bytes", UAVObjectField.FieldType.UINT16, HeapRemainingElemNames, null) );
|
||||
|
||||
List<String> CPULoadElemNames = new ArrayList<String>();
|
||||
CPULoadElemNames.add("0");
|
||||
fields.add( new UAVObjectField("CPULoad", "%", UAVObjectField.FieldType.UINT8, CPULoadElemNames, null) );
|
||||
|
||||
List<String> CPUTempElemNames = new ArrayList<String>();
|
||||
CPUTempElemNames.add("0");
|
||||
fields.add( new UAVObjectField("CPUTemp", "C", UAVObjectField.FieldType.INT8, CPUTempElemNames, null) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
|
||||
metadata.flightTelemetryUpdatePeriod = 1000;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
|
||||
metadata.loggingUpdatePeriod = 1000;
|
||||
return metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize object fields with the default values.
|
||||
* If a default value is not specified the object fields
|
||||
* will be initialized to zero.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
SystemStats obj = new SystemStats();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public SystemStats GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (SystemStats)(objMngr.getObject(SystemStats.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0xAA26FFFA;
|
||||
protected static final String NAME = "SystemStats";
|
||||
protected static String DESCRIPTION = "CPU and memory usage from OpenPilot computer. ";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 0 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
170
androidgcs/src/org/openpilot/uavtalk/uavobjects/TaskInfo.java
Normal file
170
androidgcs/src/org/openpilot/uavtalk/uavobjects/TaskInfo.java
Normal file
@ -0,0 +1,170 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* Task information
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
Task information
|
||||
|
||||
generated from taskinfo.xml
|
||||
**/
|
||||
public class TaskInfo extends UAVDataObject {
|
||||
|
||||
public TaskInfo() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> StackRemainingElemNames = new ArrayList<String>();
|
||||
StackRemainingElemNames.add("System");
|
||||
StackRemainingElemNames.add("Actuator");
|
||||
StackRemainingElemNames.add("Attitude");
|
||||
StackRemainingElemNames.add("TelemetryTx");
|
||||
StackRemainingElemNames.add("TelemetryTxPri");
|
||||
StackRemainingElemNames.add("TelemetryRx");
|
||||
StackRemainingElemNames.add("GPS");
|
||||
StackRemainingElemNames.add("ManualControl");
|
||||
StackRemainingElemNames.add("Altitude");
|
||||
StackRemainingElemNames.add("AHRSComms");
|
||||
StackRemainingElemNames.add("Stabilization");
|
||||
StackRemainingElemNames.add("Guidance");
|
||||
StackRemainingElemNames.add("FlightPlan");
|
||||
fields.add( new UAVObjectField("StackRemaining", "bytes", UAVObjectField.FieldType.UINT16, StackRemainingElemNames, null) );
|
||||
|
||||
List<String> RunningElemNames = new ArrayList<String>();
|
||||
RunningElemNames.add("System");
|
||||
RunningElemNames.add("Actuator");
|
||||
RunningElemNames.add("Attitude");
|
||||
RunningElemNames.add("TelemetryTx");
|
||||
RunningElemNames.add("TelemetryTxPri");
|
||||
RunningElemNames.add("TelemetryRx");
|
||||
RunningElemNames.add("GPS");
|
||||
RunningElemNames.add("ManualControl");
|
||||
RunningElemNames.add("Altitude");
|
||||
RunningElemNames.add("AHRSComms");
|
||||
RunningElemNames.add("Stabilization");
|
||||
RunningElemNames.add("Guidance");
|
||||
RunningElemNames.add("FlightPlan");
|
||||
List<String> RunningEnumOptions = new ArrayList<String>();
|
||||
RunningEnumOptions.add("False");
|
||||
RunningEnumOptions.add("True");
|
||||
fields.add( new UAVObjectField("Running", "bool", UAVObjectField.FieldType.ENUM, RunningElemNames, RunningEnumOptions) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.TRUE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.TRUE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
|
||||
metadata.flightTelemetryUpdatePeriod = 10000;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
|
||||
metadata.loggingUpdatePeriod = 1000;
|
||||
return metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize object fields with the default values.
|
||||
* If a default value is not specified the object fields
|
||||
* will be initialized to zero.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
TaskInfo obj = new TaskInfo();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public TaskInfo GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (TaskInfo)(objMngr.getObject(TaskInfo.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0x50F599F0;
|
||||
protected static final String NAME = "TaskInfo";
|
||||
protected static String DESCRIPTION = "Task information";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 0 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,148 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* Select baud rate of telemetry. Warning - this must match your modem.
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
Select baud rate of telemetry. Warning - this must match your modem.
|
||||
|
||||
generated from telemetrysettings.xml
|
||||
**/
|
||||
public class TelemetrySettings extends UAVDataObject {
|
||||
|
||||
public TelemetrySettings() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> SpeedElemNames = new ArrayList<String>();
|
||||
SpeedElemNames.add("0");
|
||||
List<String> SpeedEnumOptions = new ArrayList<String>();
|
||||
SpeedEnumOptions.add("2400");
|
||||
SpeedEnumOptions.add("4800");
|
||||
SpeedEnumOptions.add("9600");
|
||||
SpeedEnumOptions.add("19200");
|
||||
SpeedEnumOptions.add("38400");
|
||||
SpeedEnumOptions.add("57600");
|
||||
SpeedEnumOptions.add("115200");
|
||||
fields.add( new UAVObjectField("Speed", "", UAVObjectField.FieldType.ENUM, SpeedElemNames, SpeedEnumOptions) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.TRUE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.TRUE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
|
||||
metadata.flightTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.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.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
getField("Speed").setValue(5);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
TelemetrySettings obj = new TelemetrySettings();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public TelemetrySettings GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (TelemetrySettings)(objMngr.getObject(TelemetrySettings.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0xA608C526;
|
||||
protected static final String NAME = "TelemetrySettings";
|
||||
protected static String DESCRIPTION = "Select baud rate of telemetry. Warning - this must match your modem.";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 1 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,87 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
*
|
||||
* @file uavobjectsinittemplate.java
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief the template for the uavobjects init part
|
||||
* $(GENERATEDWARNING)
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import org.openpilot.uavtalk.uavobjects.*;
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
|
||||
public class UAVObjectsInitialize {
|
||||
|
||||
public static void register(UAVObjectManager objMngr) {
|
||||
try {
|
||||
objMngr.registerObject( new ActuatorCommand() );
|
||||
objMngr.registerObject( new ActuatorDesired() );
|
||||
objMngr.registerObject( new ActuatorSettings() );
|
||||
objMngr.registerObject( new AHRSCalibration() );
|
||||
objMngr.registerObject( new AHRSSettings() );
|
||||
objMngr.registerObject( new AhrsStatus() );
|
||||
objMngr.registerObject( new AttitudeActual() );
|
||||
objMngr.registerObject( new AttitudeRaw() );
|
||||
objMngr.registerObject( new AttitudeSettings() );
|
||||
objMngr.registerObject( new BaroAltitude() );
|
||||
objMngr.registerObject( new BatterySettings() );
|
||||
objMngr.registerObject( new FirmwareIAPObj() );
|
||||
objMngr.registerObject( new FlightBatteryState() );
|
||||
objMngr.registerObject( new FlightPlanControl() );
|
||||
objMngr.registerObject( new FlightPlanSettings() );
|
||||
objMngr.registerObject( new FlightPlanStatus() );
|
||||
objMngr.registerObject( new FlightTelemetryStats() );
|
||||
objMngr.registerObject( new GCSTelemetryStats() );
|
||||
objMngr.registerObject( new GPSPosition() );
|
||||
objMngr.registerObject( new GPSSatellites() );
|
||||
objMngr.registerObject( new GPSTime() );
|
||||
objMngr.registerObject( new GuidanceSettings() );
|
||||
objMngr.registerObject( new HomeLocation() );
|
||||
objMngr.registerObject( new I2CStats() );
|
||||
objMngr.registerObject( new ManualControlCommand() );
|
||||
objMngr.registerObject( new ManualControlSettings() );
|
||||
objMngr.registerObject( new MixerSettings() );
|
||||
objMngr.registerObject( new MixerStatus() );
|
||||
objMngr.registerObject( new NedAccel() );
|
||||
objMngr.registerObject( new ObjectPersistence() );
|
||||
objMngr.registerObject( new PositionActual() );
|
||||
objMngr.registerObject( new PositionDesired() );
|
||||
objMngr.registerObject( new RateDesired() );
|
||||
objMngr.registerObject( new SonarAltitude() );
|
||||
objMngr.registerObject( new StabilizationDesired() );
|
||||
objMngr.registerObject( new StabilizationSettings() );
|
||||
objMngr.registerObject( new SystemAlarms() );
|
||||
objMngr.registerObject( new SystemSettings() );
|
||||
objMngr.registerObject( new SystemStats() );
|
||||
objMngr.registerObject( new TaskInfo() );
|
||||
objMngr.registerObject( new TelemetrySettings() );
|
||||
objMngr.registerObject( new VelocityActual() );
|
||||
objMngr.registerObject( new VelocityDesired() );
|
||||
objMngr.registerObject( new WatchdogStatus() );
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,147 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* Updated by @ref AHRSCommsModule and used within @ref GuidanceModule for velocity control
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
Updated by @ref AHRSCommsModule and used within @ref GuidanceModule for velocity control
|
||||
|
||||
generated from velocityactual.xml
|
||||
**/
|
||||
public class VelocityActual extends UAVDataObject {
|
||||
|
||||
public VelocityActual() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> NorthElemNames = new ArrayList<String>();
|
||||
NorthElemNames.add("0");
|
||||
fields.add( new UAVObjectField("North", "cm/s", UAVObjectField.FieldType.INT32, NorthElemNames, null) );
|
||||
|
||||
List<String> EastElemNames = new ArrayList<String>();
|
||||
EastElemNames.add("0");
|
||||
fields.add( new UAVObjectField("East", "cm/s", UAVObjectField.FieldType.INT32, EastElemNames, null) );
|
||||
|
||||
List<String> DownElemNames = new ArrayList<String>();
|
||||
DownElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Down", "cm/s", UAVObjectField.FieldType.INT32, DownElemNames, null) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
|
||||
metadata.flightTelemetryUpdatePeriod = 1000;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
|
||||
metadata.loggingUpdatePeriod = 1000;
|
||||
return metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize object fields with the default values.
|
||||
* If a default value is not specified the object fields
|
||||
* will be initialized to zero.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
VelocityActual obj = new VelocityActual();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public VelocityActual GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (VelocityActual)(objMngr.getObject(VelocityActual.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0x48009C88;
|
||||
protected static final String NAME = "VelocityActual";
|
||||
protected static String DESCRIPTION = "Updated by @ref AHRSCommsModule and used within @ref GuidanceModule for velocity control";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 0 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,147 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* Used within @ref GuidanceModule to communicate between the task computing the desired velocity and the PID loop to achieve it (running at different rates).
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
Used within @ref GuidanceModule to communicate between the task computing the desired velocity and the PID loop to achieve it (running at different rates).
|
||||
|
||||
generated from velocitydesired.xml
|
||||
**/
|
||||
public class VelocityDesired extends UAVDataObject {
|
||||
|
||||
public VelocityDesired() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> NorthElemNames = new ArrayList<String>();
|
||||
NorthElemNames.add("0");
|
||||
fields.add( new UAVObjectField("North", "cm/s", UAVObjectField.FieldType.INT32, NorthElemNames, null) );
|
||||
|
||||
List<String> EastElemNames = new ArrayList<String>();
|
||||
EastElemNames.add("0");
|
||||
fields.add( new UAVObjectField("East", "cm/s", UAVObjectField.FieldType.INT32, EastElemNames, null) );
|
||||
|
||||
List<String> DownElemNames = new ArrayList<String>();
|
||||
DownElemNames.add("0");
|
||||
fields.add( new UAVObjectField("Down", "cm/s", UAVObjectField.FieldType.INT32, DownElemNames, null) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
|
||||
metadata.flightTelemetryUpdatePeriod = 1000;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
|
||||
metadata.loggingUpdatePeriod = 1000;
|
||||
return metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize object fields with the default values.
|
||||
* If a default value is not specified the object fields
|
||||
* will be initialized to zero.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
VelocityDesired obj = new VelocityDesired();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public VelocityDesired GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (VelocityDesired)(objMngr.getObject(VelocityDesired.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0x122F5E3A;
|
||||
protected static final String NAME = "VelocityDesired";
|
||||
protected static String DESCRIPTION = "Used within @ref GuidanceModule to communicate between the task computing the desired velocity and the PID loop to achieve it (running at different rates).";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 0 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,143 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file uavobjecttemplate.cpp
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||||
* @brief Template for an uavobject in java
|
||||
* This is a autogenerated file!! Do not modify and expect a result.
|
||||
* For monitoring the flags in the watchdog and especially the bootup flags
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
package org.openpilot.uavtalk.uavobjects;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVDataObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
|
||||
/**
|
||||
For monitoring the flags in the watchdog and especially the bootup flags
|
||||
|
||||
generated from watchdogstatus.xml
|
||||
**/
|
||||
public class WatchdogStatus extends UAVDataObject {
|
||||
|
||||
public WatchdogStatus() {
|
||||
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
|
||||
|
||||
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
|
||||
|
||||
|
||||
List<String> BootupFlagsElemNames = new ArrayList<String>();
|
||||
BootupFlagsElemNames.add("0");
|
||||
fields.add( new UAVObjectField("BootupFlags", "", UAVObjectField.FieldType.UINT16, BootupFlagsElemNames, null) );
|
||||
|
||||
List<String> ActiveFlagsElemNames = new ArrayList<String>();
|
||||
ActiveFlagsElemNames.add("0");
|
||||
fields.add( new UAVObjectField("ActiveFlags", "", UAVObjectField.FieldType.UINT16, ActiveFlagsElemNames, null) );
|
||||
|
||||
|
||||
// Compute the number of bytes for this object
|
||||
int numBytes = 0;
|
||||
ListIterator<UAVObjectField> li = fields.listIterator();
|
||||
while(li.hasNext()) {
|
||||
numBytes += li.next().getNumBytes();
|
||||
}
|
||||
NUMBYTES = numBytes;
|
||||
|
||||
// Initialize object
|
||||
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
|
||||
// Set the default field values
|
||||
setDefaultFieldValues();
|
||||
// Set the object description
|
||||
setDescription(DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Metadata object filled with default values for this object
|
||||
* @return Metadata object with default values
|
||||
*/
|
||||
public Metadata getDefaultMetadata() {
|
||||
UAVObject.Metadata metadata = new UAVObject.Metadata();
|
||||
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
|
||||
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
|
||||
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
|
||||
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
|
||||
metadata.flightTelemetryUpdatePeriod = 5000;
|
||||
|
||||
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
|
||||
metadata.loggingUpdatePeriod = 5000;
|
||||
return metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize object fields with the default values.
|
||||
* If a default value is not specified the object fields
|
||||
* will be initialized to zero.
|
||||
*/
|
||||
public void setDefaultFieldValues()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public UAVDataObject clone(int instID) {
|
||||
// TODO: Need to get specific instance to clone
|
||||
try {
|
||||
WatchdogStatus obj = new WatchdogStatus();
|
||||
obj.initialize(instID, this.getMetaObject());
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static function to retrieve an instance of the object.
|
||||
*/
|
||||
public WatchdogStatus GetInstance(UAVObjectManager objMngr, int instID)
|
||||
{
|
||||
return (WatchdogStatus)(objMngr.getObject(WatchdogStatus.OBJID, instID));
|
||||
}
|
||||
|
||||
// Constants
|
||||
protected static final int OBJID = 0xD646E910;
|
||||
protected static final String NAME = "WatchdogStatus";
|
||||
protected static String DESCRIPTION = "For monitoring the flags in the watchdog and especially the bootup flags";
|
||||
protected static final boolean ISSINGLEINST = 1 == 1;
|
||||
protected static final boolean ISSETTINGS = 0 == 1;
|
||||
protected static int NUMBYTES = 0;
|
||||
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user