From 739dc0f9841c8afb737d892e025956ecd7cfb3de Mon Sep 17 00:00:00 2001 From: James Cotton Date: Sat, 4 Feb 2012 18:30:04 -0600 Subject: [PATCH] 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 --- .../uavtalk/uavobjects/AHRSCalibration.java | 51 +- .../uavtalk/uavobjects/AHRSSettings.java | 32 +- .../uavtalk/uavobjects/AccessoryDesired.java | 139 +++++ .../uavtalk/uavobjects/ActuatorCommand.java | 12 +- .../uavtalk/uavobjects/ActuatorDesired.java | 2 +- .../uavtalk/uavobjects/ActuatorSettings.java | 496 ++++++++++-------- .../uavtalk/uavobjects/AhrsStatus.java | 10 +- .../uavtalk/uavobjects/AttitudeActual.java | 4 +- .../uavtalk/uavobjects/AttitudeRaw.java | 24 +- .../uavtalk/uavobjects/AttitudeSettings.java | 68 ++- .../uavtalk/uavobjects/BaroAltitude.java | 2 +- .../uavtalk/uavobjects/CameraDesired.java | 147 ++++++ .../uavobjects/CameraStabSettings.java | 205 ++++++++ ...emetrySettings.java => FaultSettings.java} | 45 +- .../uavtalk/uavobjects/FirmwareIAPObj.java | 97 +--- .../uavobjects/FlightBatterySettings.java | 177 +++++++ .../uavobjects/FlightBatteryState.java | 2 +- .../uavtalk/uavobjects/FlightPlanControl.java | 2 +- .../uavobjects/FlightPlanSettings.java | 2 +- .../uavtalk/uavobjects/FlightPlanStatus.java | 35 +- .../uavtalk/uavobjects/FlightStatus.java | 155 ++++++ .../uavobjects/FlightTelemetryStats.java | 20 +- .../uavtalk/uavobjects/GCSReceiver.java | 144 +++++ .../uavtalk/uavobjects/GCSTelemetryStats.java | 20 +- .../uavtalk/uavobjects/GPSPosition.java | 28 +- .../uavtalk/uavobjects/GPSSatellites.java | 48 +- .../openpilot/uavtalk/uavobjects/GPSTime.java | 10 +- .../uavtalk/uavobjects/GuidanceSettings.java | 76 +-- .../uavtalk/uavobjects/HomeLocation.java | 23 +- .../uavtalk/uavobjects/HwSettings.java | 291 ++++++++++ .../uavtalk/uavobjects/I2CStats.java | 34 +- .../uavobjects/ManualControlCommand.java | 55 +- .../uavobjects/ManualControlSettings.java | 313 +++++------ .../uavtalk/uavobjects/MixerSettings.java | 161 +++++- .../uavtalk/uavobjects/MixerStatus.java | 2 +- .../uavtalk/uavobjects/NedAccel.java | 2 +- .../uavtalk/uavobjects/ObjectPersistence.java | 23 +- .../uavtalk/uavobjects/PositionActual.java | 2 +- .../uavtalk/uavobjects/PositionDesired.java | 2 +- .../uavtalk/uavobjects/RateDesired.java | 2 +- ...erySettings.java => ReceiverActivity.java} | 74 ++- .../uavtalk/uavobjects/SonarAltitude.java | 2 +- .../uavobjects/StabilizationDesired.java | 4 +- .../uavobjects/StabilizationSettings.java | 119 +++-- .../uavtalk/uavobjects/SystemAlarms.java | 8 +- .../uavtalk/uavobjects/SystemSettings.java | 9 +- .../uavtalk/uavobjects/SystemStats.java | 6 +- .../uavtalk/uavobjects/TaskInfo.java | 24 +- .../uavobjects/UAVObjectsInitialize.java | 13 +- .../uavtalk/uavobjects/VelocityActual.java | 2 +- .../uavtalk/uavobjects/VelocityDesired.java | 2 +- .../uavtalk/uavobjects/WatchdogStatus.java | 2 +- .../java/uavobjectgeneratorjava.cpp | 2 +- 53 files changed, 2363 insertions(+), 867 deletions(-) create mode 100644 androidgcs/src/org/openpilot/uavtalk/uavobjects/AccessoryDesired.java create mode 100644 androidgcs/src/org/openpilot/uavtalk/uavobjects/CameraDesired.java create mode 100644 androidgcs/src/org/openpilot/uavtalk/uavobjects/CameraStabSettings.java rename androidgcs/src/org/openpilot/uavtalk/uavobjects/{TelemetrySettings.java => FaultSettings.java} (74%) create mode 100644 androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightBatterySettings.java create mode 100644 androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightStatus.java create mode 100644 androidgcs/src/org/openpilot/uavtalk/uavobjects/GCSReceiver.java create mode 100644 androidgcs/src/org/openpilot/uavtalk/uavobjects/HwSettings.java rename androidgcs/src/org/openpilot/uavtalk/uavobjects/{BatterySettings.java => ReceiverActivity.java} (61%) diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/AHRSCalibration.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/AHRSCalibration.java index 922582398..47d42991e 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/AHRSCalibration.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/AHRSCalibration.java @@ -51,30 +51,29 @@ public class AHRSCalibration extends UAVDataObject { List fields = new ArrayList(); - List measure_varElemNames = new ArrayList(); - measure_varElemNames.add("0"); - List measure_varEnumOptions = new ArrayList(); - measure_varEnumOptions.add("SET"); - measure_varEnumOptions.add("MEASURE"); - fields.add( new UAVObjectField("measure_var", "", UAVObjectField.FieldType.ENUM, measure_varElemNames, measure_varEnumOptions) ); - List accel_biasElemNames = new ArrayList(); 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 accel_scaleElemNames = new ArrayList(); 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 accel_orthoElemNames = new ArrayList(); + 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 accel_varElemNames = new ArrayList(); 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 gyro_biasElemNames = new ArrayList(); 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 measure_varElemNames = new ArrayList(); + measure_varElemNames.add("0"); + List measure_varEnumOptions = new ArrayList(); + 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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/AHRSSettings.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/AHRSSettings.java index c49c04778..032dae775 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/AHRSSettings.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/AHRSSettings.java @@ -51,6 +51,18 @@ public class AHRSSettings extends UAVDataObject { List fields = new ArrayList(); + List YawBiasElemNames = new ArrayList(); + YawBiasElemNames.add("0"); + fields.add( new UAVObjectField("YawBias", "", UAVObjectField.FieldType.FLOAT32, YawBiasElemNames, null) ); + + List PitchBiasElemNames = new ArrayList(); + PitchBiasElemNames.add("0"); + fields.add( new UAVObjectField("PitchBias", "", UAVObjectField.FieldType.FLOAT32, PitchBiasElemNames, null) ); + + List RollBiasElemNames = new ArrayList(); + RollBiasElemNames.add("0"); + fields.add( new UAVObjectField("RollBias", "", UAVObjectField.FieldType.FLOAT32, RollBiasElemNames, null) ); + List AlgorithmElemNames = new ArrayList(); AlgorithmElemNames.add("0"); List AlgorithmEnumOptions = new ArrayList(); @@ -75,18 +87,6 @@ public class AHRSSettings extends UAVDataObject { BiasCorrectedRawEnumOptions.add("FALSE"); fields.add( new UAVObjectField("BiasCorrectedRaw", "", UAVObjectField.FieldType.ENUM, BiasCorrectedRawElemNames, BiasCorrectedRawEnumOptions) ); - List YawBiasElemNames = new ArrayList(); - YawBiasElemNames.add("0"); - fields.add( new UAVObjectField("YawBias", "", UAVObjectField.FieldType.FLOAT32, YawBiasElemNames, null) ); - - List PitchBiasElemNames = new ArrayList(); - PitchBiasElemNames.add("0"); - fields.add( new UAVObjectField("PitchBias", "", UAVObjectField.FieldType.FLOAT32, PitchBiasElemNames, null) ); - - List RollBiasElemNames = new ArrayList(); - 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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/AccessoryDesired.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/AccessoryDesired.java new file mode 100644 index 000000000..13c63dfdd --- /dev/null +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/AccessoryDesired.java @@ -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 fields = new ArrayList(); + + + List AccessoryValElemNames = new ArrayList(); + 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 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; + + +} \ No newline at end of file diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/ActuatorCommand.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/ActuatorCommand.java index a5d6230ac..08f2ebefe 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/ActuatorCommand.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/ActuatorCommand.java @@ -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 UpdateTimeElemNames = new ArrayList(); - UpdateTimeElemNames.add("0"); - fields.add( new UAVObjectField("UpdateTime", "ms", UAVObjectField.FieldType.UINT8, UpdateTimeElemNames, null) ); - List MaxUpdateTimeElemNames = new ArrayList(); MaxUpdateTimeElemNames.add("0"); fields.add( new UAVObjectField("MaxUpdateTime", "ms", UAVObjectField.FieldType.UINT16, MaxUpdateTimeElemNames, null) ); + List UpdateTimeElemNames = new ArrayList(); + UpdateTimeElemNames.add("0"); + fields.add( new UAVObjectField("UpdateTime", "ms", UAVObjectField.FieldType.UINT8, UpdateTimeElemNames, null) ); + List NumFailedUpdatesElemNames = new ArrayList(); 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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/ActuatorDesired.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/ActuatorDesired.java index b81ca29da..03ff1985c 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/ActuatorDesired.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/ActuatorDesired.java @@ -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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/ActuatorSettings.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/ActuatorSettings.java index 542b433d1..71b0bb49f 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/ActuatorSettings.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/ActuatorSettings.java @@ -51,202 +51,6 @@ public class ActuatorSettings extends UAVDataObject { List fields = new ArrayList(); - List FixedWingRoll1ElemNames = new ArrayList(); - FixedWingRoll1ElemNames.add("0"); - List FixedWingRoll1EnumOptions = new ArrayList(); - 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 FixedWingRoll2ElemNames = new ArrayList(); - FixedWingRoll2ElemNames.add("0"); - List FixedWingRoll2EnumOptions = new ArrayList(); - 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 FixedWingPitch1ElemNames = new ArrayList(); - FixedWingPitch1ElemNames.add("0"); - List FixedWingPitch1EnumOptions = new ArrayList(); - 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 FixedWingPitch2ElemNames = new ArrayList(); - FixedWingPitch2ElemNames.add("0"); - List FixedWingPitch2EnumOptions = new ArrayList(); - 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 FixedWingYawElemNames = new ArrayList(); - FixedWingYawElemNames.add("0"); - List FixedWingYawEnumOptions = new ArrayList(); - 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 FixedWingThrottleElemNames = new ArrayList(); - FixedWingThrottleElemNames.add("0"); - List FixedWingThrottleEnumOptions = new ArrayList(); - 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 VTOLMotorNElemNames = new ArrayList(); - VTOLMotorNElemNames.add("0"); - List VTOLMotorNEnumOptions = new ArrayList(); - 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 VTOLMotorNEElemNames = new ArrayList(); - VTOLMotorNEElemNames.add("0"); - List VTOLMotorNEEnumOptions = new ArrayList(); - 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 VTOLMotorEElemNames = new ArrayList(); - VTOLMotorEElemNames.add("0"); - List VTOLMotorEEnumOptions = new ArrayList(); - 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 VTOLMotorSEElemNames = new ArrayList(); - VTOLMotorSEElemNames.add("0"); - List VTOLMotorSEEnumOptions = new ArrayList(); - 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 VTOLMotorSElemNames = new ArrayList(); - VTOLMotorSElemNames.add("0"); - List VTOLMotorSEnumOptions = new ArrayList(); - 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 VTOLMotorSWElemNames = new ArrayList(); - VTOLMotorSWElemNames.add("0"); - List VTOLMotorSWEnumOptions = new ArrayList(); - 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 VTOLMotorWElemNames = new ArrayList(); - VTOLMotorWElemNames.add("0"); - List VTOLMotorWEnumOptions = new ArrayList(); - 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 VTOLMotorNWElemNames = new ArrayList(); - VTOLMotorNWElemNames.add("0"); - List VTOLMotorNWEnumOptions = new ArrayList(); - 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 ChannelUpdateFreqElemNames = new ArrayList(); 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 ChannelNeutralElemNames = new ArrayList(); @@ -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 ChannelMinElemNames = new ArrayList(); @@ -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 FixedWingRoll1ElemNames = new ArrayList(); + FixedWingRoll1ElemNames.add("0"); + List FixedWingRoll1EnumOptions = new ArrayList(); + 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 FixedWingRoll2ElemNames = new ArrayList(); + FixedWingRoll2ElemNames.add("0"); + List FixedWingRoll2EnumOptions = new ArrayList(); + 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 FixedWingPitch1ElemNames = new ArrayList(); + FixedWingPitch1ElemNames.add("0"); + List FixedWingPitch1EnumOptions = new ArrayList(); + 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 FixedWingPitch2ElemNames = new ArrayList(); + FixedWingPitch2ElemNames.add("0"); + List FixedWingPitch2EnumOptions = new ArrayList(); + 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 FixedWingYaw1ElemNames = new ArrayList(); + FixedWingYaw1ElemNames.add("0"); + List FixedWingYaw1EnumOptions = new ArrayList(); + 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 FixedWingYaw2ElemNames = new ArrayList(); + FixedWingYaw2ElemNames.add("0"); + List FixedWingYaw2EnumOptions = new ArrayList(); + 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 FixedWingThrottleElemNames = new ArrayList(); + FixedWingThrottleElemNames.add("0"); + List FixedWingThrottleEnumOptions = new ArrayList(); + 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 VTOLMotorNElemNames = new ArrayList(); + VTOLMotorNElemNames.add("0"); + List VTOLMotorNEnumOptions = new ArrayList(); + 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 VTOLMotorNEElemNames = new ArrayList(); + VTOLMotorNEElemNames.add("0"); + List VTOLMotorNEEnumOptions = new ArrayList(); + 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 VTOLMotorEElemNames = new ArrayList(); + VTOLMotorEElemNames.add("0"); + List VTOLMotorEEnumOptions = new ArrayList(); + 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 VTOLMotorSEElemNames = new ArrayList(); + VTOLMotorSEElemNames.add("0"); + List VTOLMotorSEEnumOptions = new ArrayList(); + 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 VTOLMotorSElemNames = new ArrayList(); + VTOLMotorSElemNames.add("0"); + List VTOLMotorSEnumOptions = new ArrayList(); + 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 VTOLMotorSWElemNames = new ArrayList(); + VTOLMotorSWElemNames.add("0"); + List VTOLMotorSWEnumOptions = new ArrayList(); + 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 VTOLMotorWElemNames = new ArrayList(); + VTOLMotorWElemNames.add("0"); + List VTOLMotorWEnumOptions = new ArrayList(); + 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 VTOLMotorNWElemNames = new ArrayList(); + VTOLMotorNWElemNames.add("0"); + List VTOLMotorNWEnumOptions = new ArrayList(); + 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 ChannelTypeElemNames = new ArrayList(); 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 ChannelTypeEnumOptions = new ArrayList(); 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 ChannelAddrElemNames = new ArrayList(); @@ -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 MotorsSpinWhileArmedElemNames = new ArrayList(); + MotorsSpinWhileArmedElemNames.add("0"); + List MotorsSpinWhileArmedEnumOptions = new ArrayList(); + 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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/AhrsStatus.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/AhrsStatus.java index 3ee8304ae..82e447a70 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/AhrsStatus.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/AhrsStatus.java @@ -51,6 +51,10 @@ public class AhrsStatus extends UAVDataObject { List fields = new ArrayList(); + List RunningTimeElemNames = new ArrayList(); + RunningTimeElemNames.add("0"); + fields.add( new UAVObjectField("RunningTime", "ms", UAVObjectField.FieldType.UINT32, RunningTimeElemNames, null) ); + List SerialNumberElemNames = new ArrayList(); 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 RunningTimeElemNames = new ArrayList(); - RunningTimeElemNames.add("0"); - fields.add( new UAVObjectField("RunningTime", "ms", UAVObjectField.FieldType.UINT32, RunningTimeElemNames, null) ); - List IdleTimePerCyleElemNames = new ArrayList(); 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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/AttitudeActual.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/AttitudeActual.java index 714c18571..7c9272cad 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/AttitudeActual.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/AttitudeActual.java @@ -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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/AttitudeRaw.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/AttitudeRaw.java index d28302b6a..b8c3aacb4 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/AttitudeRaw.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/AttitudeRaw.java @@ -51,29 +51,29 @@ public class AttitudeRaw extends UAVDataObject { List fields = new ArrayList(); - List magnetometersElemNames = new ArrayList(); - magnetometersElemNames.add("X"); - magnetometersElemNames.add("Y"); - magnetometersElemNames.add("Z"); - fields.add( new UAVObjectField("magnetometers", "mGa", UAVObjectField.FieldType.INT16, magnetometersElemNames, null) ); - List gyrosElemNames = new ArrayList(); gyrosElemNames.add("X"); gyrosElemNames.add("Y"); gyrosElemNames.add("Z"); fields.add( new UAVObjectField("gyros", "deg/s", UAVObjectField.FieldType.FLOAT32, gyrosElemNames, null) ); - List gyrotempElemNames = new ArrayList(); - gyrotempElemNames.add("XY"); - gyrotempElemNames.add("Z"); - fields.add( new UAVObjectField("gyrotemp", "raw", UAVObjectField.FieldType.UINT16, gyrotempElemNames, null) ); - List accelsElemNames = new ArrayList(); accelsElemNames.add("X"); accelsElemNames.add("Y"); accelsElemNames.add("Z"); fields.add( new UAVObjectField("accels", "m/s^2", UAVObjectField.FieldType.FLOAT32, accelsElemNames, null) ); + List magnetometersElemNames = new ArrayList(); + magnetometersElemNames.add("X"); + magnetometersElemNames.add("Y"); + magnetometersElemNames.add("Z"); + fields.add( new UAVObjectField("magnetometers", "mGa", UAVObjectField.FieldType.INT16, magnetometersElemNames, null) ); + + List gyrotempElemNames = new ArrayList(); + 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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/AttitudeSettings.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/AttitudeSettings.java index 482fc12ce..3034a99ad 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/AttitudeSettings.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/AttitudeSettings.java @@ -51,12 +51,6 @@ public class AttitudeSettings extends UAVDataObject { List fields = new ArrayList(); - List AccelBiasElemNames = new ArrayList(); - AccelBiasElemNames.add("X"); - AccelBiasElemNames.add("Y"); - AccelBiasElemNames.add("Z"); - fields.add( new UAVObjectField("AccelBias", "lsb", UAVObjectField.FieldType.INT16, AccelBiasElemNames, null) ); - List GyroGainElemNames = new ArrayList(); 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 YawBiasRateElemNames = new ArrayList(); + YawBiasRateElemNames.add("0"); + fields.add( new UAVObjectField("YawBiasRate", "channel", UAVObjectField.FieldType.FLOAT32, YawBiasRateElemNames, null) ); + + List AccelBiasElemNames = new ArrayList(); + AccelBiasElemNames.add("X"); + AccelBiasElemNames.add("Y"); + AccelBiasElemNames.add("Z"); + fields.add( new UAVObjectField("AccelBias", "lsb", UAVObjectField.FieldType.INT16, AccelBiasElemNames, null) ); + + List GyroBiasElemNames = new ArrayList(); + GyroBiasElemNames.add("X"); + GyroBiasElemNames.add("Y"); + GyroBiasElemNames.add("Z"); + fields.add( new UAVObjectField("GyroBias", "deg/s * 100", UAVObjectField.FieldType.INT16, GyroBiasElemNames, null) ); + + List BoardRotationElemNames = new ArrayList(); + BoardRotationElemNames.add("Roll"); + BoardRotationElemNames.add("Pitch"); + BoardRotationElemNames.add("Yaw"); + fields.add( new UAVObjectField("BoardRotation", "deg", UAVObjectField.FieldType.INT16, BoardRotationElemNames, null) ); + + List ZeroDuringArmingElemNames = new ArrayList(); + ZeroDuringArmingElemNames.add("0"); + List ZeroDuringArmingEnumOptions = new ArrayList(); + ZeroDuringArmingEnumOptions.add("FALSE"); + ZeroDuringArmingEnumOptions.add("TRUE"); + fields.add( new UAVObjectField("ZeroDuringArming", "channel", UAVObjectField.FieldType.ENUM, ZeroDuringArmingElemNames, ZeroDuringArmingEnumOptions) ); + + List BiasCorrectGyroElemNames = new ArrayList(); + BiasCorrectGyroElemNames.add("0"); + List BiasCorrectGyroEnumOptions = new ArrayList(); + BiasCorrectGyroEnumOptions.add("FALSE"); + BiasCorrectGyroEnumOptions.add("TRUE"); + fields.add( new UAVObjectField("BiasCorrectGyro", "channel", UAVObjectField.FieldType.ENUM, BiasCorrectGyroElemNames, BiasCorrectGyroEnumOptions) ); + + List TrimFlightElemNames = new ArrayList(); + TrimFlightElemNames.add("0"); + List TrimFlightEnumOptions = new ArrayList(); + 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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/BaroAltitude.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/BaroAltitude.java index a2c2c7e3d..ecde53985 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/BaroAltitude.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/BaroAltitude.java @@ -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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/CameraDesired.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/CameraDesired.java new file mode 100644 index 000000000..7a36ec1ea --- /dev/null +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/CameraDesired.java @@ -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 fields = new ArrayList(); + + + List RollElemNames = new ArrayList(); + RollElemNames.add("0"); + fields.add( new UAVObjectField("Roll", "", UAVObjectField.FieldType.FLOAT32, RollElemNames, null) ); + + List PitchElemNames = new ArrayList(); + PitchElemNames.add("0"); + fields.add( new UAVObjectField("Pitch", "", UAVObjectField.FieldType.FLOAT32, PitchElemNames, null) ); + + List YawElemNames = new ArrayList(); + 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 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; + + +} \ No newline at end of file diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/CameraStabSettings.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/CameraStabSettings.java new file mode 100644 index 000000000..a8e03df32 --- /dev/null +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/CameraStabSettings.java @@ -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 fields = new ArrayList(); + + + List MaxAxisLockRateElemNames = new ArrayList(); + MaxAxisLockRateElemNames.add("0"); + fields.add( new UAVObjectField("MaxAxisLockRate", "deg/s", UAVObjectField.FieldType.FLOAT32, MaxAxisLockRateElemNames, null) ); + + List ResponseTimeElemNames = new ArrayList(); + ResponseTimeElemNames.add("Roll"); + ResponseTimeElemNames.add("Pitch"); + ResponseTimeElemNames.add("Yaw"); + fields.add( new UAVObjectField("ResponseTime", "ms", UAVObjectField.FieldType.UINT16, ResponseTimeElemNames, null) ); + + List InputElemNames = new ArrayList(); + InputElemNames.add("Roll"); + InputElemNames.add("Pitch"); + InputElemNames.add("Yaw"); + List InputEnumOptions = new ArrayList(); + 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 InputRangeElemNames = new ArrayList(); + InputRangeElemNames.add("Roll"); + InputRangeElemNames.add("Pitch"); + InputRangeElemNames.add("Yaw"); + fields.add( new UAVObjectField("InputRange", "deg", UAVObjectField.FieldType.UINT8, InputRangeElemNames, null) ); + + List InputRateElemNames = new ArrayList(); + InputRateElemNames.add("Roll"); + InputRateElemNames.add("Pitch"); + InputRateElemNames.add("Yaw"); + fields.add( new UAVObjectField("InputRate", "deg/s", UAVObjectField.FieldType.UINT8, InputRateElemNames, null) ); + + List StabilizationModeElemNames = new ArrayList(); + StabilizationModeElemNames.add("Roll"); + StabilizationModeElemNames.add("Pitch"); + StabilizationModeElemNames.add("Yaw"); + List StabilizationModeEnumOptions = new ArrayList(); + StabilizationModeEnumOptions.add("Attitude"); + StabilizationModeEnumOptions.add("AxisLock"); + fields.add( new UAVObjectField("StabilizationMode", "", UAVObjectField.FieldType.ENUM, StabilizationModeElemNames, StabilizationModeEnumOptions) ); + + List OutputRangeElemNames = new ArrayList(); + 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 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; + + +} \ No newline at end of file diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/TelemetrySettings.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/FaultSettings.java similarity index 74% rename from androidgcs/src/org/openpilot/uavtalk/uavobjects/TelemetrySettings.java rename to androidgcs/src/org/openpilot/uavtalk/uavobjects/FaultSettings.java index 675f9b592..b22b8185e 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/TelemetrySettings.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/FaultSettings.java @@ -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 fields = new ArrayList(); - List SpeedElemNames = new ArrayList(); - SpeedElemNames.add("0"); - List SpeedEnumOptions = new ArrayList(); - 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 ActivateFaultElemNames = new ArrayList(); + ActivateFaultElemNames.add("0"); + List ActivateFaultEnumOptions = new ArrayList(); + 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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/FirmwareIAPObj.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/FirmwareIAPObj.java index 493d6cd64..71c681bd2 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/FirmwareIAPObj.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/FirmwareIAPObj.java @@ -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 fields = new ArrayList(); + List crcElemNames = new ArrayList(); + crcElemNames.add("0"); + fields.add( new UAVObjectField("crc", "", UAVObjectField.FieldType.UINT32, crcElemNames, null) ); + List CommandElemNames = new ArrayList(); CommandElemNames.add("0"); fields.add( new UAVObjectField("Command", "", UAVObjectField.FieldType.UINT16, CommandElemNames, null) ); + List BoardRevisionElemNames = new ArrayList(); + BoardRevisionElemNames.add("0"); + fields.add( new UAVObjectField("BoardRevision", "", UAVObjectField.FieldType.UINT16, BoardRevisionElemNames, null) ); + List DescriptionElemNames = new ArrayList(); 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 BoardRevisionElemNames = new ArrayList(); - BoardRevisionElemNames.add("0"); - fields.add( new UAVObjectField("BoardRevision", "", UAVObjectField.FieldType.UINT16, BoardRevisionElemNames, null) ); + List CPUSerialElemNames = new ArrayList(); + 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 BoardTypeElemNames = new ArrayList(); 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 crcElemNames = new ArrayList(); - 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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightBatterySettings.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightBatterySettings.java new file mode 100644 index 000000000..a3bc23eb3 --- /dev/null +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightBatterySettings.java @@ -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 fields = new ArrayList(); + + + List CapacityElemNames = new ArrayList(); + CapacityElemNames.add("0"); + fields.add( new UAVObjectField("Capacity", "mAh", UAVObjectField.FieldType.UINT32, CapacityElemNames, null) ); + + List VoltageThresholdsElemNames = new ArrayList(); + VoltageThresholdsElemNames.add("Warning"); + VoltageThresholdsElemNames.add("Alarm"); + fields.add( new UAVObjectField("VoltageThresholds", "V", UAVObjectField.FieldType.FLOAT32, VoltageThresholdsElemNames, null) ); + + List SensorCalibrationsElemNames = new ArrayList(); + SensorCalibrationsElemNames.add("VoltageFactor"); + SensorCalibrationsElemNames.add("CurrentFactor"); + fields.add( new UAVObjectField("SensorCalibrations", "", UAVObjectField.FieldType.FLOAT32, SensorCalibrationsElemNames, null) ); + + List TypeElemNames = new ArrayList(); + TypeElemNames.add("0"); + List TypeEnumOptions = new ArrayList(); + 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 NbCellsElemNames = new ArrayList(); + NbCellsElemNames.add("0"); + fields.add( new UAVObjectField("NbCells", "", UAVObjectField.FieldType.UINT8, NbCellsElemNames, null) ); + + List SensorTypeElemNames = new ArrayList(); + SensorTypeElemNames.add("0"); + List SensorTypeEnumOptions = new ArrayList(); + 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 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; + + +} \ No newline at end of file diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightBatteryState.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightBatteryState.java index d9fba1de5..82fcfae47 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightBatteryState.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightBatteryState.java @@ -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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightPlanControl.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightPlanControl.java index fdc5bfcb0..dbe959f96 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightPlanControl.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightPlanControl.java @@ -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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightPlanSettings.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightPlanSettings.java index 383e4aff0..6fc39a26e 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightPlanSettings.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightPlanSettings.java @@ -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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightPlanStatus.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightPlanStatus.java index 2303514c0..7b78bce71 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightPlanStatus.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightPlanStatus.java @@ -51,6 +51,19 @@ public class FlightPlanStatus extends UAVDataObject { List fields = new ArrayList(); + List ErrorFileIDElemNames = new ArrayList(); + ErrorFileIDElemNames.add("0"); + fields.add( new UAVObjectField("ErrorFileID", "", UAVObjectField.FieldType.UINT32, ErrorFileIDElemNames, null) ); + + List ErrorLineNumElemNames = new ArrayList(); + ErrorLineNumElemNames.add("0"); + fields.add( new UAVObjectField("ErrorLineNum", "", UAVObjectField.FieldType.UINT32, ErrorLineNumElemNames, null) ); + + List DebugElemNames = new ArrayList(); + DebugElemNames.add("0"); + DebugElemNames.add("1"); + fields.add( new UAVObjectField("Debug", "", UAVObjectField.FieldType.FLOAT32, DebugElemNames, null) ); + List StatusElemNames = new ArrayList(); StatusElemNames.add("0"); List StatusEnumOptions = new ArrayList(); @@ -83,22 +96,6 @@ public class FlightPlanStatus extends UAVDataObject { ErrorTypeEnumOptions.add("UnknownError"); fields.add( new UAVObjectField("ErrorType", "", UAVObjectField.FieldType.ENUM, ErrorTypeElemNames, ErrorTypeEnumOptions) ); - List ErrorFileIDElemNames = new ArrayList(); - ErrorFileIDElemNames.add("0"); - fields.add( new UAVObjectField("ErrorFileID", "", UAVObjectField.FieldType.UINT32, ErrorFileIDElemNames, null) ); - - List ErrorLineNumElemNames = new ArrayList(); - ErrorLineNumElemNames.add("0"); - fields.add( new UAVObjectField("ErrorLineNum", "", UAVObjectField.FieldType.UINT32, ErrorLineNumElemNames, null) ); - - List Debug1ElemNames = new ArrayList(); - Debug1ElemNames.add("0"); - fields.add( new UAVObjectField("Debug1", "", UAVObjectField.FieldType.FLOAT32, Debug1ElemNames, null) ); - - List Debug2ElemNames = new ArrayList(); - 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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightStatus.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightStatus.java new file mode 100644 index 000000000..d775b21e7 --- /dev/null +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightStatus.java @@ -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 fields = new ArrayList(); + + + List ArmedElemNames = new ArrayList(); + ArmedElemNames.add("0"); + List ArmedEnumOptions = new ArrayList(); + ArmedEnumOptions.add("Disarmed"); + ArmedEnumOptions.add("Arming"); + ArmedEnumOptions.add("Armed"); + fields.add( new UAVObjectField("Armed", "", UAVObjectField.FieldType.ENUM, ArmedElemNames, ArmedEnumOptions) ); + + List FlightModeElemNames = new ArrayList(); + FlightModeElemNames.add("0"); + List FlightModeEnumOptions = new ArrayList(); + 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 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; + + +} \ No newline at end of file diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightTelemetryStats.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightTelemetryStats.java index b58fe6d46..403ea1d5e 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightTelemetryStats.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightTelemetryStats.java @@ -51,15 +51,6 @@ public class FlightTelemetryStats extends UAVDataObject { List fields = new ArrayList(); - List StatusElemNames = new ArrayList(); - StatusElemNames.add("0"); - List StatusEnumOptions = new ArrayList(); - StatusEnumOptions.add("Disconnected"); - StatusEnumOptions.add("HandshakeReq"); - StatusEnumOptions.add("HandshakeAck"); - StatusEnumOptions.add("Connected"); - fields.add( new UAVObjectField("Status", "", UAVObjectField.FieldType.ENUM, StatusElemNames, StatusEnumOptions) ); - List TxDataRateElemNames = new ArrayList(); 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 StatusElemNames = new ArrayList(); + StatusElemNames.add("0"); + List StatusEnumOptions = new ArrayList(); + 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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/GCSReceiver.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/GCSReceiver.java new file mode 100644 index 000000000..3cb3811ae --- /dev/null +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/GCSReceiver.java @@ -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 fields = new ArrayList(); + + + List ChannelElemNames = new ArrayList(); + 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 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; + + +} \ No newline at end of file diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/GCSTelemetryStats.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/GCSTelemetryStats.java index 0f304d45d..b32f551ce 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/GCSTelemetryStats.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/GCSTelemetryStats.java @@ -51,15 +51,6 @@ public class GCSTelemetryStats extends UAVDataObject { List fields = new ArrayList(); - List StatusElemNames = new ArrayList(); - StatusElemNames.add("0"); - List StatusEnumOptions = new ArrayList(); - StatusEnumOptions.add("Disconnected"); - StatusEnumOptions.add("HandshakeReq"); - StatusEnumOptions.add("HandshakeAck"); - StatusEnumOptions.add("Connected"); - fields.add( new UAVObjectField("Status", "", UAVObjectField.FieldType.ENUM, StatusElemNames, StatusEnumOptions) ); - List TxDataRateElemNames = new ArrayList(); 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 StatusElemNames = new ArrayList(); + StatusElemNames.add("0"); + List StatusEnumOptions = new ArrayList(); + 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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/GPSPosition.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/GPSPosition.java index 889091e0e..5f4e20b46 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/GPSPosition.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/GPSPosition.java @@ -51,15 +51,6 @@ public class GPSPosition extends UAVDataObject { List fields = new ArrayList(); - List StatusElemNames = new ArrayList(); - StatusElemNames.add("0"); - List StatusEnumOptions = new ArrayList(); - StatusEnumOptions.add("NoGPS"); - StatusEnumOptions.add("NoFix"); - StatusEnumOptions.add("Fix2D"); - StatusEnumOptions.add("Fix3D"); - fields.add( new UAVObjectField("Status", "", UAVObjectField.FieldType.ENUM, StatusElemNames, StatusEnumOptions) ); - List LatitudeElemNames = new ArrayList(); 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 SatellitesElemNames = new ArrayList(); - SatellitesElemNames.add("0"); - fields.add( new UAVObjectField("Satellites", "", UAVObjectField.FieldType.INT8, SatellitesElemNames, null) ); - List PDOPElemNames = new ArrayList(); 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 StatusElemNames = new ArrayList(); + StatusElemNames.add("0"); + List StatusEnumOptions = new ArrayList(); + StatusEnumOptions.add("NoGPS"); + StatusEnumOptions.add("NoFix"); + StatusEnumOptions.add("Fix2D"); + StatusEnumOptions.add("Fix3D"); + fields.add( new UAVObjectField("Status", "", UAVObjectField.FieldType.ENUM, StatusElemNames, StatusEnumOptions) ); + + List SatellitesElemNames = new ArrayList(); + 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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/GPSSatellites.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/GPSSatellites.java index fa1100207..bb331132d 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/GPSSatellites.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/GPSSatellites.java @@ -51,29 +51,6 @@ public class GPSSatellites extends UAVDataObject { List fields = new ArrayList(); - List SatsInViewElemNames = new ArrayList(); - SatsInViewElemNames.add("0"); - fields.add( new UAVObjectField("SatsInView", "", UAVObjectField.FieldType.INT8, SatsInViewElemNames, null) ); - - List PRNElemNames = new ArrayList(); - 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 ElevationElemNames = new ArrayList(); 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 SatsInViewElemNames = new ArrayList(); + SatsInViewElemNames.add("0"); + fields.add( new UAVObjectField("SatsInView", "", UAVObjectField.FieldType.INT8, SatsInViewElemNames, null) ); + + List PRNElemNames = new ArrayList(); + 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 SNRElemNames = new ArrayList(); 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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/GPSTime.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/GPSTime.java index 5ff55cc2e..5aa4df7bf 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/GPSTime.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/GPSTime.java @@ -51,6 +51,10 @@ public class GPSTime extends UAVDataObject { List fields = new ArrayList(); + List YearElemNames = new ArrayList(); + YearElemNames.add("0"); + fields.add( new UAVObjectField("Year", "", UAVObjectField.FieldType.INT16, YearElemNames, null) ); + List MonthElemNames = new ArrayList(); 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 YearElemNames = new ArrayList(); - YearElemNames.add("0"); - fields.add( new UAVObjectField("Year", "", UAVObjectField.FieldType.INT16, YearElemNames, null) ); - List HourElemNames = new ArrayList(); 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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/GuidanceSettings.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/GuidanceSettings.java index 2fe8bb437..205384efe 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/GuidanceSettings.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/GuidanceSettings.java @@ -51,29 +51,24 @@ public class GuidanceSettings extends UAVDataObject { List fields = new ArrayList(); - List GuidanceModeElemNames = new ArrayList(); - GuidanceModeElemNames.add("0"); - List GuidanceModeEnumOptions = new ArrayList(); - GuidanceModeEnumOptions.add("DUAL_LOOP"); - GuidanceModeEnumOptions.add("VELOCITY_CONTROL"); - fields.add( new UAVObjectField("GuidanceMode", "", UAVObjectField.FieldType.ENUM, GuidanceModeElemNames, GuidanceModeEnumOptions) ); - - List HorizontalPElemNames = new ArrayList(); - HorizontalPElemNames.add("Kp"); - HorizontalPElemNames.add("Max"); - fields.add( new UAVObjectField("HorizontalP", "", UAVObjectField.FieldType.FLOAT32, HorizontalPElemNames, null) ); + List HorizontalPosPIElemNames = new ArrayList(); + HorizontalPosPIElemNames.add("Kp"); + HorizontalPosPIElemNames.add("Ki"); + HorizontalPosPIElemNames.add("ILimit"); + fields.add( new UAVObjectField("HorizontalPosPI", "(cm/s)/cm", UAVObjectField.FieldType.FLOAT32, HorizontalPosPIElemNames, null) ); List HorizontalVelPIDElemNames = new ArrayList(); 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 VerticalPElemNames = new ArrayList(); - VerticalPElemNames.add("Kp"); - VerticalPElemNames.add("Max"); - fields.add( new UAVObjectField("VerticalP", "", UAVObjectField.FieldType.FLOAT32, VerticalPElemNames, null) ); + List VerticalPosPIElemNames = new ArrayList(); + VerticalPosPIElemNames.add("Kp"); + VerticalPosPIElemNames.add("Ki"); + VerticalPosPIElemNames.add("ILimit"); + fields.add( new UAVObjectField("VerticalPosPI", "", UAVObjectField.FieldType.FLOAT32, VerticalPosPIElemNames, null) ); List VerticalVelPIDElemNames = new ArrayList(); 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 ThrottleControlElemNames = new ArrayList(); - ThrottleControlElemNames.add("0"); - List ThrottleControlEnumOptions = new ArrayList(); - ThrottleControlEnumOptions.add("FALSE"); - ThrottleControlEnumOptions.add("TRUE"); - fields.add( new UAVObjectField("ThrottleControl", "", UAVObjectField.FieldType.ENUM, ThrottleControlElemNames, ThrottleControlEnumOptions) ); - List MaxRollPitchElemNames = new ArrayList(); 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 HorizontalVelMaxElemNames = new ArrayList(); + HorizontalVelMaxElemNames.add("0"); + fields.add( new UAVObjectField("HorizontalVelMax", "cm/s", UAVObjectField.FieldType.UINT16, HorizontalVelMaxElemNames, null) ); + + List VerticalVelMaxElemNames = new ArrayList(); + VerticalVelMaxElemNames.add("0"); + fields.add( new UAVObjectField("VerticalVelMax", "cm/s", UAVObjectField.FieldType.UINT16, VerticalVelMaxElemNames, null) ); + + List GuidanceModeElemNames = new ArrayList(); + GuidanceModeElemNames.add("0"); + List GuidanceModeEnumOptions = new ArrayList(); + GuidanceModeEnumOptions.add("DUAL_LOOP"); + GuidanceModeEnumOptions.add("VELOCITY_CONTROL"); + fields.add( new UAVObjectField("GuidanceMode", "", UAVObjectField.FieldType.ENUM, GuidanceModeElemNames, GuidanceModeEnumOptions) ); + + List ThrottleControlElemNames = new ArrayList(); + ThrottleControlElemNames.add("0"); + List ThrottleControlEnumOptions = new ArrayList(); + 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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/HomeLocation.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/HomeLocation.java index 5941c069c..68abb3633 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/HomeLocation.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/HomeLocation.java @@ -51,13 +51,6 @@ public class HomeLocation extends UAVDataObject { List fields = new ArrayList(); - List SetElemNames = new ArrayList(); - SetElemNames.add("0"); - List SetEnumOptions = new ArrayList(); - SetEnumOptions.add("FALSE"); - SetEnumOptions.add("TRUE"); - fields.add( new UAVObjectField("Set", "", UAVObjectField.FieldType.ENUM, SetElemNames, SetEnumOptions) ); - List LatitudeElemNames = new ArrayList(); 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 g_eElemNames = new ArrayList(); + g_eElemNames.add("0"); + fields.add( new UAVObjectField("g_e", "m/s^2", UAVObjectField.FieldType.FLOAT32, g_eElemNames, null) ); + + List SetElemNames = new ArrayList(); + SetElemNames.add("0"); + List SetEnumOptions = new ArrayList(); + 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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/HwSettings.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/HwSettings.java new file mode 100644 index 000000000..83b7ae7b6 --- /dev/null +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/HwSettings.java @@ -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 fields = new ArrayList(); + + + List CC_RcvrPortElemNames = new ArrayList(); + CC_RcvrPortElemNames.add("0"); + List CC_RcvrPortEnumOptions = new ArrayList(); + 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 CC_MainPortElemNames = new ArrayList(); + CC_MainPortElemNames.add("0"); + List CC_MainPortEnumOptions = new ArrayList(); + 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 CC_FlexiPortElemNames = new ArrayList(); + CC_FlexiPortElemNames.add("0"); + List CC_FlexiPortEnumOptions = new ArrayList(); + 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 OP_RcvrPortElemNames = new ArrayList(); + OP_RcvrPortElemNames.add("0"); + List OP_RcvrPortEnumOptions = new ArrayList(); + 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 OP_MainPortElemNames = new ArrayList(); + OP_MainPortElemNames.add("0"); + List OP_MainPortEnumOptions = new ArrayList(); + OP_MainPortEnumOptions.add("Disabled"); + OP_MainPortEnumOptions.add("Telemetry"); + fields.add( new UAVObjectField("OP_MainPort", "function", UAVObjectField.FieldType.ENUM, OP_MainPortElemNames, OP_MainPortEnumOptions) ); + + List OP_FlexiPortElemNames = new ArrayList(); + OP_FlexiPortElemNames.add("0"); + List OP_FlexiPortEnumOptions = new ArrayList(); + OP_FlexiPortEnumOptions.add("Disabled"); + OP_FlexiPortEnumOptions.add("GPS"); + fields.add( new UAVObjectField("OP_FlexiPort", "function", UAVObjectField.FieldType.ENUM, OP_FlexiPortElemNames, OP_FlexiPortEnumOptions) ); + + List TelemetrySpeedElemNames = new ArrayList(); + TelemetrySpeedElemNames.add("0"); + List TelemetrySpeedEnumOptions = new ArrayList(); + 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 GPSSpeedElemNames = new ArrayList(); + GPSSpeedElemNames.add("0"); + List GPSSpeedEnumOptions = new ArrayList(); + 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 ComUsbBridgeSpeedElemNames = new ArrayList(); + ComUsbBridgeSpeedElemNames.add("0"); + List ComUsbBridgeSpeedEnumOptions = new ArrayList(); + 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 USB_DeviceTypeElemNames = new ArrayList(); + USB_DeviceTypeElemNames.add("0"); + List USB_DeviceTypeEnumOptions = new ArrayList(); + 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 USB_HIDPortElemNames = new ArrayList(); + USB_HIDPortElemNames.add("0"); + List USB_HIDPortEnumOptions = new ArrayList(); + USB_HIDPortEnumOptions.add("USBTelemetry"); + USB_HIDPortEnumOptions.add("Disabled"); + fields.add( new UAVObjectField("USB_HIDPort", "function", UAVObjectField.FieldType.ENUM, USB_HIDPortElemNames, USB_HIDPortEnumOptions) ); + + List USB_VCPPortElemNames = new ArrayList(); + USB_VCPPortElemNames.add("0"); + List USB_VCPPortEnumOptions = new ArrayList(); + 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 OptionalModulesElemNames = new ArrayList(); + OptionalModulesElemNames.add("CameraStab"); + OptionalModulesElemNames.add("GPS"); + OptionalModulesElemNames.add("ComUsbBridge"); + OptionalModulesElemNames.add("Fault"); + OptionalModulesElemNames.add("Altitude"); + List OptionalModulesEnumOptions = new ArrayList(); + OptionalModulesEnumOptions.add("Disabled"); + OptionalModulesEnumOptions.add("Enabled"); + fields.add( new UAVObjectField("OptionalModules", "", UAVObjectField.FieldType.ENUM, OptionalModulesElemNames, OptionalModulesEnumOptions) ); + + List DSMxBindElemNames = new ArrayList(); + 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 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; + + +} \ No newline at end of file diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/I2CStats.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/I2CStats.java index fc68e2902..abd8f41f6 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/I2CStats.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/I2CStats.java @@ -51,6 +51,22 @@ public class I2CStats extends UAVDataObject { List fields = new ArrayList(); + List evirq_logElemNames = new ArrayList(); + 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 erirq_logElemNames = new ArrayList(); + 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 event_errorsElemNames = new ArrayList(); 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 evirq_logElemNames = new ArrayList(); - 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 erirq_logElemNames = new ArrayList(); - 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 event_logElemNames = new ArrayList(); 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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/ManualControlCommand.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/ManualControlCommand.java index 636f30946..6ac5a1b2c 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/ManualControlCommand.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/ManualControlCommand.java @@ -51,19 +51,9 @@ public class ManualControlCommand extends UAVDataObject { List fields = new ArrayList(); - List ConnectedElemNames = new ArrayList(); - ConnectedElemNames.add("0"); - List ConnectedEnumOptions = new ArrayList(); - ConnectedEnumOptions.add("False"); - ConnectedEnumOptions.add("True"); - fields.add( new UAVObjectField("Connected", "", UAVObjectField.FieldType.ENUM, ConnectedElemNames, ConnectedEnumOptions) ); - - List ArmedElemNames = new ArrayList(); - ArmedElemNames.add("0"); - List ArmedEnumOptions = new ArrayList(); - ArmedEnumOptions.add("False"); - ArmedEnumOptions.add("True"); - fields.add( new UAVObjectField("Armed", "", UAVObjectField.FieldType.ENUM, ArmedElemNames, ArmedEnumOptions) ); + List ThrottleElemNames = new ArrayList(); + ThrottleElemNames.add("0"); + fields.add( new UAVObjectField("Throttle", "%", UAVObjectField.FieldType.FLOAT32, ThrottleElemNames, null) ); List RollElemNames = new ArrayList(); 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 ThrottleElemNames = new ArrayList(); - ThrottleElemNames.add("0"); - fields.add( new UAVObjectField("Throttle", "%", UAVObjectField.FieldType.FLOAT32, ThrottleElemNames, null) ); - - List FlightModeElemNames = new ArrayList(); - FlightModeElemNames.add("0"); - List FlightModeEnumOptions = new ArrayList(); - 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 Accessory1ElemNames = new ArrayList(); - Accessory1ElemNames.add("0"); - fields.add( new UAVObjectField("Accessory1", "%", UAVObjectField.FieldType.FLOAT32, Accessory1ElemNames, null) ); - - List Accessory2ElemNames = new ArrayList(); - Accessory2ElemNames.add("0"); - fields.add( new UAVObjectField("Accessory2", "%", UAVObjectField.FieldType.FLOAT32, Accessory2ElemNames, null) ); - - List Accessory3ElemNames = new ArrayList(); - Accessory3ElemNames.add("0"); - fields.add( new UAVObjectField("Accessory3", "%", UAVObjectField.FieldType.FLOAT32, Accessory3ElemNames, null) ); + List CollectiveElemNames = new ArrayList(); + CollectiveElemNames.add("0"); + fields.add( new UAVObjectField("Collective", "%", UAVObjectField.FieldType.FLOAT32, CollectiveElemNames, null) ); List ChannelElemNames = new ArrayList(); 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 ConnectedElemNames = new ArrayList(); + ConnectedElemNames.add("0"); + List ConnectedEnumOptions = new ArrayList(); + 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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/ManualControlSettings.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/ManualControlSettings.java index 83697999a..bb846695d 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/ManualControlSettings.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/ManualControlSettings.java @@ -51,125 +51,77 @@ public class ManualControlSettings extends UAVDataObject { List fields = new ArrayList(); - List InputModeElemNames = new ArrayList(); - InputModeElemNames.add("0"); - List InputModeEnumOptions = new ArrayList(); - InputModeEnumOptions.add("PWM"); - InputModeEnumOptions.add("PPM"); - InputModeEnumOptions.add("Spektrum"); - fields.add( new UAVObjectField("InputMode", "", UAVObjectField.FieldType.ENUM, InputModeElemNames, InputModeEnumOptions) ); + List ChannelMinElemNames = new ArrayList(); + 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 RollElemNames = new ArrayList(); - RollElemNames.add("0"); - List RollEnumOptions = new ArrayList(); - 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 ChannelNeutralElemNames = new ArrayList(); + 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 PitchElemNames = new ArrayList(); - PitchElemNames.add("0"); - List PitchEnumOptions = new ArrayList(); - 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 ChannelMaxElemNames = new ArrayList(); + 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 YawElemNames = new ArrayList(); - YawElemNames.add("0"); - List YawEnumOptions = new ArrayList(); - 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 ArmedTimeoutElemNames = new ArrayList(); + ArmedTimeoutElemNames.add("0"); + fields.add( new UAVObjectField("ArmedTimeout", "ms", UAVObjectField.FieldType.UINT16, ArmedTimeoutElemNames, null) ); - List ThrottleElemNames = new ArrayList(); - ThrottleElemNames.add("0"); - List ThrottleEnumOptions = new ArrayList(); - 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 ChannelGroupsElemNames = new ArrayList(); + 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 ChannelGroupsEnumOptions = new ArrayList(); + 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 FlightModeElemNames = new ArrayList(); - FlightModeElemNames.add("0"); - List FlightModeEnumOptions = new ArrayList(); - 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 Accessory1ElemNames = new ArrayList(); - Accessory1ElemNames.add("0"); - List Accessory1EnumOptions = new ArrayList(); - 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 Accessory2ElemNames = new ArrayList(); - Accessory2ElemNames.add("0"); - List Accessory2EnumOptions = new ArrayList(); - 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 Accessory3ElemNames = new ArrayList(); - Accessory3ElemNames.add("0"); - List Accessory3EnumOptions = new ArrayList(); - 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 ChannelNumberElemNames = new ArrayList(); + 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 ArmingElemNames = new ArrayList(); 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 Stabilization2SettingsElemNames = new ArrayList(); @@ -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 Stabilization3SettingsElemNames = new ArrayList(); @@ -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 FlightModePositionElemNames = new ArrayList(); @@ -227,43 +185,6 @@ public class ManualControlSettings extends UAVDataObject { FlightModePositionEnumOptions.add("PositionHold"); fields.add( new UAVObjectField("FlightModePosition", "", UAVObjectField.FieldType.ENUM, FlightModePositionElemNames, FlightModePositionEnumOptions) ); - List ChannelMaxElemNames = new ArrayList(); - 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 ChannelNeutralElemNames = new ArrayList(); - 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 ChannelMinElemNames = new ArrayList(); - 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 ArmedTimeoutElemNames = new ArrayList(); - 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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/MixerSettings.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/MixerSettings.java index 9aa87d49e..76841d8ff 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/MixerSettings.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/MixerSettings.java @@ -83,12 +83,37 @@ public class MixerSettings extends UAVDataObject { ThrottleCurve2ElemNames.add("100"); fields.add( new UAVObjectField("ThrottleCurve2", "percent", UAVObjectField.FieldType.FLOAT32, ThrottleCurve2ElemNames, null) ); + List Curve2SourceElemNames = new ArrayList(); + Curve2SourceElemNames.add("0"); + List Curve2SourceEnumOptions = new ArrayList(); + 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 Mixer1TypeElemNames = new ArrayList(); Mixer1TypeElemNames.add("0"); List Mixer1TypeEnumOptions = new ArrayList(); 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 Mixer1VectorElemNames = new ArrayList(); @@ -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 Mixer2VectorElemNames = new ArrayList(); @@ -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 Mixer3VectorElemNames = new ArrayList(); @@ -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 Mixer4VectorElemNames = new ArrayList(); @@ -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 Mixer5VectorElemNames = new ArrayList(); @@ -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 Mixer6VectorElemNames = new ArrayList(); @@ -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 Mixer7VectorElemNames = new ArrayList(); @@ -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 Mixer8VectorElemNames = new ArrayList(); @@ -211,6 +299,56 @@ public class MixerSettings extends UAVDataObject { Mixer8VectorElemNames.add("Yaw"); fields.add( new UAVObjectField("Mixer8Vector", "", UAVObjectField.FieldType.INT8, Mixer8VectorElemNames, null) ); + List Mixer9TypeElemNames = new ArrayList(); + Mixer9TypeElemNames.add("0"); + List Mixer9TypeEnumOptions = new ArrayList(); + 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 Mixer9VectorElemNames = new ArrayList(); + 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 Mixer10TypeElemNames = new ArrayList(); + Mixer10TypeElemNames.add("0"); + List Mixer10TypeEnumOptions = new ArrayList(); + 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 Mixer10VectorElemNames = new ArrayList(); + 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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/MixerStatus.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/MixerStatus.java index fbd405b40..106220a8c 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/MixerStatus.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/MixerStatus.java @@ -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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/NedAccel.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/NedAccel.java index f16ddd199..3b09dd1f8 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/NedAccel.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/NedAccel.java @@ -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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/ObjectPersistence.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/ObjectPersistence.java index 2a09c2b40..dccd85d36 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/ObjectPersistence.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/ObjectPersistence.java @@ -51,12 +51,23 @@ public class ObjectPersistence extends UAVDataObject { List fields = new ArrayList(); + List ObjectIDElemNames = new ArrayList(); + ObjectIDElemNames.add("0"); + fields.add( new UAVObjectField("ObjectID", "", UAVObjectField.FieldType.UINT32, ObjectIDElemNames, null) ); + + List InstanceIDElemNames = new ArrayList(); + InstanceIDElemNames.add("0"); + fields.add( new UAVObjectField("InstanceID", "", UAVObjectField.FieldType.UINT32, InstanceIDElemNames, null) ); + List OperationElemNames = new ArrayList(); OperationElemNames.add("0"); List OperationEnumOptions = new ArrayList(); + 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 SelectionElemNames = new ArrayList(); @@ -68,14 +79,6 @@ public class ObjectPersistence extends UAVDataObject { SelectionEnumOptions.add("AllObjects"); fields.add( new UAVObjectField("Selection", "", UAVObjectField.FieldType.ENUM, SelectionElemNames, SelectionEnumOptions) ); - List ObjectIDElemNames = new ArrayList(); - ObjectIDElemNames.add("0"); - fields.add( new UAVObjectField("ObjectID", "", UAVObjectField.FieldType.UINT32, ObjectIDElemNames, null) ); - - List InstanceIDElemNames = new ArrayList(); - 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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/PositionActual.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/PositionActual.java index 444009f90..ac30ad4f5 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/PositionActual.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/PositionActual.java @@ -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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/PositionDesired.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/PositionDesired.java index 5cf51df71..2ff5a5586 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/PositionDesired.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/PositionDesired.java @@ -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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/RateDesired.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/RateDesired.java index 7164c0957..ddeacd8d4 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/RateDesired.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/RateDesired.java @@ -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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/BatterySettings.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/ReceiverActivity.java similarity index 61% rename from androidgcs/src/org/openpilot/uavtalk/uavobjects/BatterySettings.java rename to androidgcs/src/org/openpilot/uavtalk/uavobjects/ReceiverActivity.java index 6af673930..a40b27e38 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/BatterySettings.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/ReceiverActivity.java @@ -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 fields = new ArrayList(); - List BatteryVoltageElemNames = new ArrayList(); - BatteryVoltageElemNames.add("0"); - fields.add( new UAVObjectField("BatteryVoltage", "V", UAVObjectField.FieldType.FLOAT32, BatteryVoltageElemNames, null) ); + List ActiveGroupElemNames = new ArrayList(); + ActiveGroupElemNames.add("0"); + List ActiveGroupEnumOptions = new ArrayList(); + 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 BatteryCapacityElemNames = new ArrayList(); - BatteryCapacityElemNames.add("0"); - fields.add( new UAVObjectField("BatteryCapacity", "mAh", UAVObjectField.FieldType.UINT32, BatteryCapacityElemNames, null) ); - - List BatteryTypeElemNames = new ArrayList(); - BatteryTypeElemNames.add("0"); - List BatteryTypeEnumOptions = new ArrayList(); - 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 CalibrationsElemNames = new ArrayList(); - CalibrationsElemNames.add("Voltage"); - CalibrationsElemNames.add("Current"); - fields.add( new UAVObjectField("Calibrations", "", UAVObjectField.FieldType.FLOAT32, CalibrationsElemNames, null) ); + List ActiveChannelElemNames = new ArrayList(); + 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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/SonarAltitude.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/SonarAltitude.java index 4e9f0b8b8..18cf6f4d6 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/SonarAltitude.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/SonarAltitude.java @@ -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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/StabilizationDesired.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/StabilizationDesired.java index 8cba8a54c..32d2c735c 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/StabilizationDesired.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/StabilizationDesired.java @@ -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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/StabilizationSettings.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/StabilizationSettings.java index 74c480e1c..ab78bdc74 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/StabilizationSettings.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/StabilizationSettings.java @@ -51,18 +51,6 @@ public class StabilizationSettings extends UAVDataObject { List fields = new ArrayList(); - List RollMaxElemNames = new ArrayList(); - RollMaxElemNames.add("0"); - fields.add( new UAVObjectField("RollMax", "degrees", UAVObjectField.FieldType.UINT8, RollMaxElemNames, null) ); - - List PitchMaxElemNames = new ArrayList(); - PitchMaxElemNames.add("0"); - fields.add( new UAVObjectField("PitchMax", "degrees", UAVObjectField.FieldType.UINT8, PitchMaxElemNames, null) ); - - List YawMaxElemNames = new ArrayList(); - YawMaxElemNames.add("0"); - fields.add( new UAVObjectField("YawMax", "degrees", UAVObjectField.FieldType.UINT8, YawMaxElemNames, null) ); - List ManualRateElemNames = new ArrayList(); 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 RollRatePIElemNames = new ArrayList(); - RollRatePIElemNames.add("Kp"); - RollRatePIElemNames.add("Ki"); - RollRatePIElemNames.add("ILimit"); - fields.add( new UAVObjectField("RollRatePI", "", UAVObjectField.FieldType.FLOAT32, RollRatePIElemNames, null) ); + List RollRatePIDElemNames = new ArrayList(); + RollRatePIDElemNames.add("Kp"); + RollRatePIDElemNames.add("Ki"); + RollRatePIDElemNames.add("Kd"); + RollRatePIDElemNames.add("ILimit"); + fields.add( new UAVObjectField("RollRatePID", "", UAVObjectField.FieldType.FLOAT32, RollRatePIDElemNames, null) ); - List PitchRatePIElemNames = new ArrayList(); - PitchRatePIElemNames.add("Kp"); - PitchRatePIElemNames.add("Ki"); - PitchRatePIElemNames.add("ILimit"); - fields.add( new UAVObjectField("PitchRatePI", "", UAVObjectField.FieldType.FLOAT32, PitchRatePIElemNames, null) ); + List PitchRatePIDElemNames = new ArrayList(); + PitchRatePIDElemNames.add("Kp"); + PitchRatePIDElemNames.add("Ki"); + PitchRatePIDElemNames.add("Kd"); + PitchRatePIDElemNames.add("ILimit"); + fields.add( new UAVObjectField("PitchRatePID", "", UAVObjectField.FieldType.FLOAT32, PitchRatePIDElemNames, null) ); - List YawRatePIElemNames = new ArrayList(); - YawRatePIElemNames.add("Kp"); - YawRatePIElemNames.add("Ki"); - YawRatePIElemNames.add("ILimit"); - fields.add( new UAVObjectField("YawRatePI", "", UAVObjectField.FieldType.FLOAT32, YawRatePIElemNames, null) ); + List YawRatePIDElemNames = new ArrayList(); + YawRatePIDElemNames.add("Kp"); + YawRatePIDElemNames.add("Ki"); + YawRatePIDElemNames.add("Kd"); + YawRatePIDElemNames.add("ILimit"); + fields.add( new UAVObjectField("YawRatePID", "", UAVObjectField.FieldType.FLOAT32, YawRatePIDElemNames, null) ); List RollPIElemNames = new ArrayList(); 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 GyroTauElemNames = new ArrayList(); + GyroTauElemNames.add("0"); + fields.add( new UAVObjectField("GyroTau", "", UAVObjectField.FieldType.FLOAT32, GyroTauElemNames, null) ); + + List WeakLevelingKpElemNames = new ArrayList(); + WeakLevelingKpElemNames.add("0"); + fields.add( new UAVObjectField("WeakLevelingKp", "(deg/s)/deg", UAVObjectField.FieldType.FLOAT32, WeakLevelingKpElemNames, null) ); + + List RollMaxElemNames = new ArrayList(); + RollMaxElemNames.add("0"); + fields.add( new UAVObjectField("RollMax", "degrees", UAVObjectField.FieldType.UINT8, RollMaxElemNames, null) ); + + List PitchMaxElemNames = new ArrayList(); + PitchMaxElemNames.add("0"); + fields.add( new UAVObjectField("PitchMax", "degrees", UAVObjectField.FieldType.UINT8, PitchMaxElemNames, null) ); + + List YawMaxElemNames = new ArrayList(); + YawMaxElemNames.add("0"); + fields.add( new UAVObjectField("YawMax", "degrees", UAVObjectField.FieldType.UINT8, YawMaxElemNames, null) ); + + List MaxAxisLockElemNames = new ArrayList(); + MaxAxisLockElemNames.add("0"); + fields.add( new UAVObjectField("MaxAxisLock", "deg", UAVObjectField.FieldType.UINT8, MaxAxisLockElemNames, null) ); + + List MaxAxisLockRateElemNames = new ArrayList(); + MaxAxisLockRateElemNames.add("0"); + fields.add( new UAVObjectField("MaxAxisLockRate", "deg/s", UAVObjectField.FieldType.UINT8, MaxAxisLockRateElemNames, null) ); + + List MaxWeakLevelingRateElemNames = new ArrayList(); + MaxWeakLevelingRateElemNames.add("0"); + fields.add( new UAVObjectField("MaxWeakLevelingRate", "deg/s", UAVObjectField.FieldType.UINT8, MaxWeakLevelingRateElemNames, null) ); + + List LowThrottleZeroIntegralElemNames = new ArrayList(); + LowThrottleZeroIntegralElemNames.add("0"); + List LowThrottleZeroIntegralEnumOptions = new ArrayList(); + 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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/SystemAlarms.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/SystemAlarms.java index e9313472c..458dd9d10 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/SystemAlarms.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/SystemAlarms.java @@ -68,6 +68,7 @@ public class SystemAlarms extends UAVDataObject { AlarmElemNames.add("FlightTime"); AlarmElemNames.add("I2C"); AlarmElemNames.add("GPS"); + AlarmElemNames.add("BootFault"); List AlarmEnumOptions = new ArrayList(); 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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/SystemSettings.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/SystemSettings.java index 99bceb6ba..e3c2cf0b0 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/SystemSettings.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/SystemSettings.java @@ -51,6 +51,11 @@ public class SystemSettings extends UAVDataObject { List fields = new ArrayList(); + List GUIConfigDataElemNames = new ArrayList(); + GUIConfigDataElemNames.add("0"); + GUIConfigDataElemNames.add("1"); + fields.add( new UAVObjectField("GUIConfigData", "bits", UAVObjectField.FieldType.UINT32, GUIConfigDataElemNames, null) ); + List AirframeTypeElemNames = new ArrayList(); AirframeTypeElemNames.add("0"); List AirframeTypeEnumOptions = new ArrayList(); @@ -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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/SystemStats.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/SystemStats.java index 7c34360e9..d1c51d43f 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/SystemStats.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/SystemStats.java @@ -59,6 +59,10 @@ public class SystemStats extends UAVDataObject { HeapRemainingElemNames.add("0"); fields.add( new UAVObjectField("HeapRemaining", "bytes", UAVObjectField.FieldType.UINT16, HeapRemainingElemNames, null) ); + List IRQStackRemainingElemNames = new ArrayList(); + IRQStackRemainingElemNames.add("0"); + fields.add( new UAVObjectField("IRQStackRemaining", "bytes", UAVObjectField.FieldType.UINT16, IRQStackRemainingElemNames, null) ); + List CPULoadElemNames = new ArrayList(); 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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/TaskInfo.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/TaskInfo.java index 3ad065b5c..54825fafe 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/TaskInfo.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/TaskInfo.java @@ -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 RunningElemNames = new ArrayList(); @@ -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 RunningEnumOptions = new ArrayList(); RunningEnumOptions.add("False"); RunningEnumOptions.add("True"); fields.add( new UAVObjectField("Running", "bool", UAVObjectField.FieldType.ENUM, RunningElemNames, RunningEnumOptions) ); + List RunningTimeElemNames = new ArrayList(); + 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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/UAVObjectsInitialize.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/UAVObjectsInitialize.java index d1d47aebb..c2cf64d49 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/UAVObjectsInitialize.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/UAVObjectsInitialize.java @@ -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() ); diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/VelocityActual.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/VelocityActual.java index 649e6c122..97d038cfe 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/VelocityActual.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/VelocityActual.java @@ -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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/VelocityDesired.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/VelocityDesired.java index 27f290898..f39fbd6de 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/VelocityDesired.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/VelocityDesired.java @@ -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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/WatchdogStatus.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/WatchdogStatus.java index 3adcad96b..acbdb43d1 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/WatchdogStatus.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/WatchdogStatus.java @@ -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; diff --git a/ground/uavobjgenerator/generators/java/uavobjectgeneratorjava.cpp b/ground/uavobjgenerator/generators/java/uavobjectgeneratorjava.cpp index e942b238f..dc593fd5f 100644 --- a/ground/uavobjgenerator/generators/java/uavobjectgeneratorjava.cpp +++ b/ground/uavobjgenerator/generators/java/uavobjectgeneratorjava.cpp @@ -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;