diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/AHRSCalibration.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/AHRSCalibration.java deleted file mode 100644 index 47d42991e..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/AHRSCalibration.java +++ /dev/null @@ -1,252 +0,0 @@ -/** - ****************************************************************************** - * - * @file uavobjecttemplate.cpp - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * @brief Template for an uavobject in java - * This is a autogenerated file!! Do not modify and expect a result. - * Contains the calibration settings for the @ref AHRSCommsModule - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -Contains the calibration settings for the @ref AHRSCommsModule - -generated from ahrscalibration.xml - **/ -public class AHRSCalibration extends UAVDataObject { - - public AHRSCalibration() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - 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", 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)/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", UAVObjectField.FieldType.FLOAT32, accel_varElemNames, null) ); - - List gyro_biasElemNames = new ArrayList(); - gyro_biasElemNames.add("X"); - gyro_biasElemNames.add("Y"); - gyro_biasElemNames.add("Z"); - fields.add( new UAVObjectField("gyro_bias", "rad/s", UAVObjectField.FieldType.FLOAT32, gyro_biasElemNames, null) ); - - List gyro_scaleElemNames = new ArrayList(); - gyro_scaleElemNames.add("X"); - gyro_scaleElemNames.add("Y"); - gyro_scaleElemNames.add("Z"); - fields.add( new UAVObjectField("gyro_scale", "(rad/s)/lsb", UAVObjectField.FieldType.FLOAT32, gyro_scaleElemNames, null) ); - - List gyro_varElemNames = new ArrayList(); - gyro_varElemNames.add("X"); - gyro_varElemNames.add("Y"); - gyro_varElemNames.add("Z"); - fields.add( new UAVObjectField("gyro_var", "(rad/s)^2", UAVObjectField.FieldType.FLOAT32, gyro_varElemNames, null) ); - - List gyro_tempcompfactorElemNames = new ArrayList(); - gyro_tempcompfactorElemNames.add("X"); - gyro_tempcompfactorElemNames.add("Y"); - gyro_tempcompfactorElemNames.add("Z"); - fields.add( new UAVObjectField("gyro_tempcompfactor", "raw/raw", UAVObjectField.FieldType.FLOAT32, gyro_tempcompfactorElemNames, null) ); - - List mag_biasElemNames = new ArrayList(); - mag_biasElemNames.add("X"); - mag_biasElemNames.add("Y"); - mag_biasElemNames.add("Z"); - fields.add( new UAVObjectField("mag_bias", "mGau", UAVObjectField.FieldType.FLOAT32, mag_biasElemNames, null) ); - - List mag_scaleElemNames = new ArrayList(); - mag_scaleElemNames.add("X"); - mag_scaleElemNames.add("Y"); - mag_scaleElemNames.add("Z"); - fields.add( new UAVObjectField("mag_scale", "(mGau)/lsb", UAVObjectField.FieldType.FLOAT32, mag_scaleElemNames, null) ); - - List mag_varElemNames = new ArrayList(); - mag_varElemNames.add("X"); - mag_varElemNames.add("Y"); - mag_varElemNames.add("Z"); - fields.add( new UAVObjectField("mag_var", "mGau^2", UAVObjectField.FieldType.FLOAT32, mag_varElemNames, null) ); - - List vel_varElemNames = new ArrayList(); - vel_varElemNames.add("0"); - fields.add( new UAVObjectField("vel_var", "(m/s)^2", UAVObjectField.FieldType.FLOAT32, vel_varElemNames, null) ); - - List pos_varElemNames = new ArrayList(); - 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; - 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("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_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(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); - getField("gyro_var").setValue(0.0001,0); - getField("gyro_var").setValue(0.0001,1); - getField("gyro_var").setValue(0.0001,2); - getField("gyro_tempcompfactor").setValue(0,0); - getField("gyro_tempcompfactor").setValue(0,1); - getField("gyro_tempcompfactor").setValue(0,2); - getField("mag_bias").setValue(0,0); - getField("mag_bias").setValue(0,1); - getField("mag_bias").setValue(0,2); - getField("mag_scale").setValue(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(10); - getField("pos_var").setValue(0.04); - getField("measure_var").setValue("SET"); - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(int instID) { - // TODO: Need to get specific instance to clone - try { - AHRSCalibration obj = new AHRSCalibration(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public AHRSCalibration GetInstance(UAVObjectManager objMngr, int instID) - { - return (AHRSCalibration)(objMngr.getObject(AHRSCalibration.OBJID, instID)); - } - - // Constants - protected static final int OBJID = 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; - 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/AHRSSettings.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/AHRSSettings.java deleted file mode 100644 index 032dae775..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/AHRSSettings.java +++ /dev/null @@ -1,178 +0,0 @@ -/** - ****************************************************************************** - * - * @file uavobjecttemplate.cpp - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * @brief Template for an uavobject in java - * This is a autogenerated file!! Do not modify and expect a result. - * Settings for the @ref AHRSCommsModule to control the algorithm and what is updated - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -Settings for the @ref AHRSCommsModule to control the algorithm and what is updated - -generated from ahrssettings.xml - **/ -public class AHRSSettings extends UAVDataObject { - - public AHRSSettings() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List 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(); - AlgorithmEnumOptions.add("SIMPLE"); - AlgorithmEnumOptions.add("INSGPS_INDOOR_NOMAG"); - AlgorithmEnumOptions.add("INSGPS_INDOOR"); - AlgorithmEnumOptions.add("INSGPS_OUTDOOR"); - fields.add( new UAVObjectField("Algorithm", "", UAVObjectField.FieldType.ENUM, AlgorithmElemNames, AlgorithmEnumOptions) ); - - List DownsamplingElemNames = new ArrayList(); - DownsamplingElemNames.add("0"); - fields.add( new UAVObjectField("Downsampling", "", UAVObjectField.FieldType.UINT8, DownsamplingElemNames, null) ); - - List UpdatePeriodElemNames = new ArrayList(); - UpdatePeriodElemNames.add("0"); - fields.add( new UAVObjectField("UpdatePeriod", "ms", UAVObjectField.FieldType.UINT8, UpdatePeriodElemNames, null) ); - - List BiasCorrectedRawElemNames = new ArrayList(); - BiasCorrectedRawElemNames.add("0"); - List BiasCorrectedRawEnumOptions = new ArrayList(); - BiasCorrectedRawEnumOptions.add("TRUE"); - BiasCorrectedRawEnumOptions.add("FALSE"); - fields.add( new UAVObjectField("BiasCorrectedRaw", "", UAVObjectField.FieldType.ENUM, BiasCorrectedRawElemNames, BiasCorrectedRawEnumOptions) ); - - - // 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("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"); - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(int instID) { - // TODO: Need to get specific instance to clone - try { - AHRSSettings obj = new AHRSSettings(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public AHRSSettings GetInstance(UAVObjectManager objMngr, int instID) - { - return (AHRSSettings)(objMngr.getObject(AHRSSettings.OBJID, instID)); - } - - // Constants - protected static final int OBJID = 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; - 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/AhrsStatus.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/AhrsStatus.java deleted file mode 100644 index 82e447a70..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/AhrsStatus.java +++ /dev/null @@ -1,201 +0,0 @@ -/** - ****************************************************************************** - * - * @file uavobjecttemplate.cpp - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * @brief Template for an uavobject in java - * This is a autogenerated file!! Do not modify and expect a result. - * Status for the @ref AHRSCommsModule, including communication errors - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -Status for the @ref AHRSCommsModule, including communication errors - -generated from ahrsstatus.xml - **/ -public class AhrsStatus extends UAVDataObject { - - public AhrsStatus() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List 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"); - SerialNumberElemNames.add("2"); - SerialNumberElemNames.add("3"); - SerialNumberElemNames.add("4"); - SerialNumberElemNames.add("5"); - SerialNumberElemNames.add("6"); - SerialNumberElemNames.add("7"); - fields.add( new UAVObjectField("SerialNumber", "", UAVObjectField.FieldType.UINT8, SerialNumberElemNames, null) ); - - List CPULoadElemNames = new ArrayList(); - CPULoadElemNames.add("0"); - fields.add( new UAVObjectField("CPULoad", "count", UAVObjectField.FieldType.UINT8, CPULoadElemNames, null) ); - - List IdleTimePerCyleElemNames = new ArrayList(); - IdleTimePerCyleElemNames.add("0"); - fields.add( new UAVObjectField("IdleTimePerCyle", "10x ms", UAVObjectField.FieldType.UINT8, IdleTimePerCyleElemNames, null) ); - - List RunningTimePerCyleElemNames = new ArrayList(); - RunningTimePerCyleElemNames.add("0"); - fields.add( new UAVObjectField("RunningTimePerCyle", "10x ms", UAVObjectField.FieldType.UINT8, RunningTimePerCyleElemNames, null) ); - - List DroppedUpdatesElemNames = new ArrayList(); - DroppedUpdatesElemNames.add("0"); - fields.add( new UAVObjectField("DroppedUpdates", "count", UAVObjectField.FieldType.UINT8, DroppedUpdatesElemNames, null) ); - - List LinkRunningElemNames = new ArrayList(); - LinkRunningElemNames.add("0"); - List LinkRunningEnumOptions = new ArrayList(); - LinkRunningEnumOptions.add("FALSE"); - LinkRunningEnumOptions.add("TRUE"); - fields.add( new UAVObjectField("LinkRunning", "", UAVObjectField.FieldType.ENUM, LinkRunningElemNames, LinkRunningEnumOptions) ); - - List AhrsKickstartsElemNames = new ArrayList(); - AhrsKickstartsElemNames.add("0"); - fields.add( new UAVObjectField("AhrsKickstarts", "count", UAVObjectField.FieldType.UINT8, AhrsKickstartsElemNames, null) ); - - List AhrsCrcErrorsElemNames = new ArrayList(); - AhrsCrcErrorsElemNames.add("0"); - fields.add( new UAVObjectField("AhrsCrcErrors", "count", UAVObjectField.FieldType.UINT8, AhrsCrcErrorsElemNames, null) ); - - List AhrsRetriesElemNames = new ArrayList(); - AhrsRetriesElemNames.add("0"); - fields.add( new UAVObjectField("AhrsRetries", "count", UAVObjectField.FieldType.UINT8, AhrsRetriesElemNames, null) ); - - List AhrsInvalidPacketsElemNames = new ArrayList(); - AhrsInvalidPacketsElemNames.add("0"); - fields.add( new UAVObjectField("AhrsInvalidPackets", "count", UAVObjectField.FieldType.UINT8, AhrsInvalidPacketsElemNames, null) ); - - List OpCrcErrorsElemNames = new ArrayList(); - OpCrcErrorsElemNames.add("0"); - fields.add( new UAVObjectField("OpCrcErrors", "count", UAVObjectField.FieldType.UINT8, OpCrcErrorsElemNames, null) ); - - List OpRetriesElemNames = new ArrayList(); - OpRetriesElemNames.add("0"); - fields.add( new UAVObjectField("OpRetries", "count", UAVObjectField.FieldType.UINT8, OpRetriesElemNames, null) ); - - List OpInvalidPacketsElemNames = new ArrayList(); - OpInvalidPacketsElemNames.add("0"); - fields.add( new UAVObjectField("OpInvalidPackets", "count", UAVObjectField.FieldType.UINT8, OpInvalidPacketsElemNames, null) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE; - metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE; - metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL; - metadata.gcsTelemetryUpdatePeriod = 0; - - metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE; - metadata.flightTelemetryAcked = UAVObject.Acked.FALSE; - metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC; - metadata.flightTelemetryUpdatePeriod = 1000; - - metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC; - metadata.loggingUpdatePeriod = 1000; - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(int instID) { - // TODO: Need to get specific instance to clone - try { - AhrsStatus obj = new AhrsStatus(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public AhrsStatus GetInstance(UAVObjectManager objMngr, int instID) - { - return (AhrsStatus)(objMngr.getObject(AhrsStatus.OBJID, instID)); - } - - // Constants - protected static final int OBJID = 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; - 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/AttitudeRaw.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/AttitudeRaw.java deleted file mode 100644 index b8c3aacb4..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/AttitudeRaw.java +++ /dev/null @@ -1,158 +0,0 @@ -/** - ****************************************************************************** - * - * @file uavobjecttemplate.cpp - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * @brief Template for an uavobject in java - * This is a autogenerated file!! Do not modify and expect a result. - * The raw attitude sensor data from @ref AHRSCommsModule. Not always updated. - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -The raw attitude sensor data from @ref AHRSCommsModule. Not always updated. - -generated from attituderaw.xml - **/ -public class AttitudeRaw extends UAVDataObject { - - public AttitudeRaw() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - 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 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; - 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 { - AttitudeRaw obj = new AttitudeRaw(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public AttitudeRaw GetInstance(UAVObjectManager objMngr, int instID) - { - return (AttitudeRaw)(objMngr.getObject(AttitudeRaw.OBJID, instID)); - } - - // Constants - protected static final int OBJID = 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; - 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/FlightStatus.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightStatus.java index d775b21e7..ac3812aa6 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightStatus.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightStatus.java @@ -66,8 +66,10 @@ public class FlightStatus extends UAVDataObject { FlightModeEnumOptions.add("Stabilized1"); FlightModeEnumOptions.add("Stabilized2"); FlightModeEnumOptions.add("Stabilized3"); + FlightModeEnumOptions.add("AltitudeHold"); FlightModeEnumOptions.add("VelocityControl"); FlightModeEnumOptions.add("PositionHold"); + FlightModeEnumOptions.add("PathPlanner"); fields.add( new UAVObjectField("FlightMode", "", UAVObjectField.FieldType.ENUM, FlightModeElemNames, FlightModeEnumOptions) ); @@ -144,7 +146,7 @@ public class FlightStatus extends UAVDataObject { } // Constants - protected static final int OBJID = 0x743DB13C; + protected static final int OBJID = 0x19B92D8; 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; diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/GuidanceSettings.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/GuidanceSettings.java index 205384efe..5510a901d 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/GuidanceSettings.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/GuidanceSettings.java @@ -55,14 +55,14 @@ public class GuidanceSettings extends UAVDataObject { HorizontalPosPIElemNames.add("Kp"); HorizontalPosPIElemNames.add("Ki"); HorizontalPosPIElemNames.add("ILimit"); - fields.add( new UAVObjectField("HorizontalPosPI", "(cm/s)/cm", UAVObjectField.FieldType.FLOAT32, HorizontalPosPIElemNames, null) ); + fields.add( new UAVObjectField("HorizontalPosPI", "(m/s)/m", 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", "deg/(cm/s)", UAVObjectField.FieldType.FLOAT32, HorizontalVelPIDElemNames, null) ); + fields.add( new UAVObjectField("HorizontalVelPID", "deg/(m/s)", UAVObjectField.FieldType.FLOAT32, HorizontalVelPIDElemNames, null) ); List VerticalPosPIElemNames = new ArrayList(); VerticalPosPIElemNames.add("Kp"); @@ -87,11 +87,11 @@ public class GuidanceSettings extends UAVDataObject { List HorizontalVelMaxElemNames = new ArrayList(); HorizontalVelMaxElemNames.add("0"); - fields.add( new UAVObjectField("HorizontalVelMax", "cm/s", UAVObjectField.FieldType.UINT16, HorizontalVelMaxElemNames, null) ); + fields.add( new UAVObjectField("HorizontalVelMax", "m/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) ); + fields.add( new UAVObjectField("VerticalVelMax", "m/s", UAVObjectField.FieldType.UINT16, VerticalVelMaxElemNames, null) ); List GuidanceModeElemNames = new ArrayList(); GuidanceModeElemNames.add("0"); diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/HomeLocation.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/HomeLocation.java index 68abb3633..3f3b3d8dd 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/HomeLocation.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/HomeLocation.java @@ -63,24 +63,6 @@ public class HomeLocation extends UAVDataObject { AltitudeElemNames.add("0"); fields.add( new UAVObjectField("Altitude", "m over geoid", UAVObjectField.FieldType.FLOAT32, AltitudeElemNames, null) ); - List ECEFElemNames = new ArrayList(); - ECEFElemNames.add("0"); - ECEFElemNames.add("1"); - ECEFElemNames.add("2"); - fields.add( new UAVObjectField("ECEF", "cm", UAVObjectField.FieldType.INT32, ECEFElemNames, null) ); - - List RNEElemNames = new ArrayList(); - RNEElemNames.add("0"); - RNEElemNames.add("1"); - RNEElemNames.add("2"); - RNEElemNames.add("3"); - RNEElemNames.add("4"); - RNEElemNames.add("5"); - RNEElemNames.add("6"); - RNEElemNames.add("7"); - RNEElemNames.add("8"); - fields.add( new UAVObjectField("RNE", "", UAVObjectField.FieldType.FLOAT32, RNEElemNames, null) ); - List BeElemNames = new ArrayList(); BeElemNames.add("0"); BeElemNames.add("1"); @@ -146,18 +128,6 @@ public class HomeLocation extends UAVDataObject { getField("Latitude").setValue(0); getField("Longitude").setValue(0); getField("Altitude").setValue(0); - getField("ECEF").setValue(0,0); - getField("ECEF").setValue(0,1); - getField("ECEF").setValue(0,2); - getField("RNE").setValue(0,0); - getField("RNE").setValue(0,1); - getField("RNE").setValue(0,2); - getField("RNE").setValue(0,3); - getField("RNE").setValue(0,4); - getField("RNE").setValue(0,5); - getField("RNE").setValue(0,6); - getField("RNE").setValue(0,7); - getField("RNE").setValue(0,8); getField("Be").setValue(0,0); getField("Be").setValue(0,1); getField("Be").setValue(0,2); @@ -191,7 +161,7 @@ public class HomeLocation extends UAVDataObject { } // Constants - protected static final int OBJID = 0x5BB3AEFC; + protected static final int OBJID = 0x6185DC6E; 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 index 83b7ae7b6..f56982e69 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/HwSettings.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/HwSettings.java @@ -89,31 +89,70 @@ public class HwSettings extends UAVDataObject { 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 RV_RcvrPortElemNames = new ArrayList(); + RV_RcvrPortElemNames.add("0"); + List RV_RcvrPortEnumOptions = new ArrayList(); + RV_RcvrPortEnumOptions.add("Disabled"); + RV_RcvrPortEnumOptions.add("PWM"); + RV_RcvrPortEnumOptions.add("PPM"); + RV_RcvrPortEnumOptions.add("PPM+Outputs"); + RV_RcvrPortEnumOptions.add("Outputs"); + fields.add( new UAVObjectField("RV_RcvrPort", "function", UAVObjectField.FieldType.ENUM, RV_RcvrPortElemNames, RV_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 RV_AuxPortElemNames = new ArrayList(); + RV_AuxPortElemNames.add("0"); + List RV_AuxPortEnumOptions = new ArrayList(); + RV_AuxPortEnumOptions.add("Disabled"); + RV_AuxPortEnumOptions.add("Telemetry"); + RV_AuxPortEnumOptions.add("DSM2"); + RV_AuxPortEnumOptions.add("DSMX (10bit)"); + RV_AuxPortEnumOptions.add("DSMX (11bit)"); + RV_AuxPortEnumOptions.add("ComAux"); + RV_AuxPortEnumOptions.add("ComBridge"); + fields.add( new UAVObjectField("RV_AuxPort", "function", UAVObjectField.FieldType.ENUM, RV_AuxPortElemNames, RV_AuxPortEnumOptions) ); - 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 RV_AuxSBusPortElemNames = new ArrayList(); + RV_AuxSBusPortElemNames.add("0"); + List RV_AuxSBusPortEnumOptions = new ArrayList(); + RV_AuxSBusPortEnumOptions.add("Disabled"); + RV_AuxSBusPortEnumOptions.add("S.Bus"); + RV_AuxSBusPortEnumOptions.add("DSM2"); + RV_AuxSBusPortEnumOptions.add("DSMX (10bit)"); + RV_AuxSBusPortEnumOptions.add("DSMX (11bit)"); + RV_AuxSBusPortEnumOptions.add("ComAux"); + RV_AuxSBusPortEnumOptions.add("ComBridge"); + fields.add( new UAVObjectField("RV_AuxSBusPort", "function", UAVObjectField.FieldType.ENUM, RV_AuxSBusPortElemNames, RV_AuxSBusPortEnumOptions) ); + + List RV_FlexiPortElemNames = new ArrayList(); + RV_FlexiPortElemNames.add("0"); + List RV_FlexiPortEnumOptions = new ArrayList(); + RV_FlexiPortEnumOptions.add("Disabled"); + RV_FlexiPortEnumOptions.add("I2C"); + RV_FlexiPortEnumOptions.add("DSM2"); + RV_FlexiPortEnumOptions.add("DSMX (10bit)"); + RV_FlexiPortEnumOptions.add("DSMX (11bit)"); + RV_FlexiPortEnumOptions.add("ComAux"); + RV_FlexiPortEnumOptions.add("ComBridge"); + fields.add( new UAVObjectField("RV_FlexiPort", "function", UAVObjectField.FieldType.ENUM, RV_FlexiPortElemNames, RV_FlexiPortEnumOptions) ); + + List RV_TelemetryPortElemNames = new ArrayList(); + RV_TelemetryPortElemNames.add("0"); + List RV_TelemetryPortEnumOptions = new ArrayList(); + RV_TelemetryPortEnumOptions.add("Disabled"); + RV_TelemetryPortEnumOptions.add("Telemetry"); + RV_TelemetryPortEnumOptions.add("ComAux"); + RV_TelemetryPortEnumOptions.add("ComBridge"); + fields.add( new UAVObjectField("RV_TelemetryPort", "function", UAVObjectField.FieldType.ENUM, RV_TelemetryPortElemNames, RV_TelemetryPortEnumOptions) ); + + List RV_GPSPortElemNames = new ArrayList(); + RV_GPSPortElemNames.add("0"); + List RV_GPSPortEnumOptions = new ArrayList(); + RV_GPSPortEnumOptions.add("Disabled"); + RV_GPSPortEnumOptions.add("Telemetry"); + RV_GPSPortEnumOptions.add("GPS"); + RV_GPSPortEnumOptions.add("ComAux"); + RV_GPSPortEnumOptions.add("ComBridge"); + fields.add( new UAVObjectField("RV_GPSPort", "function", UAVObjectField.FieldType.ENUM, RV_GPSPortElemNames, RV_GPSPortEnumOptions) ); List TelemetrySpeedElemNames = new ArrayList(); TelemetrySpeedElemNames.add("0"); @@ -180,6 +219,7 @@ public class HwSettings extends UAVDataObject { OptionalModulesElemNames.add("ComUsbBridge"); OptionalModulesElemNames.add("Fault"); OptionalModulesElemNames.add("Altitude"); + OptionalModulesElemNames.add("TxPID"); List OptionalModulesEnumOptions = new ArrayList(); OptionalModulesEnumOptions.add("Disabled"); OptionalModulesEnumOptions.add("Enabled"); @@ -237,9 +277,12 @@ public class HwSettings extends UAVDataObject { 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("RV_RcvrPort").setValue("PWM"); + getField("RV_AuxPort").setValue("Disabled"); + getField("RV_AuxSBusPort").setValue("Disabled"); + getField("RV_FlexiPort").setValue("Disabled"); + getField("RV_TelemetryPort").setValue("Telemetry"); + getField("RV_GPSPort").setValue("GPS"); getField("TelemetrySpeed").setValue("57600"); getField("GPSSpeed").setValue("57600"); getField("ComUsbBridgeSpeed").setValue("57600"); @@ -251,6 +294,7 @@ public class HwSettings extends UAVDataObject { getField("OptionalModules").setValue("Disabled",2); getField("OptionalModules").setValue("Disabled",3); getField("OptionalModules").setValue("Disabled",4); + getField("OptionalModules").setValue("Disabled",5); getField("DSMxBind").setValue(0); } @@ -280,7 +324,7 @@ public class HwSettings extends UAVDataObject { } // Constants - protected static final int OBJID = 0x2EE6575A; + protected static final int OBJID = 0x4730375C; protected static final String NAME = "HwSettings"; protected static String DESCRIPTION = "Selection of optional hardware configurations."; 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 bb846695d..c8f460bc4 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/ManualControlSettings.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/ManualControlSettings.java @@ -181,8 +181,10 @@ public class ManualControlSettings extends UAVDataObject { FlightModePositionEnumOptions.add("Stabilized1"); FlightModePositionEnumOptions.add("Stabilized2"); FlightModePositionEnumOptions.add("Stabilized3"); + FlightModePositionEnumOptions.add("AltitudeHold"); FlightModePositionEnumOptions.add("VelocityControl"); FlightModePositionEnumOptions.add("PositionHold"); + FlightModePositionEnumOptions.add("PathPlanner"); fields.add( new UAVObjectField("FlightModePosition", "", UAVObjectField.FieldType.ENUM, FlightModePositionElemNames, FlightModePositionEnumOptions) ); @@ -317,7 +319,7 @@ public class ManualControlSettings extends UAVDataObject { } // Constants - protected static final int OBJID = 0x24959BB0; + protected static final int OBJID = 0x59C4551C; 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/MixerStatus.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/MixerStatus.java index 106220a8c..80e3b15bf 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/MixerStatus.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/MixerStatus.java @@ -83,6 +83,14 @@ public class MixerStatus extends UAVDataObject { Mixer8ElemNames.add("0"); fields.add( new UAVObjectField("Mixer8", "", UAVObjectField.FieldType.FLOAT32, Mixer8ElemNames, null) ); + List Mixer9ElemNames = new ArrayList(); + Mixer9ElemNames.add("0"); + fields.add( new UAVObjectField("Mixer9", "", UAVObjectField.FieldType.FLOAT32, Mixer9ElemNames, null) ); + + List Mixer10ElemNames = new ArrayList(); + Mixer10ElemNames.add("0"); + fields.add( new UAVObjectField("Mixer10", "", UAVObjectField.FieldType.FLOAT32, Mixer10ElemNames, null) ); + // Compute the number of bytes for this object int numBytes = 0; @@ -156,7 +164,7 @@ public class MixerStatus extends UAVDataObject { } // Constants - protected static final int OBJID = 0x11CFB4E6; + protected static final int OBJID = 0x124E28A; 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 3b09dd1f8..1629a19d2 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/NedAccel.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/NedAccel.java @@ -53,15 +53,15 @@ public class NedAccel extends UAVDataObject { List NorthElemNames = new ArrayList(); NorthElemNames.add("0"); - fields.add( new UAVObjectField("North", "cm/s^2", UAVObjectField.FieldType.FLOAT32, NorthElemNames, null) ); + fields.add( new UAVObjectField("North", "m/s^2", UAVObjectField.FieldType.FLOAT32, NorthElemNames, null) ); List EastElemNames = new ArrayList(); EastElemNames.add("0"); - fields.add( new UAVObjectField("East", "cm/s^2", UAVObjectField.FieldType.FLOAT32, EastElemNames, null) ); + fields.add( new UAVObjectField("East", "m/s^2", UAVObjectField.FieldType.FLOAT32, EastElemNames, null) ); List DownElemNames = new ArrayList(); DownElemNames.add("0"); - fields.add( new UAVObjectField("Down", "cm/s^2", UAVObjectField.FieldType.FLOAT32, DownElemNames, null) ); + fields.add( new UAVObjectField("Down", "m/s^2", UAVObjectField.FieldType.FLOAT32, DownElemNames, null) ); // Compute the number of bytes for this object diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/PositionActual.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/PositionActual.java index ac30ad4f5..184098a16 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/PositionActual.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/PositionActual.java @@ -53,15 +53,15 @@ public class PositionActual extends UAVDataObject { List NorthElemNames = new ArrayList(); NorthElemNames.add("0"); - fields.add( new UAVObjectField("North", "cm", UAVObjectField.FieldType.INT32, NorthElemNames, null) ); + fields.add( new UAVObjectField("North", "m", UAVObjectField.FieldType.FLOAT32, NorthElemNames, null) ); List EastElemNames = new ArrayList(); EastElemNames.add("0"); - fields.add( new UAVObjectField("East", "cm", UAVObjectField.FieldType.INT32, EastElemNames, null) ); + fields.add( new UAVObjectField("East", "m", UAVObjectField.FieldType.FLOAT32, EastElemNames, null) ); List DownElemNames = new ArrayList(); DownElemNames.add("0"); - fields.add( new UAVObjectField("Down", "cm", UAVObjectField.FieldType.INT32, DownElemNames, null) ); + fields.add( new UAVObjectField("Down", "m", UAVObjectField.FieldType.FLOAT32, DownElemNames, null) ); // Compute the number of bytes for this object @@ -136,7 +136,7 @@ public class PositionActual extends UAVDataObject { } // Constants - protected static final int OBJID = 0xF9691DA4; + protected static final int OBJID = 0xFA9E2D42; 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 2ff5a5586..123ca58af 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/PositionDesired.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/PositionDesired.java @@ -53,15 +53,15 @@ public class PositionDesired extends UAVDataObject { List NorthElemNames = new ArrayList(); NorthElemNames.add("0"); - fields.add( new UAVObjectField("North", "cm", UAVObjectField.FieldType.INT32, NorthElemNames, null) ); + fields.add( new UAVObjectField("North", "m", UAVObjectField.FieldType.FLOAT32, NorthElemNames, null) ); List EastElemNames = new ArrayList(); EastElemNames.add("0"); - fields.add( new UAVObjectField("East", "cm", UAVObjectField.FieldType.INT32, EastElemNames, null) ); + fields.add( new UAVObjectField("East", "m", UAVObjectField.FieldType.FLOAT32, EastElemNames, null) ); List DownElemNames = new ArrayList(); DownElemNames.add("0"); - fields.add( new UAVObjectField("Down", "cm", UAVObjectField.FieldType.INT32, DownElemNames, null) ); + fields.add( new UAVObjectField("Down", "m", UAVObjectField.FieldType.FLOAT32, DownElemNames, null) ); // Compute the number of bytes for this object @@ -136,7 +136,7 @@ public class PositionDesired extends UAVDataObject { } // Constants - protected static final int OBJID = 0x33C9EAB4; + protected static final int OBJID = 0x778DBE24; 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/SystemAlarms.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/SystemAlarms.java index 458dd9d10..bc4bf0625 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/SystemAlarms.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/SystemAlarms.java @@ -61,6 +61,7 @@ public class SystemAlarms extends UAVDataObject { AlarmElemNames.add("ManualControl"); AlarmElemNames.add("Actuator"); AlarmElemNames.add("Attitude"); + AlarmElemNames.add("Sensors"); AlarmElemNames.add("Stabilization"); AlarmElemNames.add("Guidance"); AlarmElemNames.add("AHRSComms"); @@ -139,6 +140,7 @@ public class SystemAlarms extends UAVDataObject { getField("Alarm").setValue("Uninitialised",14); getField("Alarm").setValue("Uninitialised",15); getField("Alarm").setValue("Uninitialised",16); + getField("Alarm").setValue("Uninitialised",17); } @@ -167,7 +169,7 @@ public class SystemAlarms extends UAVDataObject { } // Constants - protected static final int OBJID = 0x737ADCF2; + protected static final int OBJID = 0x9C7CBFE; 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/SystemStats.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/SystemStats.java index d1c51d43f..26d01f2a0 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/SystemStats.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/SystemStats.java @@ -55,6 +55,18 @@ public class SystemStats extends UAVDataObject { FlightTimeElemNames.add("0"); fields.add( new UAVObjectField("FlightTime", "ms", UAVObjectField.FieldType.UINT32, FlightTimeElemNames, null) ); + List EventSystemWarningIDElemNames = new ArrayList(); + EventSystemWarningIDElemNames.add("0"); + fields.add( new UAVObjectField("EventSystemWarningID", "uavoid", UAVObjectField.FieldType.UINT32, EventSystemWarningIDElemNames, null) ); + + List ObjectManagerCallbackIDElemNames = new ArrayList(); + ObjectManagerCallbackIDElemNames.add("0"); + fields.add( new UAVObjectField("ObjectManagerCallbackID", "uavoid", UAVObjectField.FieldType.UINT32, ObjectManagerCallbackIDElemNames, null) ); + + List ObjectManagerQueueIDElemNames = new ArrayList(); + ObjectManagerQueueIDElemNames.add("0"); + fields.add( new UAVObjectField("ObjectManagerQueueID", "uavoid", UAVObjectField.FieldType.UINT32, ObjectManagerQueueIDElemNames, null) ); + List HeapRemainingElemNames = new ArrayList(); HeapRemainingElemNames.add("0"); fields.add( new UAVObjectField("HeapRemaining", "bytes", UAVObjectField.FieldType.UINT16, HeapRemainingElemNames, null) ); @@ -144,7 +156,7 @@ public class SystemStats extends UAVDataObject { } // Constants - protected static final int OBJID = 0xD610A0F0; + protected static final int OBJID = 0x364D1406; 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 54825fafe..eefcef6d9 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/TaskInfo.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/TaskInfo.java @@ -55,36 +55,42 @@ public class TaskInfo extends UAVDataObject { StackRemainingElemNames.add("System"); StackRemainingElemNames.add("Actuator"); StackRemainingElemNames.add("Attitude"); + StackRemainingElemNames.add("Sensors"); StackRemainingElemNames.add("TelemetryTx"); StackRemainingElemNames.add("TelemetryTxPri"); StackRemainingElemNames.add("TelemetryRx"); StackRemainingElemNames.add("GPS"); StackRemainingElemNames.add("ManualControl"); StackRemainingElemNames.add("Altitude"); - StackRemainingElemNames.add("AHRSComms"); StackRemainingElemNames.add("Stabilization"); + StackRemainingElemNames.add("AltitudeHold"); StackRemainingElemNames.add("Guidance"); StackRemainingElemNames.add("FlightPlan"); + StackRemainingElemNames.add("PathPlanner"); StackRemainingElemNames.add("Com2UsbBridge"); StackRemainingElemNames.add("Usb2ComBridge"); + StackRemainingElemNames.add("OveroSync"); fields.add( new UAVObjectField("StackRemaining", "bytes", UAVObjectField.FieldType.UINT16, StackRemainingElemNames, null) ); List RunningElemNames = new ArrayList(); RunningElemNames.add("System"); RunningElemNames.add("Actuator"); RunningElemNames.add("Attitude"); + RunningElemNames.add("Sensors"); RunningElemNames.add("TelemetryTx"); RunningElemNames.add("TelemetryTxPri"); RunningElemNames.add("TelemetryRx"); RunningElemNames.add("GPS"); RunningElemNames.add("ManualControl"); RunningElemNames.add("Altitude"); - RunningElemNames.add("AHRSComms"); RunningElemNames.add("Stabilization"); + RunningElemNames.add("AltitudeHold"); RunningElemNames.add("Guidance"); RunningElemNames.add("FlightPlan"); + RunningElemNames.add("PathPlanner"); RunningElemNames.add("Com2UsbBridge"); RunningElemNames.add("Usb2ComBridge"); + RunningElemNames.add("OveroSync"); List RunningEnumOptions = new ArrayList(); RunningEnumOptions.add("False"); RunningEnumOptions.add("True"); @@ -94,18 +100,21 @@ public class TaskInfo extends UAVDataObject { RunningTimeElemNames.add("System"); RunningTimeElemNames.add("Actuator"); RunningTimeElemNames.add("Attitude"); + RunningTimeElemNames.add("Sensors"); 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("AltitudeHold"); RunningTimeElemNames.add("Guidance"); RunningTimeElemNames.add("FlightPlan"); + RunningTimeElemNames.add("PathPlanner"); RunningTimeElemNames.add("Com2UsbBridge"); RunningTimeElemNames.add("Usb2ComBridge"); + RunningTimeElemNames.add("OveroSync"); fields.add( new UAVObjectField("RunningTime", "%", UAVObjectField.FieldType.UINT8, RunningTimeElemNames, null) ); @@ -181,7 +190,7 @@ public class TaskInfo extends UAVDataObject { } // Constants - protected static final int OBJID = 0xE34A7C32; + protected static final int OBJID = 0x498F54BA; 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 c2cf64d49..823643130 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/UAVObjectsInitialize.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/UAVObjectsInitialize.java @@ -35,15 +35,15 @@ public class UAVObjectsInitialize { public static void register(UAVObjectManager objMngr) { try { + objMngr.registerObject( new Accels() ); objMngr.registerObject( new AccessoryDesired() ); objMngr.registerObject( new ActuatorCommand() ); objMngr.registerObject( new ActuatorDesired() ); objMngr.registerObject( new ActuatorSettings() ); - objMngr.registerObject( new AHRSCalibration() ); - objMngr.registerObject( new AHRSSettings() ); - objMngr.registerObject( new AhrsStatus() ); + objMngr.registerObject( new AltHoldSmoothed() ); + objMngr.registerObject( new AltitudeHoldDesired() ); + objMngr.registerObject( new AltitudeHoldSettings() ); objMngr.registerObject( new AttitudeActual() ); - objMngr.registerObject( new AttitudeRaw() ); objMngr.registerObject( new AttitudeSettings() ); objMngr.registerObject( new BaroAltitude() ); objMngr.registerObject( new CameraDesired() ); @@ -62,16 +62,23 @@ public class UAVObjectsInitialize { objMngr.registerObject( new GPSPosition() ); objMngr.registerObject( new GPSSatellites() ); objMngr.registerObject( new GPSTime() ); + objMngr.registerObject( new GPSVelocity() ); + objMngr.registerObject( new Gyros() ); + objMngr.registerObject( new GyrosBias() ); objMngr.registerObject( new GuidanceSettings() ); objMngr.registerObject( new HomeLocation() ); objMngr.registerObject( new HwSettings() ); objMngr.registerObject( new I2CStats() ); + objMngr.registerObject( new GPSPosition() ); + objMngr.registerObject( new Magnetometer() ); objMngr.registerObject( new ManualControlCommand() ); objMngr.registerObject( new ManualControlSettings() ); objMngr.registerObject( new MixerSettings() ); objMngr.registerObject( new MixerStatus() ); + objMngr.registerObject( new NEDPosition() ); objMngr.registerObject( new NedAccel() ); objMngr.registerObject( new ObjectPersistence() ); + objMngr.registerObject( new PathDesired() ); objMngr.registerObject( new PositionActual() ); objMngr.registerObject( new PositionDesired() ); objMngr.registerObject( new RateDesired() ); @@ -82,10 +89,13 @@ public class UAVObjectsInitialize { objMngr.registerObject( new SystemAlarms() ); objMngr.registerObject( new SystemSettings() ); objMngr.registerObject( new SystemStats() ); + objMngr.registerObject( new TxPIDSettings() ); objMngr.registerObject( new TaskInfo() ); objMngr.registerObject( new VelocityActual() ); objMngr.registerObject( new VelocityDesired() ); objMngr.registerObject( new WatchdogStatus() ); + objMngr.registerObject( new Waypoint() ); + objMngr.registerObject( new WaypointActive() ); } catch (Exception e) { e.printStackTrace(); diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/VelocityActual.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/VelocityActual.java index 97d038cfe..2a8cd3754 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/VelocityActual.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/VelocityActual.java @@ -53,15 +53,15 @@ public class VelocityActual extends UAVDataObject { List NorthElemNames = new ArrayList(); NorthElemNames.add("0"); - fields.add( new UAVObjectField("North", "cm/s", UAVObjectField.FieldType.INT32, NorthElemNames, null) ); + fields.add( new UAVObjectField("North", "m/s", UAVObjectField.FieldType.FLOAT32, NorthElemNames, null) ); List EastElemNames = new ArrayList(); EastElemNames.add("0"); - fields.add( new UAVObjectField("East", "cm/s", UAVObjectField.FieldType.INT32, EastElemNames, null) ); + fields.add( new UAVObjectField("East", "m/s", UAVObjectField.FieldType.FLOAT32, EastElemNames, null) ); List DownElemNames = new ArrayList(); DownElemNames.add("0"); - fields.add( new UAVObjectField("Down", "cm/s", UAVObjectField.FieldType.INT32, DownElemNames, null) ); + fields.add( new UAVObjectField("Down", "m/s", UAVObjectField.FieldType.FLOAT32, DownElemNames, null) ); // Compute the number of bytes for this object @@ -136,7 +136,7 @@ public class VelocityActual extends UAVDataObject { } // Constants - protected static final int OBJID = 0x43007EB0; + protected static final int OBJID = 0x5A08F61A; 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 f39fbd6de..436ef6448 100644 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/VelocityDesired.java +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/VelocityDesired.java @@ -53,15 +53,15 @@ public class VelocityDesired extends UAVDataObject { List NorthElemNames = new ArrayList(); NorthElemNames.add("0"); - fields.add( new UAVObjectField("North", "cm/s", UAVObjectField.FieldType.INT32, NorthElemNames, null) ); + fields.add( new UAVObjectField("North", "m/s", UAVObjectField.FieldType.FLOAT32, NorthElemNames, null) ); List EastElemNames = new ArrayList(); EastElemNames.add("0"); - fields.add( new UAVObjectField("East", "cm/s", UAVObjectField.FieldType.INT32, EastElemNames, null) ); + fields.add( new UAVObjectField("East", "m/s", UAVObjectField.FieldType.FLOAT32, EastElemNames, null) ); List DownElemNames = new ArrayList(); DownElemNames.add("0"); - fields.add( new UAVObjectField("Down", "cm/s", UAVObjectField.FieldType.INT32, DownElemNames, null) ); + fields.add( new UAVObjectField("Down", "m/s", UAVObjectField.FieldType.FLOAT32, DownElemNames, null) ); // Compute the number of bytes for this object @@ -136,7 +136,7 @@ public class VelocityDesired extends UAVDataObject { } // Constants - protected static final int OBJID = 0x25139D1A; + protected static final int OBJID = 0x9E946992; 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;