1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

Update the UAVObjects to the version on next. At some point a make script

should generate these and copy from build/uavobjects-synth/java to this
directory automatically.

Also make sure java objects use CamelCase
This commit is contained in:
James Cotton 2012-02-04 18:30:04 -06:00
parent 38e4960fa5
commit 739dc0f984
53 changed files with 2363 additions and 867 deletions

View File

@ -51,30 +51,29 @@ public class AHRSCalibration extends UAVDataObject {
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) );
fields.add( new UAVObjectField("accel_bias", "m/s", 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) );
fields.add( new UAVObjectField("accel_scale", "(m/s)/lsb", UAVObjectField.FieldType.FLOAT32, accel_scaleElemNames, null) );
List<String> accel_orthoElemNames = new ArrayList<String>();
accel_orthoElemNames.add("XY");
accel_orthoElemNames.add("XZ");
accel_orthoElemNames.add("YZ");
fields.add( new UAVObjectField("accel_ortho", "scale", UAVObjectField.FieldType.FLOAT32, accel_orthoElemNames, 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) );
fields.add( new UAVObjectField("accel_var", "(m/s)^2", UAVObjectField.FieldType.FLOAT32, accel_varElemNames, null) );
List<String> gyro_biasElemNames = new ArrayList<String>();
gyro_biasElemNames.add("X");
@ -126,6 +125,13 @@ public class AHRSCalibration extends UAVDataObject {
pos_varElemNames.add("0");
fields.add( new UAVObjectField("pos_var", "m^2", UAVObjectField.FieldType.FLOAT32, pos_varElemNames, null) );
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) );
// Compute the number of bytes for this object
int numBytes = 0;
@ -171,19 +177,21 @@ public class AHRSCalibration extends UAVDataObject {
*/
public void setDefaultFieldValues()
{
getField("measure_var").setValue("SET");
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_scale").setValue(0.0359,2);
getField("accel_ortho").setValue(0,0);
getField("accel_ortho").setValue(0,1);
getField("accel_ortho").setValue(0,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_bias").setValue(28,0);
getField("gyro_bias").setValue(-28,1);
getField("gyro_bias").setValue(28,2);
getField("gyro_scale").setValue(-0.017,0);
getField("gyro_scale").setValue(0.017,1);
getField("gyro_scale").setValue(-0.017,2);
@ -196,14 +204,15 @@ public class AHRSCalibration extends UAVDataObject {
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_scale").setValue(1,0);
getField("mag_scale").setValue(1,1);
getField("mag_scale").setValue(1,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);
getField("vel_var").setValue(10);
getField("pos_var").setValue(0.04);
getField("measure_var").setValue("SET");
}
@ -232,7 +241,7 @@ public class AHRSCalibration extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0x30101BB2;
protected static final int OBJID = 0xFD0EDFC4;
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;

View File

@ -51,6 +51,18 @@ public class AHRSSettings extends UAVDataObject {
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
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) );
List<String> AlgorithmElemNames = new ArrayList<String>();
AlgorithmElemNames.add("0");
List<String> AlgorithmEnumOptions = new ArrayList<String>();
@ -75,18 +87,6 @@ public class AHRSSettings extends UAVDataObject {
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;
@ -132,13 +132,13 @@ public class AHRSSettings extends UAVDataObject {
*/
public void setDefaultFieldValues()
{
getField("YawBias").setValue(0);
getField("PitchBias").setValue(0);
getField("RollBias").setValue(0);
getField("Algorithm").setValue("INSGPS_INDOOR_NOMAG");
getField("Downsampling").setValue(20);
getField("UpdatePeriod").setValue(1);
getField("BiasCorrectedRaw").setValue("TRUE");
getField("YawBias").setValue(0);
getField("PitchBias").setValue(0);
getField("RollBias").setValue(0);
}
@ -167,7 +167,7 @@ public class AHRSSettings extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0xDEFC5548;
protected static final int OBJID = 0xF8591ED8;
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;

View File

@ -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.
* Desired Auxillary actuator settings. Comes from @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;
/**
Desired Auxillary actuator settings. Comes from @ref ManualControlModule.
generated from accessorydesired.xml
**/
public class AccessoryDesired extends UAVDataObject {
public AccessoryDesired() {
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> AccessoryValElemNames = new ArrayList<String>();
AccessoryValElemNames.add("0");
fields.add( new UAVObjectField("AccessoryVal", "", UAVObjectField.FieldType.FLOAT32, AccessoryValElemNames, 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 {
AccessoryDesired obj = new AccessoryDesired();
obj.initialize(instID, this.getMetaObject());
return obj;
} catch (Exception e) {
return null;
}
}
/**
* Static function to retrieve an instance of the object.
*/
public AccessoryDesired GetInstance(UAVObjectManager objMngr, int instID)
{
return (AccessoryDesired)(objMngr.getObject(AccessoryDesired.OBJID, instID));
}
// Constants
protected static final int OBJID = 0xC409985A;
protected static final String NAME = "AccessoryDesired";
protected static String DESCRIPTION = "Desired Auxillary actuator settings. Comes from @ref ManualControlModule.";
protected static final boolean ISSINGLEINST = 0 == 1;
protected static final boolean ISSETTINGS = 0 == 1;
protected static int NUMBYTES = 0;
}

View File

@ -60,16 +60,18 @@ public class ActuatorCommand extends UAVDataObject {
ChannelElemNames.add("5");
ChannelElemNames.add("6");
ChannelElemNames.add("7");
ChannelElemNames.add("8");
ChannelElemNames.add("9");
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> UpdateTimeElemNames = new ArrayList<String>();
UpdateTimeElemNames.add("0");
fields.add( new UAVObjectField("UpdateTime", "ms", UAVObjectField.FieldType.UINT8, UpdateTimeElemNames, null) );
List<String> NumFailedUpdatesElemNames = new ArrayList<String>();
NumFailedUpdatesElemNames.add("0");
fields.add( new UAVObjectField("NumFailedUpdates", "", UAVObjectField.FieldType.UINT8, NumFailedUpdatesElemNames, null) );
@ -147,7 +149,7 @@ public class ActuatorCommand extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0xE8E077D8;
protected static final int OBJID = 0x5324CB8;
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;

View File

@ -148,7 +148,7 @@ public class ActuatorDesired extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0xD4516782;
protected static final int OBJID = 0xCA4BC4A4;
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;

View File

@ -51,202 +51,6 @@ public class ActuatorSettings extends UAVDataObject {
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");
@ -263,6 +67,8 @@ public class ActuatorSettings extends UAVDataObject {
ChannelMaxElemNames.add("5");
ChannelMaxElemNames.add("6");
ChannelMaxElemNames.add("7");
ChannelMaxElemNames.add("8");
ChannelMaxElemNames.add("9");
fields.add( new UAVObjectField("ChannelMax", "us", UAVObjectField.FieldType.INT16, ChannelMaxElemNames, null) );
List<String> ChannelNeutralElemNames = new ArrayList<String>();
@ -274,6 +80,8 @@ public class ActuatorSettings extends UAVDataObject {
ChannelNeutralElemNames.add("5");
ChannelNeutralElemNames.add("6");
ChannelNeutralElemNames.add("7");
ChannelNeutralElemNames.add("8");
ChannelNeutralElemNames.add("9");
fields.add( new UAVObjectField("ChannelNeutral", "us", UAVObjectField.FieldType.INT16, ChannelNeutralElemNames, null) );
List<String> ChannelMinElemNames = new ArrayList<String>();
@ -285,8 +93,250 @@ public class ActuatorSettings extends UAVDataObject {
ChannelMinElemNames.add("5");
ChannelMinElemNames.add("6");
ChannelMinElemNames.add("7");
ChannelMinElemNames.add("8");
ChannelMinElemNames.add("9");
fields.add( new UAVObjectField("ChannelMin", "us", UAVObjectField.FieldType.INT16, ChannelMinElemNames, null) );
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("Channel9");
FixedWingRoll1EnumOptions.add("Channel10");
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("Channel9");
FixedWingRoll2EnumOptions.add("Channel10");
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("Channel9");
FixedWingPitch1EnumOptions.add("Channel10");
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("Channel9");
FixedWingPitch2EnumOptions.add("Channel10");
FixedWingPitch2EnumOptions.add("None");
fields.add( new UAVObjectField("FixedWingPitch2", "channel", UAVObjectField.FieldType.ENUM, FixedWingPitch2ElemNames, FixedWingPitch2EnumOptions) );
List<String> FixedWingYaw1ElemNames = new ArrayList<String>();
FixedWingYaw1ElemNames.add("0");
List<String> FixedWingYaw1EnumOptions = new ArrayList<String>();
FixedWingYaw1EnumOptions.add("Channel1");
FixedWingYaw1EnumOptions.add("Channel2");
FixedWingYaw1EnumOptions.add("Channel3");
FixedWingYaw1EnumOptions.add("Channel4");
FixedWingYaw1EnumOptions.add("Channel5");
FixedWingYaw1EnumOptions.add("Channel6");
FixedWingYaw1EnumOptions.add("Channel7");
FixedWingYaw1EnumOptions.add("Channel8");
FixedWingYaw1EnumOptions.add("Channel9");
FixedWingYaw1EnumOptions.add("Channel10");
FixedWingYaw1EnumOptions.add("None");
fields.add( new UAVObjectField("FixedWingYaw1", "channel", UAVObjectField.FieldType.ENUM, FixedWingYaw1ElemNames, FixedWingYaw1EnumOptions) );
List<String> FixedWingYaw2ElemNames = new ArrayList<String>();
FixedWingYaw2ElemNames.add("0");
List<String> FixedWingYaw2EnumOptions = new ArrayList<String>();
FixedWingYaw2EnumOptions.add("Channel1");
FixedWingYaw2EnumOptions.add("Channel2");
FixedWingYaw2EnumOptions.add("Channel3");
FixedWingYaw2EnumOptions.add("Channel4");
FixedWingYaw2EnumOptions.add("Channel5");
FixedWingYaw2EnumOptions.add("Channel6");
FixedWingYaw2EnumOptions.add("Channel7");
FixedWingYaw2EnumOptions.add("Channel8");
FixedWingYaw2EnumOptions.add("Channel9");
FixedWingYaw2EnumOptions.add("Channel10");
FixedWingYaw2EnumOptions.add("None");
fields.add( new UAVObjectField("FixedWingYaw2", "channel", UAVObjectField.FieldType.ENUM, FixedWingYaw2ElemNames, FixedWingYaw2EnumOptions) );
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("Channel9");
FixedWingThrottleEnumOptions.add("Channel10");
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("Channel9");
VTOLMotorNEnumOptions.add("Channel10");
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("Channel9");
VTOLMotorNEEnumOptions.add("Channel10");
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("Channel9");
VTOLMotorEEnumOptions.add("Channel10");
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("Channel9");
VTOLMotorSEEnumOptions.add("Channel10");
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("Channel9");
VTOLMotorSEnumOptions.add("Channel10");
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("Channel9");
VTOLMotorSWEnumOptions.add("Channel10");
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("Channel9");
VTOLMotorWEnumOptions.add("Channel10");
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("Channel9");
VTOLMotorNWEnumOptions.add("Channel10");
VTOLMotorNWEnumOptions.add("None");
fields.add( new UAVObjectField("VTOLMotorNW", "channel", UAVObjectField.FieldType.ENUM, VTOLMotorNWElemNames, VTOLMotorNWEnumOptions) );
List<String> ChannelTypeElemNames = new ArrayList<String>();
ChannelTypeElemNames.add("0");
ChannelTypeElemNames.add("1");
@ -296,10 +346,13 @@ public class ActuatorSettings extends UAVDataObject {
ChannelTypeElemNames.add("5");
ChannelTypeElemNames.add("6");
ChannelTypeElemNames.add("7");
ChannelTypeElemNames.add("8");
ChannelTypeElemNames.add("9");
List<String> ChannelTypeEnumOptions = new ArrayList<String>();
ChannelTypeEnumOptions.add("PWM");
ChannelTypeEnumOptions.add("MK");
ChannelTypeEnumOptions.add("ASTEC4");
ChannelTypeEnumOptions.add("PWM Alarm Buzzer");
fields.add( new UAVObjectField("ChannelType", "", UAVObjectField.FieldType.ENUM, ChannelTypeElemNames, ChannelTypeEnumOptions) );
List<String> ChannelAddrElemNames = new ArrayList<String>();
@ -311,8 +364,17 @@ public class ActuatorSettings extends UAVDataObject {
ChannelAddrElemNames.add("5");
ChannelAddrElemNames.add("6");
ChannelAddrElemNames.add("7");
ChannelAddrElemNames.add("8");
ChannelAddrElemNames.add("9");
fields.add( new UAVObjectField("ChannelAddr", "", UAVObjectField.FieldType.UINT8, ChannelAddrElemNames, null) );
List<String> MotorsSpinWhileArmedElemNames = new ArrayList<String>();
MotorsSpinWhileArmedElemNames.add("0");
List<String> MotorsSpinWhileArmedEnumOptions = new ArrayList<String>();
MotorsSpinWhileArmedEnumOptions.add("FALSE");
MotorsSpinWhileArmedEnumOptions.add("TRUE");
fields.add( new UAVObjectField("MotorsSpinWhileArmed", "", UAVObjectField.FieldType.ENUM, MotorsSpinWhileArmedElemNames, MotorsSpinWhileArmedEnumOptions) );
// Compute the number of bytes for this object
int numBytes = 0;
@ -358,20 +420,6 @@ public class ActuatorSettings extends UAVDataObject {
*/
public void setDefaultFieldValues()
{
getField("FixedWingRoll1").setValue("None");
getField("FixedWingRoll2").setValue("None");
getField("FixedWingPitch1").setValue("None");
getField("FixedWingPitch2").setValue("None");
getField("FixedWingYaw").setValue("None");
getField("FixedWingThrottle").setValue("None");
getField("VTOLMotorN").setValue("None");
getField("VTOLMotorNE").setValue("None");
getField("VTOLMotorE").setValue("None");
getField("VTOLMotorSE").setValue("None");
getField("VTOLMotorS").setValue("None");
getField("VTOLMotorSW").setValue("None");
getField("VTOLMotorW").setValue("None");
getField("VTOLMotorNW").setValue("None");
getField("ChannelUpdateFreq").setValue(50,0);
getField("ChannelUpdateFreq").setValue(50,1);
getField("ChannelUpdateFreq").setValue(50,2);
@ -384,6 +432,8 @@ public class ActuatorSettings extends UAVDataObject {
getField("ChannelMax").setValue(1000,5);
getField("ChannelMax").setValue(1000,6);
getField("ChannelMax").setValue(1000,7);
getField("ChannelMax").setValue(1000,8);
getField("ChannelMax").setValue(1000,9);
getField("ChannelNeutral").setValue(1000,0);
getField("ChannelNeutral").setValue(1000,1);
getField("ChannelNeutral").setValue(1000,2);
@ -392,6 +442,8 @@ public class ActuatorSettings extends UAVDataObject {
getField("ChannelNeutral").setValue(1000,5);
getField("ChannelNeutral").setValue(1000,6);
getField("ChannelNeutral").setValue(1000,7);
getField("ChannelNeutral").setValue(1000,8);
getField("ChannelNeutral").setValue(1000,9);
getField("ChannelMin").setValue(1000,0);
getField("ChannelMin").setValue(1000,1);
getField("ChannelMin").setValue(1000,2);
@ -400,6 +452,23 @@ public class ActuatorSettings extends UAVDataObject {
getField("ChannelMin").setValue(1000,5);
getField("ChannelMin").setValue(1000,6);
getField("ChannelMin").setValue(1000,7);
getField("ChannelMin").setValue(1000,8);
getField("ChannelMin").setValue(1000,9);
getField("FixedWingRoll1").setValue("None");
getField("FixedWingRoll2").setValue("None");
getField("FixedWingPitch1").setValue("None");
getField("FixedWingPitch2").setValue("None");
getField("FixedWingYaw1").setValue("None");
getField("FixedWingYaw2").setValue("None");
getField("FixedWingThrottle").setValue("None");
getField("VTOLMotorN").setValue("None");
getField("VTOLMotorNE").setValue("None");
getField("VTOLMotorE").setValue("None");
getField("VTOLMotorSE").setValue("None");
getField("VTOLMotorS").setValue("None");
getField("VTOLMotorSW").setValue("None");
getField("VTOLMotorW").setValue("None");
getField("VTOLMotorNW").setValue("None");
getField("ChannelType").setValue("PWM",0);
getField("ChannelType").setValue("PWM",1);
getField("ChannelType").setValue("PWM",2);
@ -408,6 +477,8 @@ public class ActuatorSettings extends UAVDataObject {
getField("ChannelType").setValue("PWM",5);
getField("ChannelType").setValue("PWM",6);
getField("ChannelType").setValue("PWM",7);
getField("ChannelType").setValue("PWM",8);
getField("ChannelType").setValue("PWM",9);
getField("ChannelAddr").setValue(0,0);
getField("ChannelAddr").setValue(1,1);
getField("ChannelAddr").setValue(2,2);
@ -416,6 +487,9 @@ public class ActuatorSettings extends UAVDataObject {
getField("ChannelAddr").setValue(5,5);
getField("ChannelAddr").setValue(6,6);
getField("ChannelAddr").setValue(7,7);
getField("ChannelAddr").setValue(8,8);
getField("ChannelAddr").setValue(9,9);
getField("MotorsSpinWhileArmed").setValue("FALSE");
}
@ -444,7 +518,7 @@ public class ActuatorSettings extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0x1BF864C2;
protected static final int OBJID = 0xF2875746;
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;

View File

@ -51,6 +51,10 @@ public class AhrsStatus extends UAVDataObject {
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> RunningTimeElemNames = new ArrayList<String>();
RunningTimeElemNames.add("0");
fields.add( new UAVObjectField("RunningTime", "ms", UAVObjectField.FieldType.UINT32, RunningTimeElemNames, null) );
List<String> SerialNumberElemNames = new ArrayList<String>();
SerialNumberElemNames.add("0");
SerialNumberElemNames.add("1");
@ -66,10 +70,6 @@ public class AhrsStatus extends UAVDataObject {
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) );
@ -190,7 +190,7 @@ public class AhrsStatus extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0x37A5F7A2;
protected static final int OBJID = 0x706D1AB8;
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;

View File

@ -110,7 +110,7 @@ public class AttitudeActual extends UAVDataObject {
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.flightTelemetryUpdatePeriod = 500;
metadata.flightTelemetryUpdatePeriod = 100;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_NEVER;
metadata.loggingUpdatePeriod = 0;
@ -152,7 +152,7 @@ public class AttitudeActual extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0xFC5B8CF4;
protected static final int OBJID = 0x33DAD5E6;
protected static final String NAME = "AttitudeActual";
protected static String DESCRIPTION = "The updated Attitude estimation from @ref AHRSCommsModule.";
protected static final boolean ISSINGLEINST = 1 == 1;

View File

@ -51,29 +51,29 @@ public class AttitudeRaw extends UAVDataObject {
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) );
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> gyrotempElemNames = new ArrayList<String>();
gyrotempElemNames.add("XY");
gyrotempElemNames.add("Z");
fields.add( new UAVObjectField("gyrotemp", "raw", UAVObjectField.FieldType.UINT16, gyrotempElemNames, null) );
// Compute the number of bytes for this object
int numBytes = 0;
@ -147,7 +147,7 @@ public class AttitudeRaw extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0x37747DE6;
protected static final int OBJID = 0xDB722974;
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;

View File

@ -51,12 +51,6 @@ public class AttitudeSettings extends UAVDataObject {
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) );
@ -69,6 +63,50 @@ public class AttitudeSettings extends UAVDataObject {
AccelKiElemNames.add("0");
fields.add( new UAVObjectField("AccelKi", "channel", UAVObjectField.FieldType.FLOAT32, AccelKiElemNames, null) );
List<String> YawBiasRateElemNames = new ArrayList<String>();
YawBiasRateElemNames.add("0");
fields.add( new UAVObjectField("YawBiasRate", "channel", UAVObjectField.FieldType.FLOAT32, YawBiasRateElemNames, null) );
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> GyroBiasElemNames = new ArrayList<String>();
GyroBiasElemNames.add("X");
GyroBiasElemNames.add("Y");
GyroBiasElemNames.add("Z");
fields.add( new UAVObjectField("GyroBias", "deg/s * 100", UAVObjectField.FieldType.INT16, GyroBiasElemNames, null) );
List<String> BoardRotationElemNames = new ArrayList<String>();
BoardRotationElemNames.add("Roll");
BoardRotationElemNames.add("Pitch");
BoardRotationElemNames.add("Yaw");
fields.add( new UAVObjectField("BoardRotation", "deg", UAVObjectField.FieldType.INT16, BoardRotationElemNames, null) );
List<String> ZeroDuringArmingElemNames = new ArrayList<String>();
ZeroDuringArmingElemNames.add("0");
List<String> ZeroDuringArmingEnumOptions = new ArrayList<String>();
ZeroDuringArmingEnumOptions.add("FALSE");
ZeroDuringArmingEnumOptions.add("TRUE");
fields.add( new UAVObjectField("ZeroDuringArming", "channel", UAVObjectField.FieldType.ENUM, ZeroDuringArmingElemNames, ZeroDuringArmingEnumOptions) );
List<String> BiasCorrectGyroElemNames = new ArrayList<String>();
BiasCorrectGyroElemNames.add("0");
List<String> BiasCorrectGyroEnumOptions = new ArrayList<String>();
BiasCorrectGyroEnumOptions.add("FALSE");
BiasCorrectGyroEnumOptions.add("TRUE");
fields.add( new UAVObjectField("BiasCorrectGyro", "channel", UAVObjectField.FieldType.ENUM, BiasCorrectGyroElemNames, BiasCorrectGyroEnumOptions) );
List<String> TrimFlightElemNames = new ArrayList<String>();
TrimFlightElemNames.add("0");
List<String> TrimFlightEnumOptions = new ArrayList<String>();
TrimFlightEnumOptions.add("NORMAL");
TrimFlightEnumOptions.add("START");
TrimFlightEnumOptions.add("LOAD");
fields.add( new UAVObjectField("TrimFlight", "channel", UAVObjectField.FieldType.ENUM, TrimFlightElemNames, TrimFlightEnumOptions) );
// Compute the number of bytes for this object
int numBytes = 0;
@ -114,12 +152,22 @@ public class AttitudeSettings extends UAVDataObject {
*/
public void setDefaultFieldValues()
{
getField("GyroGain").setValue(0.42);
getField("AccelKp").setValue(0.05);
getField("AccelKi").setValue(0.0001);
getField("YawBiasRate").setValue(1e-06);
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);
getField("GyroBias").setValue(0,0);
getField("GyroBias").setValue(0,1);
getField("GyroBias").setValue(0,2);
getField("BoardRotation").setValue(0,0);
getField("BoardRotation").setValue(0,1);
getField("BoardRotation").setValue(0,2);
getField("ZeroDuringArming").setValue("TRUE");
getField("BiasCorrectGyro").setValue("TRUE");
getField("TrimFlight").setValue("NORMAL");
}
@ -148,7 +196,7 @@ public class AttitudeSettings extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0x327BF29A;
protected static final int OBJID = 0xC307BC4A;
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;

View File

@ -136,7 +136,7 @@ public class BaroAltitude extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0xED4424F6;
protected static final int OBJID = 0x99622E6A;
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;

View 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.
* Desired camera outputs. Comes from @ref CameraStabilization module.
*
* @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 camera outputs. Comes from @ref CameraStabilization module.
generated from cameradesired.xml
**/
public class CameraDesired extends UAVDataObject {
public CameraDesired() {
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) );
// 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 {
CameraDesired obj = new CameraDesired();
obj.initialize(instID, this.getMetaObject());
return obj;
} catch (Exception e) {
return null;
}
}
/**
* Static function to retrieve an instance of the object.
*/
public CameraDesired GetInstance(UAVObjectManager objMngr, int instID)
{
return (CameraDesired)(objMngr.getObject(CameraDesired.OBJID, instID));
}
// Constants
protected static final int OBJID = 0x531F544E;
protected static final String NAME = "CameraDesired";
protected static String DESCRIPTION = "Desired camera outputs. Comes from @ref CameraStabilization module.";
protected static final boolean ISSINGLEINST = 1 == 1;
protected static final boolean ISSETTINGS = 0 == 1;
protected static int NUMBYTES = 0;
}

View File

@ -0,0 +1,205 @@
/**
******************************************************************************
*
* @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 CameraStab mmodule
*
* @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 CameraStab mmodule
generated from camerastabsettings.xml
**/
public class CameraStabSettings extends UAVDataObject {
public CameraStabSettings() {
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> MaxAxisLockRateElemNames = new ArrayList<String>();
MaxAxisLockRateElemNames.add("0");
fields.add( new UAVObjectField("MaxAxisLockRate", "deg/s", UAVObjectField.FieldType.FLOAT32, MaxAxisLockRateElemNames, null) );
List<String> ResponseTimeElemNames = new ArrayList<String>();
ResponseTimeElemNames.add("Roll");
ResponseTimeElemNames.add("Pitch");
ResponseTimeElemNames.add("Yaw");
fields.add( new UAVObjectField("ResponseTime", "ms", UAVObjectField.FieldType.UINT16, ResponseTimeElemNames, null) );
List<String> InputElemNames = new ArrayList<String>();
InputElemNames.add("Roll");
InputElemNames.add("Pitch");
InputElemNames.add("Yaw");
List<String> InputEnumOptions = new ArrayList<String>();
InputEnumOptions.add("Accessory0");
InputEnumOptions.add("Accessory1");
InputEnumOptions.add("Accessory2");
InputEnumOptions.add("Accessory3");
InputEnumOptions.add("Accessory4");
InputEnumOptions.add("Accessory5");
InputEnumOptions.add("None");
fields.add( new UAVObjectField("Input", "channel", UAVObjectField.FieldType.ENUM, InputElemNames, InputEnumOptions) );
List<String> InputRangeElemNames = new ArrayList<String>();
InputRangeElemNames.add("Roll");
InputRangeElemNames.add("Pitch");
InputRangeElemNames.add("Yaw");
fields.add( new UAVObjectField("InputRange", "deg", UAVObjectField.FieldType.UINT8, InputRangeElemNames, null) );
List<String> InputRateElemNames = new ArrayList<String>();
InputRateElemNames.add("Roll");
InputRateElemNames.add("Pitch");
InputRateElemNames.add("Yaw");
fields.add( new UAVObjectField("InputRate", "deg/s", UAVObjectField.FieldType.UINT8, InputRateElemNames, null) );
List<String> StabilizationModeElemNames = new ArrayList<String>();
StabilizationModeElemNames.add("Roll");
StabilizationModeElemNames.add("Pitch");
StabilizationModeElemNames.add("Yaw");
List<String> StabilizationModeEnumOptions = new ArrayList<String>();
StabilizationModeEnumOptions.add("Attitude");
StabilizationModeEnumOptions.add("AxisLock");
fields.add( new UAVObjectField("StabilizationMode", "", UAVObjectField.FieldType.ENUM, StabilizationModeElemNames, StabilizationModeEnumOptions) );
List<String> OutputRangeElemNames = new ArrayList<String>();
OutputRangeElemNames.add("Roll");
OutputRangeElemNames.add("Pitch");
OutputRangeElemNames.add("Yaw");
fields.add( new UAVObjectField("OutputRange", "deg", UAVObjectField.FieldType.UINT8, OutputRangeElemNames, 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("MaxAxisLockRate").setValue(1);
getField("ResponseTime").setValue(150,0);
getField("ResponseTime").setValue(150,1);
getField("ResponseTime").setValue(150,2);
getField("Input").setValue("None",0);
getField("Input").setValue("None",1);
getField("Input").setValue("None",2);
getField("InputRange").setValue(20,0);
getField("InputRange").setValue(20,1);
getField("InputRange").setValue(20,2);
getField("InputRate").setValue(50,0);
getField("InputRate").setValue(50,1);
getField("InputRate").setValue(50,2);
getField("StabilizationMode").setValue("Attitude",0);
getField("StabilizationMode").setValue("Attitude",1);
getField("StabilizationMode").setValue("Attitude",2);
getField("OutputRange").setValue(20,0);
getField("OutputRange").setValue(20,1);
getField("OutputRange").setValue(20,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 {
CameraStabSettings obj = new CameraStabSettings();
obj.initialize(instID, this.getMetaObject());
return obj;
} catch (Exception e) {
return null;
}
}
/**
* Static function to retrieve an instance of the object.
*/
public CameraStabSettings GetInstance(UAVObjectManager objMngr, int instID)
{
return (CameraStabSettings)(objMngr.getObject(CameraStabSettings.OBJID, instID));
}
// Constants
protected static final int OBJID = 0x3B95DDBA;
protected static final String NAME = "CameraStabSettings";
protected static String DESCRIPTION = "Settings for the @ref CameraStab mmodule";
protected static final boolean ISSINGLEINST = 1 == 1;
protected static final boolean ISSETTINGS = 1 == 1;
protected static int NUMBYTES = 0;
}

View File

@ -5,7 +5,7 @@
* @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.
* Allows testers to simulate various fault scenarios.
*
* @see The GNU Public License (GPL) Version 3
*
@ -39,29 +39,28 @@ import org.openpilot.uavtalk.UAVDataObject;
import org.openpilot.uavtalk.UAVObjectField;
/**
Select baud rate of telemetry. Warning - this must match your modem.
Allows testers to simulate various fault scenarios.
generated from telemetrysettings.xml
generated from faultsettings.xml
**/
public class TelemetrySettings extends UAVDataObject {
public class FaultSettings extends UAVDataObject {
public TelemetrySettings() {
public FaultSettings() {
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) );
List<String> ActivateFaultElemNames = new ArrayList<String>();
ActivateFaultElemNames.add("0");
List<String> ActivateFaultEnumOptions = new ArrayList<String>();
ActivateFaultEnumOptions.add("NoFault");
ActivateFaultEnumOptions.add("ModuleInitAssert");
ActivateFaultEnumOptions.add("InitOutOfMemory");
ActivateFaultEnumOptions.add("InitBusError");
ActivateFaultEnumOptions.add("RunawayTask");
ActivateFaultEnumOptions.add("TaskOutOfMemory");
fields.add( new UAVObjectField("ActivateFault", "fault", UAVObjectField.FieldType.ENUM, ActivateFaultElemNames, ActivateFaultEnumOptions) );
// Compute the number of bytes for this object
@ -108,7 +107,7 @@ public class TelemetrySettings extends UAVDataObject {
*/
public void setDefaultFieldValues()
{
getField("Speed").setValue("57600");
getField("ActivateFault").setValue("NoFault");
}
@ -120,7 +119,7 @@ public class TelemetrySettings extends UAVDataObject {
public UAVDataObject clone(int instID) {
// TODO: Need to get specific instance to clone
try {
TelemetrySettings obj = new TelemetrySettings();
FaultSettings obj = new FaultSettings();
obj.initialize(instID, this.getMetaObject());
return obj;
} catch (Exception e) {
@ -131,15 +130,15 @@ public class TelemetrySettings extends UAVDataObject {
/**
* Static function to retrieve an instance of the object.
*/
public TelemetrySettings GetInstance(UAVObjectManager objMngr, int instID)
public FaultSettings GetInstance(UAVObjectManager objMngr, int instID)
{
return (TelemetrySettings)(objMngr.getObject(TelemetrySettings.OBJID, instID));
return (FaultSettings)(objMngr.getObject(FaultSettings.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 int OBJID = 0x2778BA3C;
protected static final String NAME = "FaultSettings";
protected static String DESCRIPTION = "Allows testers to simulate various fault scenarios.";
protected static final boolean ISSINGLEINST = 1 == 1;
protected static final boolean ISSETTINGS = 1 == 1;
protected static int NUMBYTES = 0;

View File

@ -5,7 +5,7 @@
* @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
* Queries board for SN, model, revision, and sends reset command
*
* @see The GNU Public License (GPL) Version 3
*
@ -39,7 +39,7 @@ import org.openpilot.uavtalk.UAVDataObject;
import org.openpilot.uavtalk.UAVObjectField;
/**
Firmware IAP
Queries board for SN, model, revision, and sends reset command
generated from firmwareiapobj.xml
**/
@ -51,10 +51,18 @@ public class FirmwareIAPObj extends UAVDataObject {
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> crcElemNames = new ArrayList<String>();
crcElemNames.add("0");
fields.add( new UAVObjectField("crc", "", UAVObjectField.FieldType.UINT32, crcElemNames, null) );
List<String> CommandElemNames = new ArrayList<String>();
CommandElemNames.add("0");
fields.add( new UAVObjectField("Command", "", UAVObjectField.FieldType.UINT16, CommandElemNames, null) );
List<String> BoardRevisionElemNames = new ArrayList<String>();
BoardRevisionElemNames.add("0");
fields.add( new UAVObjectField("BoardRevision", "", UAVObjectField.FieldType.UINT16, BoardRevisionElemNames, null) );
List<String> DescriptionElemNames = new ArrayList<String>();
DescriptionElemNames.add("0");
DescriptionElemNames.add("1");
@ -96,71 +104,22 @@ public class FirmwareIAPObj extends UAVDataObject {
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> CPUSerialElemNames = new ArrayList<String>();
CPUSerialElemNames.add("0");
CPUSerialElemNames.add("1");
CPUSerialElemNames.add("2");
CPUSerialElemNames.add("3");
CPUSerialElemNames.add("4");
CPUSerialElemNames.add("5");
CPUSerialElemNames.add("6");
CPUSerialElemNames.add("7");
CPUSerialElemNames.add("8");
CPUSerialElemNames.add("9");
CPUSerialElemNames.add("10");
CPUSerialElemNames.add("11");
fields.add( new UAVObjectField("CPUSerial", "", UAVObjectField.FieldType.UINT8, CPUSerialElemNames, null) );
List<String> BoardTypeElemNames = new ArrayList<String>();
BoardTypeElemNames.add("0");
@ -170,10 +129,6 @@ public class FirmwareIAPObj extends UAVDataObject {
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;
@ -247,9 +202,9 @@ public class FirmwareIAPObj extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0x1A8ECC2;
protected static final int OBJID = 0x3CCDFB68;
protected static final String NAME = "FirmwareIAPObj";
protected static String DESCRIPTION = "Firmware IAP";
protected static String DESCRIPTION = "Queries board for SN, model, revision, and sends reset command";
protected static final boolean ISSINGLEINST = 1 == 1;
protected static final boolean ISSETTINGS = 0 == 1;
protected static int NUMBYTES = 0;

View File

@ -0,0 +1,177 @@
/**
******************************************************************************
*
* @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.
* Flight Battery configuration.
*
* @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;
/**
Flight Battery configuration.
generated from flightbatterysettings.xml
**/
public class FlightBatterySettings extends UAVDataObject {
public FlightBatterySettings() {
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> CapacityElemNames = new ArrayList<String>();
CapacityElemNames.add("0");
fields.add( new UAVObjectField("Capacity", "mAh", UAVObjectField.FieldType.UINT32, CapacityElemNames, null) );
List<String> VoltageThresholdsElemNames = new ArrayList<String>();
VoltageThresholdsElemNames.add("Warning");
VoltageThresholdsElemNames.add("Alarm");
fields.add( new UAVObjectField("VoltageThresholds", "V", UAVObjectField.FieldType.FLOAT32, VoltageThresholdsElemNames, null) );
List<String> SensorCalibrationsElemNames = new ArrayList<String>();
SensorCalibrationsElemNames.add("VoltageFactor");
SensorCalibrationsElemNames.add("CurrentFactor");
fields.add( new UAVObjectField("SensorCalibrations", "", UAVObjectField.FieldType.FLOAT32, SensorCalibrationsElemNames, null) );
List<String> TypeElemNames = new ArrayList<String>();
TypeElemNames.add("0");
List<String> TypeEnumOptions = new ArrayList<String>();
TypeEnumOptions.add("LiPo");
TypeEnumOptions.add("A123");
TypeEnumOptions.add("LiCo");
TypeEnumOptions.add("LiFeSO4");
TypeEnumOptions.add("None");
fields.add( new UAVObjectField("Type", "", UAVObjectField.FieldType.ENUM, TypeElemNames, TypeEnumOptions) );
List<String> NbCellsElemNames = new ArrayList<String>();
NbCellsElemNames.add("0");
fields.add( new UAVObjectField("NbCells", "", UAVObjectField.FieldType.UINT8, NbCellsElemNames, null) );
List<String> SensorTypeElemNames = new ArrayList<String>();
SensorTypeElemNames.add("0");
List<String> SensorTypeEnumOptions = new ArrayList<String>();
SensorTypeEnumOptions.add("None");
fields.add( new UAVObjectField("SensorType", "", UAVObjectField.FieldType.ENUM, SensorTypeElemNames, SensorTypeEnumOptions) );
// 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("Capacity").setValue(2200);
getField("VoltageThresholds").setValue(9.8,0);
getField("VoltageThresholds").setValue(9.2,1);
getField("SensorCalibrations").setValue(1,0);
getField("SensorCalibrations").setValue(1,1);
getField("Type").setValue("LiPo");
getField("NbCells").setValue(3);
getField("SensorType").setValue("None");
}
/**
* 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 {
FlightBatterySettings obj = new FlightBatterySettings();
obj.initialize(instID, this.getMetaObject());
return obj;
} catch (Exception e) {
return null;
}
}
/**
* Static function to retrieve an instance of the object.
*/
public FlightBatterySettings GetInstance(UAVObjectManager objMngr, int instID)
{
return (FlightBatterySettings)(objMngr.getObject(FlightBatterySettings.OBJID, instID));
}
// Constants
protected static final int OBJID = 0xF172BB18;
protected static final String NAME = "FlightBatterySettings";
protected static String DESCRIPTION = "Flight Battery configuration.";
protected static final boolean ISSINGLEINST = 1 == 1;
protected static final boolean ISSETTINGS = 1 == 1;
protected static int NUMBYTES = 0;
}

View File

@ -154,7 +154,7 @@ public class FlightBatteryState extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0x791A50E;
protected static final int OBJID = 0x8C0D756;
protected static final String NAME = "FlightBatteryState";
protected static String DESCRIPTION = "Battery status information.";
protected static final boolean ISSINGLEINST = 1 == 1;

View File

@ -133,7 +133,7 @@ public class FlightPlanControl extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0x6B4FE6DA;
protected static final int OBJID = 0x53E3F180;
protected static final String NAME = "FlightPlanControl";
protected static String DESCRIPTION = "Control the flight plan script";
protected static final boolean ISSINGLEINST = 1 == 1;

View File

@ -129,7 +129,7 @@ public class FlightPlanSettings extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0x85368422;
protected static final int OBJID = 0x92E9FF76;
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;

View File

@ -51,6 +51,19 @@ public class FlightPlanStatus extends UAVDataObject {
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
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> DebugElemNames = new ArrayList<String>();
DebugElemNames.add("0");
DebugElemNames.add("1");
fields.add( new UAVObjectField("Debug", "", UAVObjectField.FieldType.FLOAT32, DebugElemNames, null) );
List<String> StatusElemNames = new ArrayList<String>();
StatusElemNames.add("0");
List<String> StatusEnumOptions = new ArrayList<String>();
@ -83,22 +96,6 @@ public class FlightPlanStatus extends UAVDataObject {
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;
@ -144,10 +141,10 @@ public class FlightPlanStatus extends UAVDataObject {
*/
public void setDefaultFieldValues()
{
getField("Debug").setValue(0,0);
getField("Debug").setValue(0,1);
getField("Status").setValue("Stopped");
getField("ErrorType").setValue("None");
getField("Debug1").setValue(0);
getField("Debug2").setValue(0);
}
@ -176,7 +173,7 @@ public class FlightPlanStatus extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0x9FC14812;
protected static final int OBJID = 0x2206EE46;
protected static final String NAME = "FlightPlanStatus";
protected static String DESCRIPTION = "Status of the flight plan script";
protected static final boolean ISSINGLEINST = 1 == 1;

View File

@ -0,0 +1,155 @@
/**
******************************************************************************
*
* @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 major flight status information for other 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;
/**
Contains major flight status information for other modules.
generated from flightstatus.xml
**/
public class FlightStatus extends UAVDataObject {
public FlightStatus() {
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> ArmedElemNames = new ArrayList<String>();
ArmedElemNames.add("0");
List<String> ArmedEnumOptions = new ArrayList<String>();
ArmedEnumOptions.add("Disarmed");
ArmedEnumOptions.add("Arming");
ArmedEnumOptions.add("Armed");
fields.add( new UAVObjectField("Armed", "", UAVObjectField.FieldType.ENUM, ArmedElemNames, ArmedEnumOptions) );
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) );
// 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 = 5000;
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("Armed").setValue("Disarmed");
}
/**
* 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 {
FlightStatus obj = new FlightStatus();
obj.initialize(instID, this.getMetaObject());
return obj;
} catch (Exception e) {
return null;
}
}
/**
* Static function to retrieve an instance of the object.
*/
public FlightStatus GetInstance(UAVObjectManager objMngr, int instID)
{
return (FlightStatus)(objMngr.getObject(FlightStatus.OBJID, instID));
}
// Constants
protected static final int OBJID = 0x743DB13C;
protected static final String NAME = "FlightStatus";
protected static String DESCRIPTION = "Contains major flight status information for other modules.";
protected static final boolean ISSINGLEINST = 1 == 1;
protected static final boolean ISSETTINGS = 0 == 1;
protected static int NUMBYTES = 0;
}

View File

@ -51,15 +51,6 @@ public class FlightTelemetryStats extends UAVDataObject {
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) );
@ -80,6 +71,15 @@ public class FlightTelemetryStats extends UAVDataObject {
TxRetriesElemNames.add("0");
fields.add( new UAVObjectField("TxRetries", "count", UAVObjectField.FieldType.UINT32, TxRetriesElemNames, null) );
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) );
// Compute the number of bytes for this object
int numBytes = 0;
@ -153,7 +153,7 @@ public class FlightTelemetryStats extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0x660C265E;
protected static final int OBJID = 0x2F7E2902;
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;

View File

@ -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.
* A receiver channel group carried over the telemetry link.
*
* @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;
/**
A receiver channel group carried over the telemetry link.
generated from gcsreceiver.xml
**/
public class GCSReceiver extends UAVDataObject {
public GCSReceiver() {
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");
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_ONCHANGE;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READONLY;
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_NEVER;
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 {
GCSReceiver obj = new GCSReceiver();
obj.initialize(instID, this.getMetaObject());
return obj;
} catch (Exception e) {
return null;
}
}
/**
* Static function to retrieve an instance of the object.
*/
public GCSReceiver GetInstance(UAVObjectManager objMngr, int instID)
{
return (GCSReceiver)(objMngr.getObject(GCSReceiver.OBJID, instID));
}
// Constants
protected static final int OBJID = 0xCC7E2BBC;
protected static final String NAME = "GCSReceiver";
protected static String DESCRIPTION = "A receiver channel group carried over the telemetry link.";
protected static final boolean ISSINGLEINST = 1 == 1;
protected static final boolean ISSETTINGS = 0 == 1;
protected static int NUMBYTES = 0;
}

View File

@ -51,15 +51,6 @@ public class GCSTelemetryStats extends UAVDataObject {
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) );
@ -80,6 +71,15 @@ public class GCSTelemetryStats extends UAVDataObject {
TxRetriesElemNames.add("0");
fields.add( new UAVObjectField("TxRetries", "count", UAVObjectField.FieldType.UINT32, TxRetriesElemNames, null) );
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) );
// Compute the number of bytes for this object
int numBytes = 0;
@ -153,7 +153,7 @@ public class GCSTelemetryStats extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0x771E1046;
protected static final int OBJID = 0xABC72744;
protected static final String NAME = "GCSTelemetryStats";
protected static String DESCRIPTION = "The telemetry statistics from the ground computer";
protected static final boolean ISSINGLEINST = 1 == 1;

View File

@ -51,15 +51,6 @@ public class GPSPosition extends UAVDataObject {
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) );
@ -84,10 +75,6 @@ public class GPSPosition extends UAVDataObject {
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) );
@ -100,6 +87,19 @@ public class GPSPosition extends UAVDataObject {
VDOPElemNames.add("0");
fields.add( new UAVObjectField("VDOP", "", UAVObjectField.FieldType.FLOAT32, VDOPElemNames, null) );
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> SatellitesElemNames = new ArrayList<String>();
SatellitesElemNames.add("0");
fields.add( new UAVObjectField("Satellites", "", UAVObjectField.FieldType.INT8, SatellitesElemNames, null) );
// Compute the number of bytes for this object
int numBytes = 0;
@ -173,7 +173,7 @@ public class GPSPosition extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0xB5495042;
protected static final int OBJID = 0xE2A323B6;
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;

View File

@ -51,29 +51,6 @@ public class GPSSatellites extends UAVDataObject {
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");
@ -112,6 +89,29 @@ public class GPSSatellites extends UAVDataObject {
AzimuthElemNames.add("15");
fields.add( new UAVObjectField("Azimuth", "degrees", UAVObjectField.FieldType.FLOAT32, AzimuthElemNames, null) );
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> SNRElemNames = new ArrayList<String>();
SNRElemNames.add("0");
SNRElemNames.add("1");
@ -204,7 +204,7 @@ public class GPSSatellites extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0xD62FA3AE;
protected static final int OBJID = 0x920D998;
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;

View File

@ -51,6 +51,10 @@ public class GPSTime extends UAVDataObject {
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> YearElemNames = new ArrayList<String>();
YearElemNames.add("0");
fields.add( new UAVObjectField("Year", "", UAVObjectField.FieldType.INT16, YearElemNames, null) );
List<String> MonthElemNames = new ArrayList<String>();
MonthElemNames.add("0");
fields.add( new UAVObjectField("Month", "", UAVObjectField.FieldType.INT8, MonthElemNames, null) );
@ -59,10 +63,6 @@ public class GPSTime extends UAVDataObject {
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) );
@ -148,7 +148,7 @@ public class GPSTime extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0x56FFF0A2;
protected static final int OBJID = 0xD4478084;
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;

View File

@ -51,29 +51,24 @@ public class GuidanceSettings extends UAVDataObject {
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> HorizontalPosPIElemNames = new ArrayList<String>();
HorizontalPosPIElemNames.add("Kp");
HorizontalPosPIElemNames.add("Ki");
HorizontalPosPIElemNames.add("ILimit");
fields.add( new UAVObjectField("HorizontalPosPI", "(cm/s)/cm", UAVObjectField.FieldType.FLOAT32, HorizontalPosPIElemNames, 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) );
fields.add( new UAVObjectField("HorizontalVelPID", "deg/(cm/s)", 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> VerticalPosPIElemNames = new ArrayList<String>();
VerticalPosPIElemNames.add("Kp");
VerticalPosPIElemNames.add("Ki");
VerticalPosPIElemNames.add("ILimit");
fields.add( new UAVObjectField("VerticalPosPI", "", UAVObjectField.FieldType.FLOAT32, VerticalPosPIElemNames, null) );
List<String> VerticalVelPIDElemNames = new ArrayList<String>();
VerticalVelPIDElemNames.add("Kp");
@ -82,13 +77,6 @@ public class GuidanceSettings extends UAVDataObject {
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) );
@ -97,6 +85,28 @@ public class GuidanceSettings extends UAVDataObject {
UpdatePeriodElemNames.add("0");
fields.add( new UAVObjectField("UpdatePeriod", "", UAVObjectField.FieldType.INT32, UpdatePeriodElemNames, null) );
List<String> HorizontalVelMaxElemNames = new ArrayList<String>();
HorizontalVelMaxElemNames.add("0");
fields.add( new UAVObjectField("HorizontalVelMax", "cm/s", UAVObjectField.FieldType.UINT16, HorizontalVelMaxElemNames, null) );
List<String> VerticalVelMaxElemNames = new ArrayList<String>();
VerticalVelMaxElemNames.add("0");
fields.add( new UAVObjectField("VerticalVelMax", "cm/s", UAVObjectField.FieldType.UINT16, VerticalVelMaxElemNames, null) );
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> 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) );
// Compute the number of bytes for this object
int numBytes = 0;
@ -142,22 +152,26 @@ public class GuidanceSettings extends UAVDataObject {
*/
public void setDefaultFieldValues()
{
getField("GuidanceMode").setValue("DUAL_LOOP");
getField("HorizontalP").setValue(0.2,0);
getField("HorizontalP").setValue(150,1);
getField("HorizontalVelPID").setValue(0.1,0);
getField("HorizontalPosPI").setValue(0.1,0);
getField("HorizontalPosPI").setValue(0.001,1);
getField("HorizontalPosPI").setValue(300,2);
getField("HorizontalVelPID").setValue(0.05,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("VerticalPosPI").setValue(0.1,0);
getField("VerticalPosPI").setValue(0.001,1);
getField("VerticalPosPI").setValue(200,2);
getField("VerticalVelPID").setValue(0.1,0);
getField("VerticalVelPID").setValue(0,1);
getField("VerticalVelPID").setValue(0,2);
getField("VerticalVelPID").setValue(0,3);
getField("ThrottleControl").setValue("FALSE");
getField("MaxRollPitch").setValue(10);
getField("UpdatePeriod").setValue(100);
getField("HorizontalVelMax").setValue(300);
getField("VerticalVelMax").setValue(150);
getField("GuidanceMode").setValue("DUAL_LOOP");
getField("ThrottleControl").setValue("FALSE");
}
@ -186,7 +200,7 @@ public class GuidanceSettings extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0x74740AA2;
protected static final int OBJID = 0x6EA79FB4;
protected static final String NAME = "GuidanceSettings";
protected static String DESCRIPTION = "Settings for the @ref GuidanceModule";
protected static final boolean ISSINGLEINST = 1 == 1;

View File

@ -51,13 +51,6 @@ public class HomeLocation extends UAVDataObject {
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) );
@ -94,6 +87,17 @@ public class HomeLocation extends UAVDataObject {
BeElemNames.add("2");
fields.add( new UAVObjectField("Be", "", UAVObjectField.FieldType.FLOAT32, BeElemNames, null) );
List<String> g_eElemNames = new ArrayList<String>();
g_eElemNames.add("0");
fields.add( new UAVObjectField("g_e", "m/s^2", UAVObjectField.FieldType.FLOAT32, g_eElemNames, null) );
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) );
// Compute the number of bytes for this object
int numBytes = 0;
@ -139,7 +143,6 @@ public class HomeLocation extends UAVDataObject {
*/
public void setDefaultFieldValues()
{
getField("Set").setValue("FALSE");
getField("Latitude").setValue(0);
getField("Longitude").setValue(0);
getField("Altitude").setValue(0);
@ -158,6 +161,8 @@ public class HomeLocation extends UAVDataObject {
getField("Be").setValue(0,0);
getField("Be").setValue(0,1);
getField("Be").setValue(0,2);
getField("g_e").setValue(9.81);
getField("Set").setValue("FALSE");
}
@ -186,7 +191,7 @@ public class HomeLocation extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0xD6008ED2;
protected static final int OBJID = 0x5BB3AEFC;
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;

View File

@ -0,0 +1,291 @@
/**
******************************************************************************
*
* @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.
* Selection of optional hardware configurations.
*
* @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;
/**
Selection of optional hardware configurations.
generated from hwsettings.xml
**/
public class HwSettings extends UAVDataObject {
public HwSettings() {
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> CC_RcvrPortElemNames = new ArrayList<String>();
CC_RcvrPortElemNames.add("0");
List<String> CC_RcvrPortEnumOptions = new ArrayList<String>();
CC_RcvrPortEnumOptions.add("Disabled");
CC_RcvrPortEnumOptions.add("PWM");
CC_RcvrPortEnumOptions.add("PPM");
CC_RcvrPortEnumOptions.add("PPM+Outputs");
CC_RcvrPortEnumOptions.add("Outputs");
fields.add( new UAVObjectField("CC_RcvrPort", "function", UAVObjectField.FieldType.ENUM, CC_RcvrPortElemNames, CC_RcvrPortEnumOptions) );
List<String> CC_MainPortElemNames = new ArrayList<String>();
CC_MainPortElemNames.add("0");
List<String> CC_MainPortEnumOptions = new ArrayList<String>();
CC_MainPortEnumOptions.add("Disabled");
CC_MainPortEnumOptions.add("Telemetry");
CC_MainPortEnumOptions.add("GPS");
CC_MainPortEnumOptions.add("S.Bus");
CC_MainPortEnumOptions.add("DSM2");
CC_MainPortEnumOptions.add("DSMX (10bit)");
CC_MainPortEnumOptions.add("DSMX (11bit)");
CC_MainPortEnumOptions.add("ComAux");
CC_MainPortEnumOptions.add("ComBridge");
fields.add( new UAVObjectField("CC_MainPort", "function", UAVObjectField.FieldType.ENUM, CC_MainPortElemNames, CC_MainPortEnumOptions) );
List<String> CC_FlexiPortElemNames = new ArrayList<String>();
CC_FlexiPortElemNames.add("0");
List<String> CC_FlexiPortEnumOptions = new ArrayList<String>();
CC_FlexiPortEnumOptions.add("Disabled");
CC_FlexiPortEnumOptions.add("Telemetry");
CC_FlexiPortEnumOptions.add("GPS");
CC_FlexiPortEnumOptions.add("I2C");
CC_FlexiPortEnumOptions.add("DSM2");
CC_FlexiPortEnumOptions.add("DSMX (10bit)");
CC_FlexiPortEnumOptions.add("DSMX (11bit)");
CC_FlexiPortEnumOptions.add("ComAux");
CC_FlexiPortEnumOptions.add("ComBridge");
fields.add( new UAVObjectField("CC_FlexiPort", "function", UAVObjectField.FieldType.ENUM, CC_FlexiPortElemNames, CC_FlexiPortEnumOptions) );
List<String> OP_RcvrPortElemNames = new ArrayList<String>();
OP_RcvrPortElemNames.add("0");
List<String> OP_RcvrPortEnumOptions = new ArrayList<String>();
OP_RcvrPortEnumOptions.add("Disabled");
OP_RcvrPortEnumOptions.add("PWM");
OP_RcvrPortEnumOptions.add("PPM");
OP_RcvrPortEnumOptions.add("DSM2");
OP_RcvrPortEnumOptions.add("DSMX (10bit)");
OP_RcvrPortEnumOptions.add("DSMX (11bit)");
OP_RcvrPortEnumOptions.add("Debug");
fields.add( new UAVObjectField("OP_RcvrPort", "function", UAVObjectField.FieldType.ENUM, OP_RcvrPortElemNames, OP_RcvrPortEnumOptions) );
List<String> OP_MainPortElemNames = new ArrayList<String>();
OP_MainPortElemNames.add("0");
List<String> OP_MainPortEnumOptions = new ArrayList<String>();
OP_MainPortEnumOptions.add("Disabled");
OP_MainPortEnumOptions.add("Telemetry");
fields.add( new UAVObjectField("OP_MainPort", "function", UAVObjectField.FieldType.ENUM, OP_MainPortElemNames, OP_MainPortEnumOptions) );
List<String> OP_FlexiPortElemNames = new ArrayList<String>();
OP_FlexiPortElemNames.add("0");
List<String> OP_FlexiPortEnumOptions = new ArrayList<String>();
OP_FlexiPortEnumOptions.add("Disabled");
OP_FlexiPortEnumOptions.add("GPS");
fields.add( new UAVObjectField("OP_FlexiPort", "function", UAVObjectField.FieldType.ENUM, OP_FlexiPortElemNames, OP_FlexiPortEnumOptions) );
List<String> TelemetrySpeedElemNames = new ArrayList<String>();
TelemetrySpeedElemNames.add("0");
List<String> TelemetrySpeedEnumOptions = new ArrayList<String>();
TelemetrySpeedEnumOptions.add("2400");
TelemetrySpeedEnumOptions.add("4800");
TelemetrySpeedEnumOptions.add("9600");
TelemetrySpeedEnumOptions.add("19200");
TelemetrySpeedEnumOptions.add("38400");
TelemetrySpeedEnumOptions.add("57600");
TelemetrySpeedEnumOptions.add("115200");
fields.add( new UAVObjectField("TelemetrySpeed", "bps", UAVObjectField.FieldType.ENUM, TelemetrySpeedElemNames, TelemetrySpeedEnumOptions) );
List<String> GPSSpeedElemNames = new ArrayList<String>();
GPSSpeedElemNames.add("0");
List<String> GPSSpeedEnumOptions = new ArrayList<String>();
GPSSpeedEnumOptions.add("2400");
GPSSpeedEnumOptions.add("4800");
GPSSpeedEnumOptions.add("9600");
GPSSpeedEnumOptions.add("19200");
GPSSpeedEnumOptions.add("38400");
GPSSpeedEnumOptions.add("57600");
GPSSpeedEnumOptions.add("115200");
fields.add( new UAVObjectField("GPSSpeed", "bps", UAVObjectField.FieldType.ENUM, GPSSpeedElemNames, GPSSpeedEnumOptions) );
List<String> ComUsbBridgeSpeedElemNames = new ArrayList<String>();
ComUsbBridgeSpeedElemNames.add("0");
List<String> ComUsbBridgeSpeedEnumOptions = new ArrayList<String>();
ComUsbBridgeSpeedEnumOptions.add("2400");
ComUsbBridgeSpeedEnumOptions.add("4800");
ComUsbBridgeSpeedEnumOptions.add("9600");
ComUsbBridgeSpeedEnumOptions.add("19200");
ComUsbBridgeSpeedEnumOptions.add("38400");
ComUsbBridgeSpeedEnumOptions.add("57600");
ComUsbBridgeSpeedEnumOptions.add("115200");
fields.add( new UAVObjectField("ComUsbBridgeSpeed", "bps", UAVObjectField.FieldType.ENUM, ComUsbBridgeSpeedElemNames, ComUsbBridgeSpeedEnumOptions) );
List<String> USB_DeviceTypeElemNames = new ArrayList<String>();
USB_DeviceTypeElemNames.add("0");
List<String> USB_DeviceTypeEnumOptions = new ArrayList<String>();
USB_DeviceTypeEnumOptions.add("HID-only");
USB_DeviceTypeEnumOptions.add("HID+VCP");
USB_DeviceTypeEnumOptions.add("VCP-only");
fields.add( new UAVObjectField("USB_DeviceType", "descriptor", UAVObjectField.FieldType.ENUM, USB_DeviceTypeElemNames, USB_DeviceTypeEnumOptions) );
List<String> USB_HIDPortElemNames = new ArrayList<String>();
USB_HIDPortElemNames.add("0");
List<String> USB_HIDPortEnumOptions = new ArrayList<String>();
USB_HIDPortEnumOptions.add("USBTelemetry");
USB_HIDPortEnumOptions.add("Disabled");
fields.add( new UAVObjectField("USB_HIDPort", "function", UAVObjectField.FieldType.ENUM, USB_HIDPortElemNames, USB_HIDPortEnumOptions) );
List<String> USB_VCPPortElemNames = new ArrayList<String>();
USB_VCPPortElemNames.add("0");
List<String> USB_VCPPortEnumOptions = new ArrayList<String>();
USB_VCPPortEnumOptions.add("USBTelemetry");
USB_VCPPortEnumOptions.add("ComBridge");
USB_VCPPortEnumOptions.add("Disabled");
fields.add( new UAVObjectField("USB_VCPPort", "function", UAVObjectField.FieldType.ENUM, USB_VCPPortElemNames, USB_VCPPortEnumOptions) );
List<String> OptionalModulesElemNames = new ArrayList<String>();
OptionalModulesElemNames.add("CameraStab");
OptionalModulesElemNames.add("GPS");
OptionalModulesElemNames.add("ComUsbBridge");
OptionalModulesElemNames.add("Fault");
OptionalModulesElemNames.add("Altitude");
List<String> OptionalModulesEnumOptions = new ArrayList<String>();
OptionalModulesEnumOptions.add("Disabled");
OptionalModulesEnumOptions.add("Enabled");
fields.add( new UAVObjectField("OptionalModules", "", UAVObjectField.FieldType.ENUM, OptionalModulesElemNames, OptionalModulesEnumOptions) );
List<String> DSMxBindElemNames = new ArrayList<String>();
DSMxBindElemNames.add("0");
fields.add( new UAVObjectField("DSMxBind", "", UAVObjectField.FieldType.UINT8, DSMxBindElemNames, 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("CC_RcvrPort").setValue("PWM");
getField("CC_MainPort").setValue("Disabled");
getField("CC_FlexiPort").setValue("Disabled");
getField("OP_RcvrPort").setValue("PWM");
getField("OP_MainPort").setValue("Telemetry");
getField("OP_FlexiPort").setValue("GPS");
getField("TelemetrySpeed").setValue("57600");
getField("GPSSpeed").setValue("57600");
getField("ComUsbBridgeSpeed").setValue("57600");
getField("USB_DeviceType").setValue("HID-only");
getField("USB_HIDPort").setValue("USBTelemetry");
getField("USB_VCPPort").setValue("Disabled");
getField("OptionalModules").setValue("Disabled",0);
getField("OptionalModules").setValue("Disabled",1);
getField("OptionalModules").setValue("Disabled",2);
getField("OptionalModules").setValue("Disabled",3);
getField("OptionalModules").setValue("Disabled",4);
getField("DSMxBind").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 {
HwSettings obj = new HwSettings();
obj.initialize(instID, this.getMetaObject());
return obj;
} catch (Exception e) {
return null;
}
}
/**
* Static function to retrieve an instance of the object.
*/
public HwSettings GetInstance(UAVObjectManager objMngr, int instID)
{
return (HwSettings)(objMngr.getObject(HwSettings.OBJID, instID));
}
// Constants
protected static final int OBJID = 0x2EE6575A;
protected static final String NAME = "HwSettings";
protected static String DESCRIPTION = "Selection of optional hardware configurations.";
protected static final boolean ISSINGLEINST = 1 == 1;
protected static final boolean ISSETTINGS = 1 == 1;
protected static int NUMBYTES = 0;
}

View File

@ -51,6 +51,22 @@ public class I2CStats extends UAVDataObject {
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
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_errorsElemNames = new ArrayList<String>();
event_errorsElemNames.add("0");
fields.add( new UAVObjectField("event_errors", "", UAVObjectField.FieldType.UINT8, event_errorsElemNames, null) );
@ -79,22 +95,6 @@ public class I2CStats extends UAVDataObject {
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");
@ -227,7 +227,7 @@ public class I2CStats extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0x23CE9E9C;
protected static final int OBJID = 0xB714823E;
protected static final String NAME = "I2CStats";
protected static String DESCRIPTION = "Tracks statistics on the I2C bus.";
protected static final boolean ISSINGLEINST = 1 == 1;

View File

@ -51,19 +51,9 @@ public class ManualControlCommand extends UAVDataObject {
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> ThrottleElemNames = new ArrayList<String>();
ThrottleElemNames.add("0");
fields.add( new UAVObjectField("Throttle", "%", UAVObjectField.FieldType.FLOAT32, ThrottleElemNames, null) );
List<String> RollElemNames = new ArrayList<String>();
RollElemNames.add("0");
@ -77,32 +67,9 @@ public class ManualControlCommand extends UAVDataObject {
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> CollectiveElemNames = new ArrayList<String>();
CollectiveElemNames.add("0");
fields.add( new UAVObjectField("Collective", "%", UAVObjectField.FieldType.FLOAT32, CollectiveElemNames, null) );
List<String> ChannelElemNames = new ArrayList<String>();
ChannelElemNames.add("0");
@ -113,8 +80,16 @@ public class ManualControlCommand extends UAVDataObject {
ChannelElemNames.add("5");
ChannelElemNames.add("6");
ChannelElemNames.add("7");
ChannelElemNames.add("8");
fields.add( new UAVObjectField("Channel", "us", UAVObjectField.FieldType.UINT16, ChannelElemNames, null) );
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) );
// Compute the number of bytes for this object
int numBytes = 0;
@ -188,7 +163,7 @@ public class ManualControlCommand extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0x926794;
protected static final int OBJID = 0x1E82C2D2;
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;

View File

@ -51,125 +51,77 @@ public class ManualControlSettings extends UAVDataObject {
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> ChannelMinElemNames = new ArrayList<String>();
ChannelMinElemNames.add("Throttle");
ChannelMinElemNames.add("Roll");
ChannelMinElemNames.add("Pitch");
ChannelMinElemNames.add("Yaw");
ChannelMinElemNames.add("FlightMode");
ChannelMinElemNames.add("Collective");
ChannelMinElemNames.add("Accessory0");
ChannelMinElemNames.add("Accessory1");
ChannelMinElemNames.add("Accessory2");
fields.add( new UAVObjectField("ChannelMin", "us", UAVObjectField.FieldType.INT16, ChannelMinElemNames, null) );
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> ChannelNeutralElemNames = new ArrayList<String>();
ChannelNeutralElemNames.add("Throttle");
ChannelNeutralElemNames.add("Roll");
ChannelNeutralElemNames.add("Pitch");
ChannelNeutralElemNames.add("Yaw");
ChannelNeutralElemNames.add("FlightMode");
ChannelNeutralElemNames.add("Collective");
ChannelNeutralElemNames.add("Accessory0");
ChannelNeutralElemNames.add("Accessory1");
ChannelNeutralElemNames.add("Accessory2");
fields.add( new UAVObjectField("ChannelNeutral", "us", UAVObjectField.FieldType.INT16, ChannelNeutralElemNames, null) );
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> ChannelMaxElemNames = new ArrayList<String>();
ChannelMaxElemNames.add("Throttle");
ChannelMaxElemNames.add("Roll");
ChannelMaxElemNames.add("Pitch");
ChannelMaxElemNames.add("Yaw");
ChannelMaxElemNames.add("FlightMode");
ChannelMaxElemNames.add("Collective");
ChannelMaxElemNames.add("Accessory0");
ChannelMaxElemNames.add("Accessory1");
ChannelMaxElemNames.add("Accessory2");
fields.add( new UAVObjectField("ChannelMax", "us", UAVObjectField.FieldType.INT16, ChannelMaxElemNames, null) );
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> ArmedTimeoutElemNames = new ArrayList<String>();
ArmedTimeoutElemNames.add("0");
fields.add( new UAVObjectField("ArmedTimeout", "ms", UAVObjectField.FieldType.UINT16, ArmedTimeoutElemNames, null) );
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> ChannelGroupsElemNames = new ArrayList<String>();
ChannelGroupsElemNames.add("Throttle");
ChannelGroupsElemNames.add("Roll");
ChannelGroupsElemNames.add("Pitch");
ChannelGroupsElemNames.add("Yaw");
ChannelGroupsElemNames.add("FlightMode");
ChannelGroupsElemNames.add("Collective");
ChannelGroupsElemNames.add("Accessory0");
ChannelGroupsElemNames.add("Accessory1");
ChannelGroupsElemNames.add("Accessory2");
List<String> ChannelGroupsEnumOptions = new ArrayList<String>();
ChannelGroupsEnumOptions.add("PWM");
ChannelGroupsEnumOptions.add("PPM");
ChannelGroupsEnumOptions.add("DSM (MainPort)");
ChannelGroupsEnumOptions.add("DSM (FlexiPort)");
ChannelGroupsEnumOptions.add("S.Bus");
ChannelGroupsEnumOptions.add("GCS");
ChannelGroupsEnumOptions.add("None");
fields.add( new UAVObjectField("ChannelGroups", "Channel Group", UAVObjectField.FieldType.ENUM, ChannelGroupsElemNames, ChannelGroupsEnumOptions) );
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> ChannelNumberElemNames = new ArrayList<String>();
ChannelNumberElemNames.add("Throttle");
ChannelNumberElemNames.add("Roll");
ChannelNumberElemNames.add("Pitch");
ChannelNumberElemNames.add("Yaw");
ChannelNumberElemNames.add("FlightMode");
ChannelNumberElemNames.add("Collective");
ChannelNumberElemNames.add("Accessory0");
ChannelNumberElemNames.add("Accessory1");
ChannelNumberElemNames.add("Accessory2");
fields.add( new UAVObjectField("ChannelNumber", "channel", UAVObjectField.FieldType.UINT8, ChannelNumberElemNames, null) );
List<String> ArmingElemNames = new ArrayList<String>();
ArmingElemNames.add("0");
@ -192,6 +144,8 @@ public class ManualControlSettings extends UAVDataObject {
Stabilization1SettingsEnumOptions.add("None");
Stabilization1SettingsEnumOptions.add("Rate");
Stabilization1SettingsEnumOptions.add("Attitude");
Stabilization1SettingsEnumOptions.add("AxisLock");
Stabilization1SettingsEnumOptions.add("WeakLeveling");
fields.add( new UAVObjectField("Stabilization1Settings", "", UAVObjectField.FieldType.ENUM, Stabilization1SettingsElemNames, Stabilization1SettingsEnumOptions) );
List<String> Stabilization2SettingsElemNames = new ArrayList<String>();
@ -202,6 +156,8 @@ public class ManualControlSettings extends UAVDataObject {
Stabilization2SettingsEnumOptions.add("None");
Stabilization2SettingsEnumOptions.add("Rate");
Stabilization2SettingsEnumOptions.add("Attitude");
Stabilization2SettingsEnumOptions.add("AxisLock");
Stabilization2SettingsEnumOptions.add("WeakLeveling");
fields.add( new UAVObjectField("Stabilization2Settings", "", UAVObjectField.FieldType.ENUM, Stabilization2SettingsElemNames, Stabilization2SettingsEnumOptions) );
List<String> Stabilization3SettingsElemNames = new ArrayList<String>();
@ -212,6 +168,8 @@ public class ManualControlSettings extends UAVDataObject {
Stabilization3SettingsEnumOptions.add("None");
Stabilization3SettingsEnumOptions.add("Rate");
Stabilization3SettingsEnumOptions.add("Attitude");
Stabilization3SettingsEnumOptions.add("AxisLock");
Stabilization3SettingsEnumOptions.add("WeakLeveling");
fields.add( new UAVObjectField("Stabilization3Settings", "", UAVObjectField.FieldType.ENUM, Stabilization3SettingsElemNames, Stabilization3SettingsEnumOptions) );
List<String> FlightModePositionElemNames = new ArrayList<String>();
@ -227,43 +185,6 @@ public class ManualControlSettings extends UAVDataObject {
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;
@ -309,44 +230,6 @@ public class ManualControlSettings extends UAVDataObject {
*/
public void setDefaultFieldValues()
{
getField("InputMode").setValue("PWM");
getField("Roll").setValue("Channel1");
getField("Pitch").setValue("Channel2");
getField("Yaw").setValue("Channel3");
getField("Throttle").setValue("Channel4");
getField("FlightMode").setValue("Channel5");
getField("Accessory1").setValue("None");
getField("Accessory2").setValue("None");
getField("Accessory3").setValue("None");
getField("Arming").setValue("Always Disarmed");
getField("Stabilization1Settings").setValue("Attitude",0);
getField("Stabilization1Settings").setValue("Attitude",1);
getField("Stabilization1Settings").setValue("Attitude",2);
getField("Stabilization2Settings").setValue("Attitude",0);
getField("Stabilization2Settings").setValue("Attitude",1);
getField("Stabilization2Settings").setValue("Attitude",2);
getField("Stabilization3Settings").setValue("Attitude",0);
getField("Stabilization3Settings").setValue("Attitude",1);
getField("Stabilization3Settings").setValue("Attitude",2);
getField("FlightModePosition").setValue("Manual",0);
getField("FlightModePosition").setValue("Manual",1);
getField("FlightModePosition").setValue("Manual",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);
@ -355,7 +238,57 @@ public class ManualControlSettings extends UAVDataObject {
getField("ChannelMin").setValue(1000,5);
getField("ChannelMin").setValue(1000,6);
getField("ChannelMin").setValue(1000,7);
getField("ChannelMin").setValue(1000,8);
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("ChannelNeutral").setValue(1500,8);
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("ChannelMax").setValue(2000,8);
getField("ArmedTimeout").setValue(30000);
getField("ChannelGroups").setValue("None",0);
getField("ChannelGroups").setValue("None",1);
getField("ChannelGroups").setValue("None",2);
getField("ChannelGroups").setValue("None",3);
getField("ChannelGroups").setValue("None",4);
getField("ChannelGroups").setValue("None",5);
getField("ChannelGroups").setValue("None",6);
getField("ChannelGroups").setValue("None",7);
getField("ChannelGroups").setValue("None",8);
getField("ChannelNumber").setValue(0,0);
getField("ChannelNumber").setValue(0,1);
getField("ChannelNumber").setValue(0,2);
getField("ChannelNumber").setValue(0,3);
getField("ChannelNumber").setValue(0,4);
getField("ChannelNumber").setValue(0,5);
getField("ChannelNumber").setValue(0,6);
getField("ChannelNumber").setValue(0,7);
getField("ChannelNumber").setValue(0,8);
getField("Arming").setValue("Always Disarmed");
getField("Stabilization1Settings").setValue("Attitude",0);
getField("Stabilization1Settings").setValue("Attitude",1);
getField("Stabilization1Settings").setValue("Rate",2);
getField("Stabilization2Settings").setValue("Attitude",0);
getField("Stabilization2Settings").setValue("Attitude",1);
getField("Stabilization2Settings").setValue("Rate",2);
getField("Stabilization3Settings").setValue("Attitude",0);
getField("Stabilization3Settings").setValue("Attitude",1);
getField("Stabilization3Settings").setValue("Rate",2);
getField("FlightModePosition").setValue("Manual",0);
getField("FlightModePosition").setValue("Stabilized1",1);
getField("FlightModePosition").setValue("Stabilized2",2);
}
@ -384,7 +317,7 @@ public class ManualControlSettings extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0x2B82102;
protected static final int OBJID = 0x24959BB0;
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;

View File

@ -83,12 +83,37 @@ public class MixerSettings extends UAVDataObject {
ThrottleCurve2ElemNames.add("100");
fields.add( new UAVObjectField("ThrottleCurve2", "percent", UAVObjectField.FieldType.FLOAT32, ThrottleCurve2ElemNames, null) );
List<String> Curve2SourceElemNames = new ArrayList<String>();
Curve2SourceElemNames.add("0");
List<String> Curve2SourceEnumOptions = new ArrayList<String>();
Curve2SourceEnumOptions.add("Throttle");
Curve2SourceEnumOptions.add("Roll");
Curve2SourceEnumOptions.add("Pitch");
Curve2SourceEnumOptions.add("Yaw");
Curve2SourceEnumOptions.add("Collective");
Curve2SourceEnumOptions.add("Accessory0");
Curve2SourceEnumOptions.add("Accessory1");
Curve2SourceEnumOptions.add("Accessory2");
Curve2SourceEnumOptions.add("Accessory3");
Curve2SourceEnumOptions.add("Accessory4");
Curve2SourceEnumOptions.add("Accessory5");
fields.add( new UAVObjectField("Curve2Source", "", UAVObjectField.FieldType.ENUM, Curve2SourceElemNames, Curve2SourceEnumOptions) );
List<String> Mixer1TypeElemNames = new ArrayList<String>();
Mixer1TypeElemNames.add("0");
List<String> Mixer1TypeEnumOptions = new ArrayList<String>();
Mixer1TypeEnumOptions.add("Disabled");
Mixer1TypeEnumOptions.add("Motor");
Mixer1TypeEnumOptions.add("Servo");
Mixer1TypeEnumOptions.add("CameraRoll");
Mixer1TypeEnumOptions.add("CameraPitch");
Mixer1TypeEnumOptions.add("CameraYaw");
Mixer1TypeEnumOptions.add("Accessory0");
Mixer1TypeEnumOptions.add("Accessory1");
Mixer1TypeEnumOptions.add("Accessory2");
Mixer1TypeEnumOptions.add("Accessory3");
Mixer1TypeEnumOptions.add("Accessory4");
Mixer1TypeEnumOptions.add("Accessory5");
fields.add( new UAVObjectField("Mixer1Type", "", UAVObjectField.FieldType.ENUM, Mixer1TypeElemNames, Mixer1TypeEnumOptions) );
List<String> Mixer1VectorElemNames = new ArrayList<String>();
@ -105,6 +130,15 @@ public class MixerSettings extends UAVDataObject {
Mixer2TypeEnumOptions.add("Disabled");
Mixer2TypeEnumOptions.add("Motor");
Mixer2TypeEnumOptions.add("Servo");
Mixer2TypeEnumOptions.add("CameraRoll");
Mixer2TypeEnumOptions.add("CameraPitch");
Mixer2TypeEnumOptions.add("CameraYaw");
Mixer2TypeEnumOptions.add("Accessory0");
Mixer2TypeEnumOptions.add("Accessory1");
Mixer2TypeEnumOptions.add("Accessory2");
Mixer2TypeEnumOptions.add("Accessory3");
Mixer2TypeEnumOptions.add("Accessory4");
Mixer2TypeEnumOptions.add("Accessory5");
fields.add( new UAVObjectField("Mixer2Type", "", UAVObjectField.FieldType.ENUM, Mixer2TypeElemNames, Mixer2TypeEnumOptions) );
List<String> Mixer2VectorElemNames = new ArrayList<String>();
@ -121,6 +155,15 @@ public class MixerSettings extends UAVDataObject {
Mixer3TypeEnumOptions.add("Disabled");
Mixer3TypeEnumOptions.add("Motor");
Mixer3TypeEnumOptions.add("Servo");
Mixer3TypeEnumOptions.add("CameraRoll");
Mixer3TypeEnumOptions.add("CameraPitch");
Mixer3TypeEnumOptions.add("CameraYaw");
Mixer3TypeEnumOptions.add("Accessory0");
Mixer3TypeEnumOptions.add("Accessory1");
Mixer3TypeEnumOptions.add("Accessory2");
Mixer3TypeEnumOptions.add("Accessory3");
Mixer3TypeEnumOptions.add("Accessory4");
Mixer3TypeEnumOptions.add("Accessory5");
fields.add( new UAVObjectField("Mixer3Type", "", UAVObjectField.FieldType.ENUM, Mixer3TypeElemNames, Mixer3TypeEnumOptions) );
List<String> Mixer3VectorElemNames = new ArrayList<String>();
@ -137,6 +180,15 @@ public class MixerSettings extends UAVDataObject {
Mixer4TypeEnumOptions.add("Disabled");
Mixer4TypeEnumOptions.add("Motor");
Mixer4TypeEnumOptions.add("Servo");
Mixer4TypeEnumOptions.add("CameraRoll");
Mixer4TypeEnumOptions.add("CameraPitch");
Mixer4TypeEnumOptions.add("CameraYaw");
Mixer4TypeEnumOptions.add("Accessory0");
Mixer4TypeEnumOptions.add("Accessory1");
Mixer4TypeEnumOptions.add("Accessory2");
Mixer4TypeEnumOptions.add("Accessory3");
Mixer4TypeEnumOptions.add("Accessory4");
Mixer4TypeEnumOptions.add("Accessory5");
fields.add( new UAVObjectField("Mixer4Type", "", UAVObjectField.FieldType.ENUM, Mixer4TypeElemNames, Mixer4TypeEnumOptions) );
List<String> Mixer4VectorElemNames = new ArrayList<String>();
@ -153,6 +205,15 @@ public class MixerSettings extends UAVDataObject {
Mixer5TypeEnumOptions.add("Disabled");
Mixer5TypeEnumOptions.add("Motor");
Mixer5TypeEnumOptions.add("Servo");
Mixer5TypeEnumOptions.add("CameraRoll");
Mixer5TypeEnumOptions.add("CameraPitch");
Mixer5TypeEnumOptions.add("CameraYaw");
Mixer5TypeEnumOptions.add("Accessory0");
Mixer5TypeEnumOptions.add("Accessory1");
Mixer5TypeEnumOptions.add("Accessory2");
Mixer5TypeEnumOptions.add("Accessory3");
Mixer5TypeEnumOptions.add("Accessory4");
Mixer5TypeEnumOptions.add("Accessory5");
fields.add( new UAVObjectField("Mixer5Type", "", UAVObjectField.FieldType.ENUM, Mixer5TypeElemNames, Mixer5TypeEnumOptions) );
List<String> Mixer5VectorElemNames = new ArrayList<String>();
@ -169,6 +230,15 @@ public class MixerSettings extends UAVDataObject {
Mixer6TypeEnumOptions.add("Disabled");
Mixer6TypeEnumOptions.add("Motor");
Mixer6TypeEnumOptions.add("Servo");
Mixer6TypeEnumOptions.add("CameraRoll");
Mixer6TypeEnumOptions.add("CameraPitch");
Mixer6TypeEnumOptions.add("CameraYaw");
Mixer6TypeEnumOptions.add("Accessory0");
Mixer6TypeEnumOptions.add("Accessory1");
Mixer6TypeEnumOptions.add("Accessory2");
Mixer6TypeEnumOptions.add("Accessory3");
Mixer6TypeEnumOptions.add("Accessory4");
Mixer6TypeEnumOptions.add("Accessory5");
fields.add( new UAVObjectField("Mixer6Type", "", UAVObjectField.FieldType.ENUM, Mixer6TypeElemNames, Mixer6TypeEnumOptions) );
List<String> Mixer6VectorElemNames = new ArrayList<String>();
@ -185,6 +255,15 @@ public class MixerSettings extends UAVDataObject {
Mixer7TypeEnumOptions.add("Disabled");
Mixer7TypeEnumOptions.add("Motor");
Mixer7TypeEnumOptions.add("Servo");
Mixer7TypeEnumOptions.add("CameraRoll");
Mixer7TypeEnumOptions.add("CameraPitch");
Mixer7TypeEnumOptions.add("CameraYaw");
Mixer7TypeEnumOptions.add("Accessory0");
Mixer7TypeEnumOptions.add("Accessory1");
Mixer7TypeEnumOptions.add("Accessory2");
Mixer7TypeEnumOptions.add("Accessory3");
Mixer7TypeEnumOptions.add("Accessory4");
Mixer7TypeEnumOptions.add("Accessory5");
fields.add( new UAVObjectField("Mixer7Type", "", UAVObjectField.FieldType.ENUM, Mixer7TypeElemNames, Mixer7TypeEnumOptions) );
List<String> Mixer7VectorElemNames = new ArrayList<String>();
@ -201,6 +280,15 @@ public class MixerSettings extends UAVDataObject {
Mixer8TypeEnumOptions.add("Disabled");
Mixer8TypeEnumOptions.add("Motor");
Mixer8TypeEnumOptions.add("Servo");
Mixer8TypeEnumOptions.add("CameraRoll");
Mixer8TypeEnumOptions.add("CameraPitch");
Mixer8TypeEnumOptions.add("CameraYaw");
Mixer8TypeEnumOptions.add("Accessory0");
Mixer8TypeEnumOptions.add("Accessory1");
Mixer8TypeEnumOptions.add("Accessory2");
Mixer8TypeEnumOptions.add("Accessory3");
Mixer8TypeEnumOptions.add("Accessory4");
Mixer8TypeEnumOptions.add("Accessory5");
fields.add( new UAVObjectField("Mixer8Type", "", UAVObjectField.FieldType.ENUM, Mixer8TypeElemNames, Mixer8TypeEnumOptions) );
List<String> Mixer8VectorElemNames = new ArrayList<String>();
@ -211,6 +299,56 @@ public class MixerSettings extends UAVDataObject {
Mixer8VectorElemNames.add("Yaw");
fields.add( new UAVObjectField("Mixer8Vector", "", UAVObjectField.FieldType.INT8, Mixer8VectorElemNames, null) );
List<String> Mixer9TypeElemNames = new ArrayList<String>();
Mixer9TypeElemNames.add("0");
List<String> Mixer9TypeEnumOptions = new ArrayList<String>();
Mixer9TypeEnumOptions.add("Disabled");
Mixer9TypeEnumOptions.add("Motor");
Mixer9TypeEnumOptions.add("Servo");
Mixer9TypeEnumOptions.add("CameraRoll");
Mixer9TypeEnumOptions.add("CameraPitch");
Mixer9TypeEnumOptions.add("CameraYaw");
Mixer9TypeEnumOptions.add("Accessory0");
Mixer9TypeEnumOptions.add("Accessory1");
Mixer9TypeEnumOptions.add("Accessory2");
Mixer9TypeEnumOptions.add("Accessory3");
Mixer9TypeEnumOptions.add("Accessory4");
Mixer9TypeEnumOptions.add("Accessory5");
fields.add( new UAVObjectField("Mixer9Type", "", UAVObjectField.FieldType.ENUM, Mixer9TypeElemNames, Mixer9TypeEnumOptions) );
List<String> Mixer9VectorElemNames = new ArrayList<String>();
Mixer9VectorElemNames.add("ThrottleCurve1");
Mixer9VectorElemNames.add("ThrottleCurve2");
Mixer9VectorElemNames.add("Roll");
Mixer9VectorElemNames.add("Pitch");
Mixer9VectorElemNames.add("Yaw");
fields.add( new UAVObjectField("Mixer9Vector", "", UAVObjectField.FieldType.INT8, Mixer9VectorElemNames, null) );
List<String> Mixer10TypeElemNames = new ArrayList<String>();
Mixer10TypeElemNames.add("0");
List<String> Mixer10TypeEnumOptions = new ArrayList<String>();
Mixer10TypeEnumOptions.add("Disabled");
Mixer10TypeEnumOptions.add("Motor");
Mixer10TypeEnumOptions.add("Servo");
Mixer10TypeEnumOptions.add("CameraRoll");
Mixer10TypeEnumOptions.add("CameraPitch");
Mixer10TypeEnumOptions.add("CameraYaw");
Mixer10TypeEnumOptions.add("Accessory0");
Mixer10TypeEnumOptions.add("Accessory1");
Mixer10TypeEnumOptions.add("Accessory2");
Mixer10TypeEnumOptions.add("Accessory3");
Mixer10TypeEnumOptions.add("Accessory4");
Mixer10TypeEnumOptions.add("Accessory5");
fields.add( new UAVObjectField("Mixer10Type", "", UAVObjectField.FieldType.ENUM, Mixer10TypeElemNames, Mixer10TypeEnumOptions) );
List<String> Mixer10VectorElemNames = new ArrayList<String>();
Mixer10VectorElemNames.add("ThrottleCurve1");
Mixer10VectorElemNames.add("ThrottleCurve2");
Mixer10VectorElemNames.add("Roll");
Mixer10VectorElemNames.add("Pitch");
Mixer10VectorElemNames.add("Yaw");
fields.add( new UAVObjectField("Mixer10Vector", "", UAVObjectField.FieldType.INT8, Mixer10VectorElemNames, null) );
// Compute the number of bytes for this object
int numBytes = 0;
@ -261,15 +399,16 @@ public class MixerSettings extends UAVDataObject {
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("ThrottleCurve1").setValue(0,1);
getField("ThrottleCurve1").setValue(0,2);
getField("ThrottleCurve1").setValue(0,3);
getField("ThrottleCurve1").setValue(0,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("Curve2Source").setValue("Throttle");
getField("Mixer1Type").setValue("Disabled");
getField("Mixer1Vector").setValue(0,0);
getField("Mixer1Vector").setValue(0,1);
@ -318,6 +457,18 @@ public class MixerSettings extends UAVDataObject {
getField("Mixer8Vector").setValue(0,2);
getField("Mixer8Vector").setValue(0,3);
getField("Mixer8Vector").setValue(0,4);
getField("Mixer9Type").setValue("Disabled");
getField("Mixer9Vector").setValue(0,0);
getField("Mixer9Vector").setValue(0,1);
getField("Mixer9Vector").setValue(0,2);
getField("Mixer9Vector").setValue(0,3);
getField("Mixer9Vector").setValue(0,4);
getField("Mixer10Type").setValue("Disabled");
getField("Mixer10Vector").setValue(0,0);
getField("Mixer10Vector").setValue(0,1);
getField("Mixer10Vector").setValue(0,2);
getField("Mixer10Vector").setValue(0,3);
getField("Mixer10Vector").setValue(0,4);
}
@ -346,7 +497,7 @@ public class MixerSettings extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0x4FAE374E;
protected static final int OBJID = 0x5D16D6C4;
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;

View File

@ -156,7 +156,7 @@ public class MixerStatus extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0xF6A33F10;
protected static final int OBJID = 0x11CFB4E6;
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;

View File

@ -136,7 +136,7 @@ public class NedAccel extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0x8E852CE8;
protected static final int OBJID = 0x7C7F5BC0;
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;

View File

@ -51,12 +51,23 @@ public class ObjectPersistence extends UAVDataObject {
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
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) );
List<String> OperationElemNames = new ArrayList<String>();
OperationElemNames.add("0");
List<String> OperationEnumOptions = new ArrayList<String>();
OperationEnumOptions.add("NOP");
OperationEnumOptions.add("Load");
OperationEnumOptions.add("Save");
OperationEnumOptions.add("Delete");
OperationEnumOptions.add("FullErase");
OperationEnumOptions.add("Completed");
fields.add( new UAVObjectField("Operation", "", UAVObjectField.FieldType.ENUM, OperationElemNames, OperationEnumOptions) );
List<String> SelectionElemNames = new ArrayList<String>();
@ -68,14 +79,6 @@ public class ObjectPersistence extends UAVDataObject {
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;
@ -106,7 +109,7 @@ public class ObjectPersistence extends UAVDataObject {
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.TRUE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_NEVER;
@ -149,7 +152,7 @@ public class ObjectPersistence extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0x22216832;
protected static final int OBJID = 0xF69AD8B8;
protected static final String NAME = "ObjectPersistence";
protected static String DESCRIPTION = "Someone who knows please enter this";
protected static final boolean ISSINGLEINST = 1 == 1;

View File

@ -136,7 +136,7 @@ public class PositionActual extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0xE0739636;
protected static final int OBJID = 0xF9691DA4;
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;

View File

@ -136,7 +136,7 @@ public class PositionDesired extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0x2FC4E5BA;
protected static final int OBJID = 0x33C9EAB4;
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;

View File

@ -136,7 +136,7 @@ public class RateDesired extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0xBA41B51C;
protected static final int OBJID = 0xCE8C826;
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;

View File

@ -5,7 +5,7 @@
* @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.
* Monitors which receiver channels have been active within the last second.
*
* @see The GNU Public License (GPL) Version 3
*
@ -39,40 +39,33 @@ import org.openpilot.uavtalk.UAVDataObject;
import org.openpilot.uavtalk.UAVObjectField;
/**
Battery configuration information.
Monitors which receiver channels have been active within the last second.
generated from batterysettings.xml
generated from receiveractivity.xml
**/
public class BatterySettings extends UAVDataObject {
public class ReceiverActivity extends UAVDataObject {
public BatterySettings() {
public ReceiverActivity() {
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> ActiveGroupElemNames = new ArrayList<String>();
ActiveGroupElemNames.add("0");
List<String> ActiveGroupEnumOptions = new ArrayList<String>();
ActiveGroupEnumOptions.add("PWM");
ActiveGroupEnumOptions.add("PPM");
ActiveGroupEnumOptions.add("DSM (MainPort)");
ActiveGroupEnumOptions.add("DSM (FlexiPort)");
ActiveGroupEnumOptions.add("S.Bus");
ActiveGroupEnumOptions.add("GCS");
ActiveGroupEnumOptions.add("None");
fields.add( new UAVObjectField("ActiveGroup", "Channel Group", UAVObjectField.FieldType.ENUM, ActiveGroupElemNames, ActiveGroupEnumOptions) );
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) );
List<String> ActiveChannelElemNames = new ArrayList<String>();
ActiveChannelElemNames.add("0");
fields.add( new UAVObjectField("ActiveChannel", "channel", UAVObjectField.FieldType.UINT8, ActiveChannelElemNames, null) );
// Compute the number of bytes for this object
@ -97,13 +90,13 @@ public class BatterySettings extends UAVDataObject {
*/
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.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.TRUE;
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
metadata.flightTelemetryUpdatePeriod = 0;
@ -119,11 +112,8 @@ public class BatterySettings extends UAVDataObject {
*/
public void setDefaultFieldValues()
{
getField("BatteryVoltage").setValue(11.1);
getField("BatteryCapacity").setValue(2200);
getField("BatteryType").setValue("LiPo");
getField("Calibrations").setValue(1,0);
getField("Calibrations").setValue(1,1);
getField("ActiveGroup").setValue("None");
getField("ActiveChannel").setValue(255);
}
@ -135,7 +125,7 @@ public class BatterySettings extends UAVDataObject {
public UAVDataObject clone(int instID) {
// TODO: Need to get specific instance to clone
try {
BatterySettings obj = new BatterySettings();
ReceiverActivity obj = new ReceiverActivity();
obj.initialize(instID, this.getMetaObject());
return obj;
} catch (Exception e) {
@ -146,17 +136,17 @@ public class BatterySettings extends UAVDataObject {
/**
* Static function to retrieve an instance of the object.
*/
public BatterySettings GetInstance(UAVObjectManager objMngr, int instID)
public ReceiverActivity GetInstance(UAVObjectManager objMngr, int instID)
{
return (BatterySettings)(objMngr.getObject(BatterySettings.OBJID, instID));
return (ReceiverActivity)(objMngr.getObject(ReceiverActivity.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 int OBJID = 0x1E7C53DA;
protected static final String NAME = "ReceiverActivity";
protected static String DESCRIPTION = "Monitors which receiver channels have been active within the last second.";
protected static final boolean ISSINGLEINST = 1 == 1;
protected static final boolean ISSETTINGS = 1 == 1;
protected static final boolean ISSETTINGS = 0 == 1;
protected static int NUMBYTES = 0;

View File

@ -128,7 +128,7 @@ public class SonarAltitude extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0x1FDD844C;
protected static final int OBJID = 0x6C5A0CBC;
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;

View File

@ -75,6 +75,8 @@ public class StabilizationDesired extends UAVDataObject {
StabilizationModeEnumOptions.add("None");
StabilizationModeEnumOptions.add("Rate");
StabilizationModeEnumOptions.add("Attitude");
StabilizationModeEnumOptions.add("AxisLock");
StabilizationModeEnumOptions.add("WeakLeveling");
fields.add( new UAVObjectField("StabilizationMode", "", UAVObjectField.FieldType.ENUM, StabilizationModeElemNames, StabilizationModeEnumOptions) );
@ -150,7 +152,7 @@ public class StabilizationDesired extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0x41AA9DC2;
protected static final int OBJID = 0xDB8FFC3C;
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;

View File

@ -51,18 +51,6 @@ public class StabilizationSettings extends UAVDataObject {
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");
@ -75,23 +63,26 @@ public class StabilizationSettings extends UAVDataObject {
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> RollRatePIDElemNames = new ArrayList<String>();
RollRatePIDElemNames.add("Kp");
RollRatePIDElemNames.add("Ki");
RollRatePIDElemNames.add("Kd");
RollRatePIDElemNames.add("ILimit");
fields.add( new UAVObjectField("RollRatePID", "", UAVObjectField.FieldType.FLOAT32, RollRatePIDElemNames, 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> PitchRatePIDElemNames = new ArrayList<String>();
PitchRatePIDElemNames.add("Kp");
PitchRatePIDElemNames.add("Ki");
PitchRatePIDElemNames.add("Kd");
PitchRatePIDElemNames.add("ILimit");
fields.add( new UAVObjectField("PitchRatePID", "", UAVObjectField.FieldType.FLOAT32, PitchRatePIDElemNames, 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> YawRatePIDElemNames = new ArrayList<String>();
YawRatePIDElemNames.add("Kp");
YawRatePIDElemNames.add("Ki");
YawRatePIDElemNames.add("Kd");
YawRatePIDElemNames.add("ILimit");
fields.add( new UAVObjectField("YawRatePID", "", UAVObjectField.FieldType.FLOAT32, YawRatePIDElemNames, null) );
List<String> RollPIElemNames = new ArrayList<String>();
RollPIElemNames.add("Kp");
@ -111,6 +102,45 @@ public class StabilizationSettings extends UAVDataObject {
YawPIElemNames.add("ILimit");
fields.add( new UAVObjectField("YawPI", "", UAVObjectField.FieldType.FLOAT32, YawPIElemNames, null) );
List<String> GyroTauElemNames = new ArrayList<String>();
GyroTauElemNames.add("0");
fields.add( new UAVObjectField("GyroTau", "", UAVObjectField.FieldType.FLOAT32, GyroTauElemNames, null) );
List<String> WeakLevelingKpElemNames = new ArrayList<String>();
WeakLevelingKpElemNames.add("0");
fields.add( new UAVObjectField("WeakLevelingKp", "(deg/s)/deg", UAVObjectField.FieldType.FLOAT32, WeakLevelingKpElemNames, null) );
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> MaxAxisLockElemNames = new ArrayList<String>();
MaxAxisLockElemNames.add("0");
fields.add( new UAVObjectField("MaxAxisLock", "deg", UAVObjectField.FieldType.UINT8, MaxAxisLockElemNames, null) );
List<String> MaxAxisLockRateElemNames = new ArrayList<String>();
MaxAxisLockRateElemNames.add("0");
fields.add( new UAVObjectField("MaxAxisLockRate", "deg/s", UAVObjectField.FieldType.UINT8, MaxAxisLockRateElemNames, null) );
List<String> MaxWeakLevelingRateElemNames = new ArrayList<String>();
MaxWeakLevelingRateElemNames.add("0");
fields.add( new UAVObjectField("MaxWeakLevelingRate", "deg/s", UAVObjectField.FieldType.UINT8, MaxWeakLevelingRateElemNames, null) );
List<String> LowThrottleZeroIntegralElemNames = new ArrayList<String>();
LowThrottleZeroIntegralElemNames.add("0");
List<String> LowThrottleZeroIntegralEnumOptions = new ArrayList<String>();
LowThrottleZeroIntegralEnumOptions.add("FALSE");
LowThrottleZeroIntegralEnumOptions.add("TRUE");
fields.add( new UAVObjectField("LowThrottleZeroIntegral", "", UAVObjectField.FieldType.ENUM, LowThrottleZeroIntegralElemNames, LowThrottleZeroIntegralEnumOptions) );
// Compute the number of bytes for this object
int numBytes = 0;
@ -156,24 +186,24 @@ public class StabilizationSettings extends UAVDataObject {
*/
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("RollRatePID").setValue(0.002,0);
getField("RollRatePID").setValue(0,1);
getField("RollRatePID").setValue(0,2);
getField("RollRatePID").setValue(0.3,3);
getField("PitchRatePID").setValue(0.002,0);
getField("PitchRatePID").setValue(0,1);
getField("PitchRatePID").setValue(0,2);
getField("PitchRatePID").setValue(0.3,3);
getField("YawRatePID").setValue(0.0035,0);
getField("YawRatePID").setValue(0.0035,1);
getField("YawRatePID").setValue(0,2);
getField("YawRatePID").setValue(0.3,3);
getField("RollPI").setValue(2,0);
getField("RollPI").setValue(0,1);
getField("RollPI").setValue(50,2);
@ -183,6 +213,15 @@ public class StabilizationSettings extends UAVDataObject {
getField("YawPI").setValue(2,0);
getField("YawPI").setValue(0,1);
getField("YawPI").setValue(50,2);
getField("GyroTau").setValue(0.005);
getField("WeakLevelingKp").setValue(0.1);
getField("RollMax").setValue(55);
getField("PitchMax").setValue(55);
getField("YawMax").setValue(35);
getField("MaxAxisLock").setValue(15);
getField("MaxAxisLockRate").setValue(2);
getField("MaxWeakLevelingRate").setValue(5);
getField("LowThrottleZeroIntegral").setValue("TRUE");
}
@ -211,7 +250,7 @@ public class StabilizationSettings extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0xE2147404;
protected static final int OBJID = 0x5F78C51E;
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;

View File

@ -68,6 +68,7 @@ public class SystemAlarms extends UAVDataObject {
AlarmElemNames.add("FlightTime");
AlarmElemNames.add("I2C");
AlarmElemNames.add("GPS");
AlarmElemNames.add("BootFault");
List<String> AlarmEnumOptions = new ArrayList<String>();
AlarmEnumOptions.add("Uninitialised");
AlarmEnumOptions.add("OK");
@ -106,8 +107,8 @@ public class SystemAlarms extends UAVDataObject {
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.TRUE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.flightTelemetryUpdatePeriod = 4000;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.loggingUpdatePeriod = 1000;
@ -137,6 +138,7 @@ public class SystemAlarms extends UAVDataObject {
getField("Alarm").setValue("Uninitialised",13);
getField("Alarm").setValue("Uninitialised",14);
getField("Alarm").setValue("Uninitialised",15);
getField("Alarm").setValue("Uninitialised",16);
}
@ -165,7 +167,7 @@ public class SystemAlarms extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0x89C3DCB2;
protected static final int OBJID = 0x737ADCF2;
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;

View File

@ -51,6 +51,11 @@ public class SystemSettings extends UAVDataObject {
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> GUIConfigDataElemNames = new ArrayList<String>();
GUIConfigDataElemNames.add("0");
GUIConfigDataElemNames.add("1");
fields.add( new UAVObjectField("GUIConfigData", "bits", UAVObjectField.FieldType.UINT32, GUIConfigDataElemNames, null) );
List<String> AirframeTypeElemNames = new ArrayList<String>();
AirframeTypeElemNames.add("0");
List<String> AirframeTypeEnumOptions = new ArrayList<String>();
@ -117,6 +122,8 @@ public class SystemSettings extends UAVDataObject {
*/
public void setDefaultFieldValues()
{
getField("GUIConfigData").setValue(0,0);
getField("GUIConfigData").setValue(0,1);
getField("AirframeType").setValue("FixedWing");
}
@ -146,7 +153,7 @@ public class SystemSettings extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0x3875CEE;
protected static final int OBJID = 0x30BD5D7C;
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;

View File

@ -59,6 +59,10 @@ public class SystemStats extends UAVDataObject {
HeapRemainingElemNames.add("0");
fields.add( new UAVObjectField("HeapRemaining", "bytes", UAVObjectField.FieldType.UINT16, HeapRemainingElemNames, null) );
List<String> IRQStackRemainingElemNames = new ArrayList<String>();
IRQStackRemainingElemNames.add("0");
fields.add( new UAVObjectField("IRQStackRemaining", "bytes", UAVObjectField.FieldType.UINT16, IRQStackRemainingElemNames, null) );
List<String> CPULoadElemNames = new ArrayList<String>();
CPULoadElemNames.add("0");
fields.add( new UAVObjectField("CPULoad", "%", UAVObjectField.FieldType.UINT8, CPULoadElemNames, null) );
@ -140,7 +144,7 @@ public class SystemStats extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0xAA26FFFA;
protected static final int OBJID = 0xD610A0F0;
protected static final String NAME = "SystemStats";
protected static String DESCRIPTION = "CPU and memory usage from OpenPilot computer. ";
protected static final boolean ISSINGLEINST = 1 == 1;

View File

@ -65,6 +65,8 @@ public class TaskInfo extends UAVDataObject {
StackRemainingElemNames.add("Stabilization");
StackRemainingElemNames.add("Guidance");
StackRemainingElemNames.add("FlightPlan");
StackRemainingElemNames.add("Com2UsbBridge");
StackRemainingElemNames.add("Usb2ComBridge");
fields.add( new UAVObjectField("StackRemaining", "bytes", UAVObjectField.FieldType.UINT16, StackRemainingElemNames, null) );
List<String> RunningElemNames = new ArrayList<String>();
@ -81,11 +83,31 @@ public class TaskInfo extends UAVDataObject {
RunningElemNames.add("Stabilization");
RunningElemNames.add("Guidance");
RunningElemNames.add("FlightPlan");
RunningElemNames.add("Com2UsbBridge");
RunningElemNames.add("Usb2ComBridge");
List<String> RunningEnumOptions = new ArrayList<String>();
RunningEnumOptions.add("False");
RunningEnumOptions.add("True");
fields.add( new UAVObjectField("Running", "bool", UAVObjectField.FieldType.ENUM, RunningElemNames, RunningEnumOptions) );
List<String> RunningTimeElemNames = new ArrayList<String>();
RunningTimeElemNames.add("System");
RunningTimeElemNames.add("Actuator");
RunningTimeElemNames.add("Attitude");
RunningTimeElemNames.add("TelemetryTx");
RunningTimeElemNames.add("TelemetryTxPri");
RunningTimeElemNames.add("TelemetryRx");
RunningTimeElemNames.add("GPS");
RunningTimeElemNames.add("ManualControl");
RunningTimeElemNames.add("Altitude");
RunningTimeElemNames.add("AHRSComms");
RunningTimeElemNames.add("Stabilization");
RunningTimeElemNames.add("Guidance");
RunningTimeElemNames.add("FlightPlan");
RunningTimeElemNames.add("Com2UsbBridge");
RunningTimeElemNames.add("Usb2ComBridge");
fields.add( new UAVObjectField("RunningTime", "%", UAVObjectField.FieldType.UINT8, RunningTimeElemNames, null) );
// Compute the number of bytes for this object
int numBytes = 0;
@ -159,7 +181,7 @@ public class TaskInfo extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0x50F599F0;
protected static final int OBJID = 0xE34A7C32;
protected static final String NAME = "TaskInfo";
protected static String DESCRIPTION = "Task information";
protected static final boolean ISSINGLEINST = 1 == 1;

View File

@ -28,13 +28,14 @@
package org.openpilot.uavtalk.uavobjects;
//import 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 AccessoryDesired() );
objMngr.registerObject( new ActuatorCommand() );
objMngr.registerObject( new ActuatorDesired() );
objMngr.registerObject( new ActuatorSettings() );
@ -45,19 +46,25 @@ public class UAVObjectsInitialize {
objMngr.registerObject( new AttitudeRaw() );
objMngr.registerObject( new AttitudeSettings() );
objMngr.registerObject( new BaroAltitude() );
objMngr.registerObject( new BatterySettings() );
objMngr.registerObject( new CameraDesired() );
objMngr.registerObject( new CameraStabSettings() );
objMngr.registerObject( new FaultSettings() );
objMngr.registerObject( new FirmwareIAPObj() );
objMngr.registerObject( new FlightBatterySettings() );
objMngr.registerObject( new FlightBatteryState() );
objMngr.registerObject( new FlightPlanControl() );
objMngr.registerObject( new FlightPlanSettings() );
objMngr.registerObject( new FlightPlanStatus() );
objMngr.registerObject( new FlightStatus() );
objMngr.registerObject( new FlightTelemetryStats() );
objMngr.registerObject( new GCSReceiver() );
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 HwSettings() );
objMngr.registerObject( new I2CStats() );
objMngr.registerObject( new ManualControlCommand() );
objMngr.registerObject( new ManualControlSettings() );
@ -68,6 +75,7 @@ public class UAVObjectsInitialize {
objMngr.registerObject( new PositionActual() );
objMngr.registerObject( new PositionDesired() );
objMngr.registerObject( new RateDesired() );
objMngr.registerObject( new ReceiverActivity() );
objMngr.registerObject( new SonarAltitude() );
objMngr.registerObject( new StabilizationDesired() );
objMngr.registerObject( new StabilizationSettings() );
@ -75,7 +83,6 @@ public class UAVObjectsInitialize {
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() );

View File

@ -136,7 +136,7 @@ public class VelocityActual extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0x48009C88;
protected static final int OBJID = 0x43007EB0;
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;

View File

@ -136,7 +136,7 @@ public class VelocityDesired extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0x122F5E3A;
protected static final int OBJID = 0x25139D1A;
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;

View File

@ -132,7 +132,7 @@ public class WatchdogStatus extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0xD646E910;
protected static final int OBJID = 0xA207FA7C;
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;

View File

@ -258,7 +258,7 @@ bool UAVObjectGeneratorJava::process_object(ObjectInfo* info)
outCode.replace(QString("$(INITFIELDS)"), initfields);
// Write the java code
bool res = writeFileIfDiffrent( javaOutputPath.absolutePath() + "/" + info->namelc + ".java", outCode );
bool res = writeFileIfDiffrent( javaOutputPath.absolutePath() + "/" + info->name + ".java", outCode );
if (!res) {
cout << "Error: Could not write gcs output files" << endl;
return false;