1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-30 08:24:11 +01:00

Update the UAVO files

This commit is contained in:
James Cotton 2012-08-04 01:35:49 -05:00
parent cfb9f1277e
commit 851923e8b9
27 changed files with 4761 additions and 0 deletions

View File

@ -0,0 +1,150 @@
/**
******************************************************************************
*
* @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 accel data.
*
* @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 accel data.
generated from accels.xml
**/
public class Accels extends UAVDataObject {
public Accels() {
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> xElemNames = new ArrayList<String>();
xElemNames.add("0");
fields.add( new UAVObjectField("x", "m/s^2", UAVObjectField.FieldType.FLOAT32, xElemNames, null) );
List<String> yElemNames = new ArrayList<String>();
yElemNames.add("0");
fields.add( new UAVObjectField("y", "m/s^2", UAVObjectField.FieldType.FLOAT32, yElemNames, null) );
List<String> zElemNames = new ArrayList<String>();
zElemNames.add("0");
fields.add( new UAVObjectField("z", "m/s^2", UAVObjectField.FieldType.FLOAT32, zElemNames, null) );
List<String> temperatureElemNames = new ArrayList<String>();
temperatureElemNames.add("0");
fields.add( new UAVObjectField("temperature", "deg C", UAVObjectField.FieldType.FLOAT32, temperatureElemNames, null) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.gcsTelemetryUpdatePeriod = 0;
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 {
Accels obj = new Accels();
obj.initialize(instID, this.getMetaObject());
return obj;
} catch (Exception e) {
return null;
}
}
/**
* Static function to retrieve an instance of the object.
*/
public Accels GetInstance(UAVObjectManager objMngr, int instID)
{
return (Accels)(objMngr.getObject(Accels.OBJID, instID));
}
// Constants
protected static final int OBJID = 0xDD9D5FC0;
protected static final String NAME = "Accels";
protected static String DESCRIPTION = "The accel data.";
protected static final boolean ISSINGLEINST = 1 == 1;
protected static final boolean ISSETTINGS = 0 == 1;
protected static int NUMBYTES = 0;
}

View File

@ -0,0 +1,146 @@
/**
******************************************************************************
*
* @file uavobjecttemplate.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Template for an uavobject in java
* This is a autogenerated file!! Do not modify and expect a result.
* The output on the kalman filter on altitude.
*
* @see The GNU Public License (GPL) Version 3
*
*****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.openpilot.uavtalk.uavobjects;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;
import org.openpilot.uavtalk.UAVObjectManager;
import org.openpilot.uavtalk.UAVObject;
import org.openpilot.uavtalk.UAVDataObject;
import org.openpilot.uavtalk.UAVObjectField;
/**
The output on the kalman filter on altitude.
generated from altholdsmoothed.xml
**/
public class AltHoldSmoothed extends UAVDataObject {
public AltHoldSmoothed() {
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> AltitudeElemNames = new ArrayList<String>();
AltitudeElemNames.add("0");
fields.add( new UAVObjectField("Altitude", "m", UAVObjectField.FieldType.FLOAT32, AltitudeElemNames, null) );
List<String> VelocityElemNames = new ArrayList<String>();
VelocityElemNames.add("0");
fields.add( new UAVObjectField("Velocity", "m/s", UAVObjectField.FieldType.FLOAT32, VelocityElemNames, null) );
List<String> AccelElemNames = new ArrayList<String>();
AccelElemNames.add("0");
fields.add( new UAVObjectField("Accel", "m/s^2", UAVObjectField.FieldType.FLOAT32, AccelElemNames, null) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.gcsTelemetryUpdatePeriod = 0;
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 {
AltHoldSmoothed obj = new AltHoldSmoothed();
obj.initialize(instID, this.getMetaObject());
return obj;
} catch (Exception e) {
return null;
}
}
/**
* Static function to retrieve an instance of the object.
*/
public AltHoldSmoothed GetInstance(UAVObjectManager objMngr, int instID)
{
return (AltHoldSmoothed)(objMngr.getObject(AltHoldSmoothed.OBJID, instID));
}
// Constants
protected static final int OBJID = 0x2BC6B9D2;
protected static final String NAME = "AltHoldSmoothed";
protected static String DESCRIPTION = "The output on the kalman filter on altitude.";
protected static final boolean ISSINGLEINST = 1 == 1;
protected static final boolean ISSETTINGS = 0 == 1;
protected static int NUMBYTES = 0;
}

View File

@ -0,0 +1,150 @@
/**
******************************************************************************
*
* @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.
* Holds the desired altitude (from manual control) as well as the desired attitude to pass through
*
* @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;
/**
Holds the desired altitude (from manual control) as well as the desired attitude to pass through
generated from altitudeholddesired.xml
**/
public class AltitudeHoldDesired extends UAVDataObject {
public AltitudeHoldDesired() {
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> AltitudeElemNames = new ArrayList<String>();
AltitudeElemNames.add("0");
fields.add( new UAVObjectField("Altitude", "m", UAVObjectField.FieldType.FLOAT32, AltitudeElemNames, null) );
List<String> RollElemNames = new ArrayList<String>();
RollElemNames.add("0");
fields.add( new UAVObjectField("Roll", "deg", UAVObjectField.FieldType.FLOAT32, RollElemNames, null) );
List<String> PitchElemNames = new ArrayList<String>();
PitchElemNames.add("0");
fields.add( new UAVObjectField("Pitch", "deg", UAVObjectField.FieldType.FLOAT32, PitchElemNames, null) );
List<String> YawElemNames = new ArrayList<String>();
YawElemNames.add("0");
fields.add( new UAVObjectField("Yaw", "deg/s", UAVObjectField.FieldType.FLOAT32, YawElemNames, null) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.gcsTelemetryUpdatePeriod = 0;
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 {
AltitudeHoldDesired obj = new AltitudeHoldDesired();
obj.initialize(instID, this.getMetaObject());
return obj;
} catch (Exception e) {
return null;
}
}
/**
* Static function to retrieve an instance of the object.
*/
public AltitudeHoldDesired GetInstance(UAVObjectManager objMngr, int instID)
{
return (AltitudeHoldDesired)(objMngr.getObject(AltitudeHoldDesired.OBJID, instID));
}
// Constants
protected static final int OBJID = 0x495BAD6E;
protected static final String NAME = "AltitudeHoldDesired";
protected static String DESCRIPTION = "Holds the desired altitude (from manual control) as well as the desired attitude to pass through";
protected static final boolean ISSINGLEINST = 1 == 1;
protected static final boolean ISSETTINGS = 0 == 1;
protected static int NUMBYTES = 0;
}

View File

@ -0,0 +1,169 @@
/**
******************************************************************************
*
* @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 AltitudeHold 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;
/**
Settings for the @ref AltitudeHold module
generated from altitudeholdsettings.xml
**/
public class AltitudeHoldSettings extends UAVDataObject {
public AltitudeHoldSettings() {
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> KpElemNames = new ArrayList<String>();
KpElemNames.add("0");
fields.add( new UAVObjectField("Kp", "throttle/m", UAVObjectField.FieldType.FLOAT32, KpElemNames, null) );
List<String> KiElemNames = new ArrayList<String>();
KiElemNames.add("0");
fields.add( new UAVObjectField("Ki", "throttle/m", UAVObjectField.FieldType.FLOAT32, KiElemNames, null) );
List<String> KdElemNames = new ArrayList<String>();
KdElemNames.add("0");
fields.add( new UAVObjectField("Kd", "throttle/m", UAVObjectField.FieldType.FLOAT32, KdElemNames, null) );
List<String> KaElemNames = new ArrayList<String>();
KaElemNames.add("0");
fields.add( new UAVObjectField("Ka", "throttle/(m/s^2)", UAVObjectField.FieldType.FLOAT32, KaElemNames, null) );
List<String> PressureNoiseElemNames = new ArrayList<String>();
PressureNoiseElemNames.add("0");
fields.add( new UAVObjectField("PressureNoise", "m", UAVObjectField.FieldType.FLOAT32, PressureNoiseElemNames, null) );
List<String> AccelNoiseElemNames = new ArrayList<String>();
AccelNoiseElemNames.add("0");
fields.add( new UAVObjectField("AccelNoise", "m/s^2", UAVObjectField.FieldType.FLOAT32, AccelNoiseElemNames, null) );
List<String> AccelDriftElemNames = new ArrayList<String>();
AccelDriftElemNames.add("0");
fields.add( new UAVObjectField("AccelDrift", "m/s^2", UAVObjectField.FieldType.FLOAT32, AccelDriftElemNames, null) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.gcsTelemetryUpdatePeriod = 0;
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("Kp").setValue(0.03);
getField("Ki").setValue(0);
getField("Kd").setValue(0.03);
getField("Ka").setValue(0.005);
getField("PressureNoise").setValue(0.4);
getField("AccelNoise").setValue(5);
getField("AccelDrift").setValue(0.001);
}
/**
* 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 {
AltitudeHoldSettings obj = new AltitudeHoldSettings();
obj.initialize(instID, this.getMetaObject());
return obj;
} catch (Exception e) {
return null;
}
}
/**
* Static function to retrieve an instance of the object.
*/
public AltitudeHoldSettings GetInstance(UAVObjectManager objMngr, int instID)
{
return (AltitudeHoldSettings)(objMngr.getObject(AltitudeHoldSettings.OBJID, instID));
}
// Constants
protected static final int OBJID = 0xFEC55B42;
protected static final String NAME = "AltitudeHoldSettings";
protected static String DESCRIPTION = "Settings for the @ref AltitudeHold module";
protected static final boolean ISSINGLEINST = 1 == 1;
protected static final boolean ISSETTINGS = 1 == 1;
protected static int NUMBYTES = 0;
}

View File

@ -0,0 +1,174 @@
/**
******************************************************************************
*
* @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 simulated Attitude estimation from @ref Sensors.
*
* @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 simulated Attitude estimation from @ref Sensors.
generated from attitudesimulated.xml
**/
public class AttitudeSimulated extends UAVDataObject {
public AttitudeSimulated() {
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> q1ElemNames = new ArrayList<String>();
q1ElemNames.add("0");
fields.add( new UAVObjectField("q1", "", UAVObjectField.FieldType.FLOAT32, q1ElemNames, null) );
List<String> q2ElemNames = new ArrayList<String>();
q2ElemNames.add("0");
fields.add( new UAVObjectField("q2", "", UAVObjectField.FieldType.FLOAT32, q2ElemNames, null) );
List<String> q3ElemNames = new ArrayList<String>();
q3ElemNames.add("0");
fields.add( new UAVObjectField("q3", "", UAVObjectField.FieldType.FLOAT32, q3ElemNames, null) );
List<String> q4ElemNames = new ArrayList<String>();
q4ElemNames.add("0");
fields.add( new UAVObjectField("q4", "", UAVObjectField.FieldType.FLOAT32, q4ElemNames, null) );
List<String> RollElemNames = new ArrayList<String>();
RollElemNames.add("0");
fields.add( new UAVObjectField("Roll", "degrees", UAVObjectField.FieldType.FLOAT32, RollElemNames, null) );
List<String> PitchElemNames = new ArrayList<String>();
PitchElemNames.add("0");
fields.add( new UAVObjectField("Pitch", "degrees", UAVObjectField.FieldType.FLOAT32, PitchElemNames, null) );
List<String> YawElemNames = new ArrayList<String>();
YawElemNames.add("0");
fields.add( new UAVObjectField("Yaw", "degrees", UAVObjectField.FieldType.FLOAT32, YawElemNames, null) );
List<String> VelocityElemNames = new ArrayList<String>();
VelocityElemNames.add("North");
VelocityElemNames.add("East");
VelocityElemNames.add("Down");
fields.add( new UAVObjectField("Velocity", "m/s", UAVObjectField.FieldType.FLOAT32, VelocityElemNames, null) );
List<String> PositionElemNames = new ArrayList<String>();
PositionElemNames.add("North");
PositionElemNames.add("East");
PositionElemNames.add("Down");
fields.add( new UAVObjectField("Position", "m", UAVObjectField.FieldType.FLOAT32, PositionElemNames, null) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 100;
metadata.gcsTelemetryUpdatePeriod = 0;
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 {
AttitudeSimulated obj = new AttitudeSimulated();
obj.initialize(instID, this.getMetaObject());
return obj;
} catch (Exception e) {
return null;
}
}
/**
* Static function to retrieve an instance of the object.
*/
public AttitudeSimulated GetInstance(UAVObjectManager objMngr, int instID)
{
return (AttitudeSimulated)(objMngr.getObject(AttitudeSimulated.OBJID, instID));
}
// Constants
protected static final int OBJID = 0x9266CE74;
protected static final String NAME = "AttitudeSimulated";
protected static String DESCRIPTION = "The simulated Attitude estimation from @ref Sensors.";
protected static final boolean ISSINGLEINST = 1 == 1;
protected static final boolean ISSETTINGS = 0 == 1;
protected static int NUMBYTES = 0;
}

View File

@ -0,0 +1,153 @@
/**
******************************************************************************
*
* @file uavobjecttemplate.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Template for an uavobject in java
* This is a autogenerated file!! Do not modify and expect a result.
* The raw data from the dynamic pressure sensor with pressure, temperature and airspeed.
*
* @see The GNU Public License (GPL) Version 3
*
*****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.openpilot.uavtalk.uavobjects;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;
import org.openpilot.uavtalk.UAVObjectManager;
import org.openpilot.uavtalk.UAVObject;
import org.openpilot.uavtalk.UAVDataObject;
import org.openpilot.uavtalk.UAVObjectField;
/**
The raw data from the dynamic pressure sensor with pressure, temperature and airspeed.
generated from baroairspeed.xml
**/
public class BaroAirspeed extends UAVDataObject {
public BaroAirspeed() {
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> AirspeedElemNames = new ArrayList<String>();
AirspeedElemNames.add("0");
fields.add( new UAVObjectField("Airspeed", "m/s", UAVObjectField.FieldType.FLOAT32, AirspeedElemNames, null) );
List<String> SensorValueElemNames = new ArrayList<String>();
SensorValueElemNames.add("0");
fields.add( new UAVObjectField("SensorValue", "raw", UAVObjectField.FieldType.UINT16, SensorValueElemNames, null) );
List<String> ZeroPointElemNames = new ArrayList<String>();
ZeroPointElemNames.add("0");
fields.add( new UAVObjectField("ZeroPoint", "raw", UAVObjectField.FieldType.UINT16, ZeroPointElemNames, null) );
List<String> ConnectedElemNames = new ArrayList<String>();
ConnectedElemNames.add("0");
List<String> ConnectedEnumOptions = new ArrayList<String>();
ConnectedEnumOptions.add("False");
ConnectedEnumOptions.add("True");
fields.add( new UAVObjectField("Connected", "", UAVObjectField.FieldType.ENUM, ConnectedElemNames, ConnectedEnumOptions) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.gcsTelemetryUpdatePeriod = 0;
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 {
BaroAirspeed obj = new BaroAirspeed();
obj.initialize(instID, this.getMetaObject());
return obj;
} catch (Exception e) {
return null;
}
}
/**
* Static function to retrieve an instance of the object.
*/
public BaroAirspeed GetInstance(UAVObjectManager objMngr, int instID)
{
return (BaroAirspeed)(objMngr.getObject(BaroAirspeed.OBJID, instID));
}
// Constants
protected static final int OBJID = 0x169EA4A;
protected static final String NAME = "BaroAirspeed";
protected static String DESCRIPTION = "The raw data from the dynamic pressure sensor with pressure, temperature and airspeed.";
protected static final boolean ISSINGLEINST = 1 == 1;
protected static final boolean ISSETTINGS = 0 == 1;
protected static int NUMBYTES = 0;
}

View File

@ -0,0 +1,239 @@
/**
******************************************************************************
*
* @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 FixedWingPathFollowerModule
*
* @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 FixedWingPathFollowerModule
generated from fixedwingpathfollowersettings.xml
**/
public class FixedWingPathFollowerSettings extends UAVDataObject {
public FixedWingPathFollowerSettings() {
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> AirSpeedMaxElemNames = new ArrayList<String>();
AirSpeedMaxElemNames.add("0");
fields.add( new UAVObjectField("AirSpeedMax", "m/s", UAVObjectField.FieldType.FLOAT32, AirSpeedMaxElemNames, null) );
List<String> AirSpeedMinElemNames = new ArrayList<String>();
AirSpeedMinElemNames.add("0");
fields.add( new UAVObjectField("AirSpeedMin", "m/s", UAVObjectField.FieldType.FLOAT32, AirSpeedMinElemNames, null) );
List<String> VerticalVelMaxElemNames = new ArrayList<String>();
VerticalVelMaxElemNames.add("0");
fields.add( new UAVObjectField("VerticalVelMax", "m/s", UAVObjectField.FieldType.FLOAT32, VerticalVelMaxElemNames, null) );
List<String> HorizontalPosPElemNames = new ArrayList<String>();
HorizontalPosPElemNames.add("0");
fields.add( new UAVObjectField("HorizontalPosP", "(m/s)/m", UAVObjectField.FieldType.FLOAT32, HorizontalPosPElemNames, null) );
List<String> VerticalPosPElemNames = new ArrayList<String>();
VerticalPosPElemNames.add("0");
fields.add( new UAVObjectField("VerticalPosP", "(m/s)/m", UAVObjectField.FieldType.FLOAT32, VerticalPosPElemNames, null) );
List<String> CoursePIElemNames = new ArrayList<String>();
CoursePIElemNames.add("Kp");
CoursePIElemNames.add("Ki");
CoursePIElemNames.add("ILimit");
fields.add( new UAVObjectField("CoursePI", "deg/deg", UAVObjectField.FieldType.FLOAT32, CoursePIElemNames, null) );
List<String> SpeedPElemNames = new ArrayList<String>();
SpeedPElemNames.add("Kp");
SpeedPElemNames.add("Max");
fields.add( new UAVObjectField("SpeedP", "(m/s^2) / ((m/s)/(m/s)", UAVObjectField.FieldType.FLOAT32, SpeedPElemNames, null) );
List<String> AccelPIElemNames = new ArrayList<String>();
AccelPIElemNames.add("Kp");
AccelPIElemNames.add("Ki");
AccelPIElemNames.add("ILimit");
fields.add( new UAVObjectField("AccelPI", "deg / (m/s^2)", UAVObjectField.FieldType.FLOAT32, AccelPIElemNames, null) );
List<String> VerticalToPitchCrossFeedElemNames = new ArrayList<String>();
VerticalToPitchCrossFeedElemNames.add("Kp");
VerticalToPitchCrossFeedElemNames.add("Max");
fields.add( new UAVObjectField("VerticalToPitchCrossFeed", "deg / ((m/s)/(m/s))", UAVObjectField.FieldType.FLOAT32, VerticalToPitchCrossFeedElemNames, null) );
List<String> AirspeedToVerticalCrossFeedElemNames = new ArrayList<String>();
AirspeedToVerticalCrossFeedElemNames.add("Kp");
AirspeedToVerticalCrossFeedElemNames.add("Max");
fields.add( new UAVObjectField("AirspeedToVerticalCrossFeed", "(m/s) / ((m/s)/(m/s))", UAVObjectField.FieldType.FLOAT32, AirspeedToVerticalCrossFeedElemNames, null) );
List<String> PowerPIElemNames = new ArrayList<String>();
PowerPIElemNames.add("Kp");
PowerPIElemNames.add("Ki");
PowerPIElemNames.add("ILimit");
fields.add( new UAVObjectField("PowerPI", "1/(m/s)", UAVObjectField.FieldType.FLOAT32, PowerPIElemNames, null) );
List<String> RollLimitElemNames = new ArrayList<String>();
RollLimitElemNames.add("Min");
RollLimitElemNames.add("Neutral");
RollLimitElemNames.add("Max");
fields.add( new UAVObjectField("RollLimit", "deg", UAVObjectField.FieldType.FLOAT32, RollLimitElemNames, null) );
List<String> PitchLimitElemNames = new ArrayList<String>();
PitchLimitElemNames.add("Min");
PitchLimitElemNames.add("Neutral");
PitchLimitElemNames.add("Max");
fields.add( new UAVObjectField("PitchLimit", "deg", UAVObjectField.FieldType.FLOAT32, PitchLimitElemNames, null) );
List<String> ThrottleLimitElemNames = new ArrayList<String>();
ThrottleLimitElemNames.add("Min");
ThrottleLimitElemNames.add("Neutral");
ThrottleLimitElemNames.add("Max");
fields.add( new UAVObjectField("ThrottleLimit", "", UAVObjectField.FieldType.FLOAT32, ThrottleLimitElemNames, null) );
List<String> UpdatePeriodElemNames = new ArrayList<String>();
UpdatePeriodElemNames.add("0");
fields.add( new UAVObjectField("UpdatePeriod", "ms", UAVObjectField.FieldType.INT32, UpdatePeriodElemNames, null) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.gcsTelemetryUpdatePeriod = 0;
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("AirSpeedMax").setValue(15);
getField("AirSpeedMin").setValue(10);
getField("VerticalVelMax").setValue(10);
getField("HorizontalPosP").setValue(0.05);
getField("VerticalPosP").setValue(0.05);
getField("CoursePI").setValue(0.2,0);
getField("CoursePI").setValue(0,1);
getField("CoursePI").setValue(0,2);
getField("SpeedP").setValue(10,0);
getField("SpeedP").setValue(10,1);
getField("AccelPI").setValue(1.5,0);
getField("AccelPI").setValue(1.5,1);
getField("AccelPI").setValue(20,2);
getField("VerticalToPitchCrossFeed").setValue(50,0);
getField("VerticalToPitchCrossFeed").setValue(5,1);
getField("AirspeedToVerticalCrossFeed").setValue(100,0);
getField("AirspeedToVerticalCrossFeed").setValue(100,1);
getField("PowerPI").setValue(0.01,0);
getField("PowerPI").setValue(0.01,1);
getField("PowerPI").setValue(0.8,2);
getField("RollLimit").setValue(-35,0);
getField("RollLimit").setValue(0,1);
getField("RollLimit").setValue(35,2);
getField("PitchLimit").setValue(-10,0);
getField("PitchLimit").setValue(5,1);
getField("PitchLimit").setValue(20,2);
getField("ThrottleLimit").setValue(0.1,0);
getField("ThrottleLimit").setValue(0.5,1);
getField("ThrottleLimit").setValue(0.9,2);
getField("UpdatePeriod").setValue(100);
}
/**
* Create a clone of this object, a new instance ID must be specified.
* Do not use this function directly to create new instances, the
* UAVObjectManager should be used instead.
*/
public UAVDataObject clone(int instID) {
// TODO: Need to get specific instance to clone
try {
FixedWingPathFollowerSettings obj = new FixedWingPathFollowerSettings();
obj.initialize(instID, this.getMetaObject());
return obj;
} catch (Exception e) {
return null;
}
}
/**
* Static function to retrieve an instance of the object.
*/
public FixedWingPathFollowerSettings GetInstance(UAVObjectManager objMngr, int instID)
{
return (FixedWingPathFollowerSettings)(objMngr.getObject(FixedWingPathFollowerSettings.OBJID, instID));
}
// Constants
protected static final int OBJID = 0x8A3F1E02;
protected static final String NAME = "FixedWingPathFollowerSettings";
protected static String DESCRIPTION = "Settings for the @ref FixedWingPathFollowerModule";
protected static final boolean ISSINGLEINST = 1 == 1;
protected static final boolean ISSETTINGS = 1 == 1;
protected static int NUMBYTES = 0;
}

View File

@ -0,0 +1,164 @@
/**
******************************************************************************
*
* @file uavobjecttemplate.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Template for an uavobject in java
* This is a autogenerated file!! Do not modify and expect a result.
* Object Storing Debugging Information on PID internals
*
* @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;
/**
Object Storing Debugging Information on PID internals
generated from fixedwingpathfollowerstatus.xml
**/
public class FixedWingPathFollowerStatus extends UAVDataObject {
public FixedWingPathFollowerStatus() {
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> EElemNames = new ArrayList<String>();
EElemNames.add("Course");
EElemNames.add("Speed");
EElemNames.add("Accel");
EElemNames.add("Power");
fields.add( new UAVObjectField("E", "", UAVObjectField.FieldType.FLOAT32, EElemNames, null) );
List<String> AElemNames = new ArrayList<String>();
AElemNames.add("Course");
AElemNames.add("Speed");
AElemNames.add("Accel");
AElemNames.add("Power");
fields.add( new UAVObjectField("A", "", UAVObjectField.FieldType.FLOAT32, AElemNames, null) );
List<String> CElemNames = new ArrayList<String>();
CElemNames.add("Course");
CElemNames.add("Speed");
CElemNames.add("Accel");
CElemNames.add("Power");
fields.add( new UAVObjectField("C", "", UAVObjectField.FieldType.FLOAT32, CElemNames, null) );
List<String> ErrorsElemNames = new ArrayList<String>();
ErrorsElemNames.add("Wind");
ErrorsElemNames.add("Lowspeed");
ErrorsElemNames.add("Highspeed");
ErrorsElemNames.add("Lowpower");
ErrorsElemNames.add("Highpower");
ErrorsElemNames.add("Pitchcontrol");
fields.add( new UAVObjectField("Errors", "", UAVObjectField.FieldType.UINT8, ErrorsElemNames, null) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 500;
metadata.gcsTelemetryUpdatePeriod = 0;
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 {
FixedWingPathFollowerStatus obj = new FixedWingPathFollowerStatus();
obj.initialize(instID, this.getMetaObject());
return obj;
} catch (Exception e) {
return null;
}
}
/**
* Static function to retrieve an instance of the object.
*/
public FixedWingPathFollowerStatus GetInstance(UAVObjectManager objMngr, int instID)
{
return (FixedWingPathFollowerStatus)(objMngr.getObject(FixedWingPathFollowerStatus.OBJID, instID));
}
// Constants
protected static final int OBJID = 0xA0D6F6D4;
protected static final String NAME = "FixedWingPathFollowerStatus";
protected static String DESCRIPTION = "Object Storing Debugging Information on PID internals";
protected static final boolean ISSINGLEINST = 1 == 1;
protected static final boolean ISSETTINGS = 0 == 1;
protected static int NUMBYTES = 0;
}

View File

@ -0,0 +1,142 @@
/**
******************************************************************************
*
* @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 GPS
*
* @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 GPS
generated from gpssettings.xml
**/
public class GPSSettings extends UAVDataObject {
public GPSSettings() {
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> DataProtocolElemNames = new ArrayList<String>();
DataProtocolElemNames.add("0");
List<String> DataProtocolEnumOptions = new ArrayList<String>();
DataProtocolEnumOptions.add("NMEA");
DataProtocolEnumOptions.add("UBX");
fields.add( new UAVObjectField("DataProtocol", "", UAVObjectField.FieldType.ENUM, DataProtocolElemNames, DataProtocolEnumOptions) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.gcsTelemetryUpdatePeriod = 0;
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("DataProtocol").setValue("NMEA");
}
/**
* 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 {
GPSSettings obj = new GPSSettings();
obj.initialize(instID, this.getMetaObject());
return obj;
} catch (Exception e) {
return null;
}
}
/**
* Static function to retrieve an instance of the object.
*/
public GPSSettings GetInstance(UAVObjectManager objMngr, int instID)
{
return (GPSSettings)(objMngr.getObject(GPSSettings.OBJID, instID));
}
// Constants
protected static final int OBJID = 0xAC5F6370;
protected static final String NAME = "GPSSettings";
protected static String DESCRIPTION = "Settings for the GPS";
protected static final boolean ISSINGLEINST = 1 == 1;
protected static final boolean ISSETTINGS = 1 == 1;
protected static int NUMBYTES = 0;
}

View File

@ -0,0 +1,146 @@
/**
******************************************************************************
*
* @file uavobjecttemplate.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Template for an uavobject in java
* This is a autogenerated file!! Do not modify and expect a result.
* Raw GPS data from @ref GPSModule.
*
* @see The GNU Public License (GPL) Version 3
*
*****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.openpilot.uavtalk.uavobjects;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;
import org.openpilot.uavtalk.UAVObjectManager;
import org.openpilot.uavtalk.UAVObject;
import org.openpilot.uavtalk.UAVDataObject;
import org.openpilot.uavtalk.UAVObjectField;
/**
Raw GPS data from @ref GPSModule.
generated from gpsvelocity.xml
**/
public class GPSVelocity extends UAVDataObject {
public GPSVelocity() {
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> NorthElemNames = new ArrayList<String>();
NorthElemNames.add("0");
fields.add( new UAVObjectField("North", "m/s", UAVObjectField.FieldType.FLOAT32, NorthElemNames, null) );
List<String> EastElemNames = new ArrayList<String>();
EastElemNames.add("0");
fields.add( new UAVObjectField("East", "m/s", UAVObjectField.FieldType.FLOAT32, EastElemNames, null) );
List<String> DownElemNames = new ArrayList<String>();
DownElemNames.add("0");
fields.add( new UAVObjectField("Down", "m/s", UAVObjectField.FieldType.FLOAT32, DownElemNames, null) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.gcsTelemetryUpdatePeriod = 0;
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 {
GPSVelocity obj = new GPSVelocity();
obj.initialize(instID, this.getMetaObject());
return obj;
} catch (Exception e) {
return null;
}
}
/**
* Static function to retrieve an instance of the object.
*/
public GPSVelocity GetInstance(UAVObjectManager objMngr, int instID)
{
return (GPSVelocity)(objMngr.getObject(GPSVelocity.OBJID, instID));
}
// Constants
protected static final int OBJID = 0x8245DC80;
protected static final String NAME = "GPSVelocity";
protected static String DESCRIPTION = "Raw GPS data from @ref GPSModule.";
protected static final boolean ISSINGLEINST = 1 == 1;
protected static final boolean ISSETTINGS = 0 == 1;
protected static int NUMBYTES = 0;
}

View File

@ -0,0 +1,150 @@
/**
******************************************************************************
*
* @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 gyro data.
*
* @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 gyro data.
generated from gyros.xml
**/
public class Gyros extends UAVDataObject {
public Gyros() {
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> xElemNames = new ArrayList<String>();
xElemNames.add("0");
fields.add( new UAVObjectField("x", "deg/s", UAVObjectField.FieldType.FLOAT32, xElemNames, null) );
List<String> yElemNames = new ArrayList<String>();
yElemNames.add("0");
fields.add( new UAVObjectField("y", "deg/s", UAVObjectField.FieldType.FLOAT32, yElemNames, null) );
List<String> zElemNames = new ArrayList<String>();
zElemNames.add("0");
fields.add( new UAVObjectField("z", "deg/s", UAVObjectField.FieldType.FLOAT32, zElemNames, null) );
List<String> temperatureElemNames = new ArrayList<String>();
temperatureElemNames.add("0");
fields.add( new UAVObjectField("temperature", "deg C", UAVObjectField.FieldType.FLOAT32, temperatureElemNames, null) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.gcsTelemetryUpdatePeriod = 0;
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 {
Gyros obj = new Gyros();
obj.initialize(instID, this.getMetaObject());
return obj;
} catch (Exception e) {
return null;
}
}
/**
* Static function to retrieve an instance of the object.
*/
public Gyros GetInstance(UAVObjectManager objMngr, int instID)
{
return (Gyros)(objMngr.getObject(Gyros.OBJID, instID));
}
// Constants
protected static final int OBJID = 0x4228AF6;
protected static final String NAME = "Gyros";
protected static String DESCRIPTION = "The gyro data.";
protected static final boolean ISSINGLEINST = 1 == 1;
protected static final boolean ISSETTINGS = 0 == 1;
protected static int NUMBYTES = 0;
}

View File

@ -0,0 +1,146 @@
/**
******************************************************************************
*
* @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 gyro data.
*
* @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 gyro data.
generated from gyrosbias.xml
**/
public class GyrosBias extends UAVDataObject {
public GyrosBias() {
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> xElemNames = new ArrayList<String>();
xElemNames.add("0");
fields.add( new UAVObjectField("x", "deg/s", UAVObjectField.FieldType.FLOAT32, xElemNames, null) );
List<String> yElemNames = new ArrayList<String>();
yElemNames.add("0");
fields.add( new UAVObjectField("y", "deg/s", UAVObjectField.FieldType.FLOAT32, yElemNames, null) );
List<String> zElemNames = new ArrayList<String>();
zElemNames.add("0");
fields.add( new UAVObjectField("z", "deg/s", UAVObjectField.FieldType.FLOAT32, zElemNames, null) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.gcsTelemetryUpdatePeriod = 0;
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 {
GyrosBias obj = new GyrosBias();
obj.initialize(instID, this.getMetaObject());
return obj;
} catch (Exception e) {
return null;
}
}
/**
* Static function to retrieve an instance of the object.
*/
public GyrosBias GetInstance(UAVObjectManager objMngr, int instID)
{
return (GyrosBias)(objMngr.getObject(GyrosBias.OBJID, instID));
}
// Constants
protected static final int OBJID = 0xE4B6F980;
protected static final String NAME = "GyrosBias";
protected static String DESCRIPTION = "The gyro data.";
protected static final boolean ISSINGLEINST = 1 == 1;
protected static final boolean ISSETTINGS = 0 == 1;
protected static int NUMBYTES = 0;
}

View File

@ -0,0 +1,146 @@
/**
******************************************************************************
*
* @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 gyro data.
*
* @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 gyro data.
generated from magbias.xml
**/
public class MagBias extends UAVDataObject {
public MagBias() {
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> xElemNames = new ArrayList<String>();
xElemNames.add("0");
fields.add( new UAVObjectField("x", "mGau", UAVObjectField.FieldType.FLOAT32, xElemNames, null) );
List<String> yElemNames = new ArrayList<String>();
yElemNames.add("0");
fields.add( new UAVObjectField("y", "mGau", UAVObjectField.FieldType.FLOAT32, yElemNames, null) );
List<String> zElemNames = new ArrayList<String>();
zElemNames.add("0");
fields.add( new UAVObjectField("z", "mGau", UAVObjectField.FieldType.FLOAT32, zElemNames, null) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.gcsTelemetryUpdatePeriod = 0;
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 {
MagBias obj = new MagBias();
obj.initialize(instID, this.getMetaObject());
return obj;
} catch (Exception e) {
return null;
}
}
/**
* Static function to retrieve an instance of the object.
*/
public MagBias GetInstance(UAVObjectManager objMngr, int instID)
{
return (MagBias)(objMngr.getObject(MagBias.OBJID, instID));
}
// Constants
protected static final int OBJID = 0x5043E510;
protected static final String NAME = "MagBias";
protected static String DESCRIPTION = "The gyro data.";
protected static final boolean ISSINGLEINST = 1 == 1;
protected static final boolean ISSETTINGS = 0 == 1;
protected static int NUMBYTES = 0;
}

View File

@ -0,0 +1,146 @@
/**
******************************************************************************
*
* @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 mag data.
*
* @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 mag data.
generated from magnetometer.xml
**/
public class Magnetometer extends UAVDataObject {
public Magnetometer() {
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> xElemNames = new ArrayList<String>();
xElemNames.add("0");
fields.add( new UAVObjectField("x", "mGa", UAVObjectField.FieldType.FLOAT32, xElemNames, null) );
List<String> yElemNames = new ArrayList<String>();
yElemNames.add("0");
fields.add( new UAVObjectField("y", "mGa", UAVObjectField.FieldType.FLOAT32, yElemNames, null) );
List<String> zElemNames = new ArrayList<String>();
zElemNames.add("0");
fields.add( new UAVObjectField("z", "mGa", UAVObjectField.FieldType.FLOAT32, zElemNames, null) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.gcsTelemetryUpdatePeriod = 0;
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 {
Magnetometer obj = new Magnetometer();
obj.initialize(instID, this.getMetaObject());
return obj;
} catch (Exception e) {
return null;
}
}
/**
* Static function to retrieve an instance of the object.
*/
public Magnetometer GetInstance(UAVObjectManager objMngr, int instID)
{
return (Magnetometer)(objMngr.getObject(Magnetometer.OBJID, instID));
}
// Constants
protected static final int OBJID = 0x813B55DE;
protected static final String NAME = "Magnetometer";
protected static String DESCRIPTION = "The mag data.";
protected static final boolean ISSINGLEINST = 1 == 1;
protected static final boolean ISSETTINGS = 0 == 1;
protected static int NUMBYTES = 0;
}

View File

@ -0,0 +1,146 @@
/**
******************************************************************************
*
* @file uavobjecttemplate.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Template for an uavobject in java
* This is a autogenerated file!! Do not modify and expect a result.
* Contains the current position relative to @ref HomeLocation
*
* @see The GNU Public License (GPL) Version 3
*
*****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.openpilot.uavtalk.uavobjects;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;
import org.openpilot.uavtalk.UAVObjectManager;
import org.openpilot.uavtalk.UAVObject;
import org.openpilot.uavtalk.UAVDataObject;
import org.openpilot.uavtalk.UAVObjectField;
/**
Contains the current position relative to @ref HomeLocation
generated from nedposition.xml
**/
public class NEDPosition extends UAVDataObject {
public NEDPosition() {
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> NorthElemNames = new ArrayList<String>();
NorthElemNames.add("0");
fields.add( new UAVObjectField("North", "m", UAVObjectField.FieldType.FLOAT32, NorthElemNames, null) );
List<String> EastElemNames = new ArrayList<String>();
EastElemNames.add("0");
fields.add( new UAVObjectField("East", "m", UAVObjectField.FieldType.FLOAT32, EastElemNames, null) );
List<String> DownElemNames = new ArrayList<String>();
DownElemNames.add("0");
fields.add( new UAVObjectField("Down", "m", UAVObjectField.FieldType.FLOAT32, DownElemNames, null) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.gcsTelemetryUpdatePeriod = 0;
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 {
NEDPosition obj = new NEDPosition();
obj.initialize(instID, this.getMetaObject());
return obj;
} catch (Exception e) {
return null;
}
}
/**
* Static function to retrieve an instance of the object.
*/
public NEDPosition GetInstance(UAVObjectManager objMngr, int instID)
{
return (NEDPosition)(objMngr.getObject(NEDPosition.OBJID, instID));
}
// Constants
protected static final int OBJID = 0x1FB15A00;
protected static final String NAME = "NEDPosition";
protected static String DESCRIPTION = "Contains the current position relative to @ref HomeLocation";
protected static final boolean ISSINGLEINST = 1 == 1;
protected static final boolean ISSETTINGS = 0 == 1;
protected static int NUMBYTES = 0;
}

View File

@ -0,0 +1,143 @@
/**
******************************************************************************
*
* @file uavobjecttemplate.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Template for an uavobject in java
* This is a autogenerated file!! Do not modify and expect a result.
* Settings to control the behavior of the overo sync 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;
/**
Settings to control the behavior of the overo sync module
generated from overosyncsettings.xml
**/
public class OveroSyncSettings extends UAVDataObject {
public OveroSyncSettings() {
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> LogOnElemNames = new ArrayList<String>();
LogOnElemNames.add("0");
List<String> LogOnEnumOptions = new ArrayList<String>();
LogOnEnumOptions.add("Never");
LogOnEnumOptions.add("Always");
LogOnEnumOptions.add("Armed");
fields.add( new UAVObjectField("LogOn", "", UAVObjectField.FieldType.ENUM, LogOnElemNames, LogOnEnumOptions) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 1000;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
getField("LogOn").setValue("Armed");
}
/**
* 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 {
OveroSyncSettings obj = new OveroSyncSettings();
obj.initialize(instID, this.getMetaObject());
return obj;
} catch (Exception e) {
return null;
}
}
/**
* Static function to retrieve an instance of the object.
*/
public OveroSyncSettings GetInstance(UAVObjectManager objMngr, int instID)
{
return (OveroSyncSettings)(objMngr.getObject(OveroSyncSettings.OBJID, instID));
}
// Constants
protected static final int OBJID = 0xA1ABC278;
protected static final String NAME = "OveroSyncSettings";
protected static String DESCRIPTION = "Settings to control the behavior of the overo sync module";
protected static final boolean ISSINGLEINST = 1 == 1;
protected static final boolean ISSETTINGS = 1 == 1;
protected static int NUMBYTES = 0;
}

View File

@ -0,0 +1,165 @@
/**
******************************************************************************
*
* @file uavobjecttemplate.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Template for an uavobject in java
* This is a autogenerated file!! Do not modify and expect a result.
* Maintains statistics on transfer rate to and from over
*
* @see The GNU Public License (GPL) Version 3
*
*****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.openpilot.uavtalk.uavobjects;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;
import org.openpilot.uavtalk.UAVObjectManager;
import org.openpilot.uavtalk.UAVObject;
import org.openpilot.uavtalk.UAVDataObject;
import org.openpilot.uavtalk.UAVObjectField;
/**
Maintains statistics on transfer rate to and from over
generated from overosyncstats.xml
**/
public class OveroSyncStats extends UAVDataObject {
public OveroSyncStats() {
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> SendElemNames = new ArrayList<String>();
SendElemNames.add("0");
fields.add( new UAVObjectField("Send", "B/s", UAVObjectField.FieldType.UINT32, SendElemNames, null) );
List<String> ReceivedElemNames = new ArrayList<String>();
ReceivedElemNames.add("0");
fields.add( new UAVObjectField("Received", "B/s", UAVObjectField.FieldType.UINT32, ReceivedElemNames, null) );
List<String> FramesyncErrorsElemNames = new ArrayList<String>();
FramesyncErrorsElemNames.add("0");
fields.add( new UAVObjectField("FramesyncErrors", "count", UAVObjectField.FieldType.UINT32, FramesyncErrorsElemNames, null) );
List<String> UnderrunErrorsElemNames = new ArrayList<String>();
UnderrunErrorsElemNames.add("0");
fields.add( new UAVObjectField("UnderrunErrors", "count", UAVObjectField.FieldType.UINT32, UnderrunErrorsElemNames, null) );
List<String> DroppedUpdatesElemNames = new ArrayList<String>();
DroppedUpdatesElemNames.add("0");
fields.add( new UAVObjectField("DroppedUpdates", "", UAVObjectField.FieldType.UINT32, DroppedUpdatesElemNames, null) );
List<String> PacketsElemNames = new ArrayList<String>();
PacketsElemNames.add("0");
fields.add( new UAVObjectField("Packets", "", UAVObjectField.FieldType.UINT32, PacketsElemNames, null) );
List<String> ConnectedElemNames = new ArrayList<String>();
ConnectedElemNames.add("0");
List<String> ConnectedEnumOptions = new ArrayList<String>();
ConnectedEnumOptions.add("False");
ConnectedEnumOptions.add("True");
fields.add( new UAVObjectField("Connected", "", UAVObjectField.FieldType.ENUM, ConnectedElemNames, ConnectedEnumOptions) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.gcsTelemetryUpdatePeriod = 0;
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 {
OveroSyncStats obj = new OveroSyncStats();
obj.initialize(instID, this.getMetaObject());
return obj;
} catch (Exception e) {
return null;
}
}
/**
* Static function to retrieve an instance of the object.
*/
public OveroSyncStats GetInstance(UAVObjectManager objMngr, int instID)
{
return (OveroSyncStats)(objMngr.getObject(OveroSyncStats.OBJID, instID));
}
// Constants
protected static final int OBJID = 0xD2085FAC;
protected static final String NAME = "OveroSyncStats";
protected static String DESCRIPTION = "Maintains statistics on transfer rate to and from over";
protected static final boolean ISSINGLEINST = 1 == 1;
protected static final boolean ISSETTINGS = 0 == 1;
protected static int NUMBYTES = 0;
}

View File

@ -0,0 +1,162 @@
/**
******************************************************************************
*
* @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 endpoint or path the craft is trying to achieve. Can come from @ref ManualControl or @ref PathPlanner
*
* @see The GNU Public License (GPL) Version 3
*
*****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.openpilot.uavtalk.uavobjects;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;
import org.openpilot.uavtalk.UAVObjectManager;
import org.openpilot.uavtalk.UAVObject;
import org.openpilot.uavtalk.UAVDataObject;
import org.openpilot.uavtalk.UAVObjectField;
/**
The endpoint or path the craft is trying to achieve. Can come from @ref ManualControl or @ref PathPlanner
generated from pathdesired.xml
**/
public class PathDesired extends UAVDataObject {
public PathDesired() {
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> StartElemNames = new ArrayList<String>();
StartElemNames.add("North");
StartElemNames.add("East");
StartElemNames.add("Down");
fields.add( new UAVObjectField("Start", "m", UAVObjectField.FieldType.FLOAT32, StartElemNames, null) );
List<String> EndElemNames = new ArrayList<String>();
EndElemNames.add("North");
EndElemNames.add("East");
EndElemNames.add("Down");
fields.add( new UAVObjectField("End", "m", UAVObjectField.FieldType.FLOAT32, EndElemNames, null) );
List<String> StartingVelocityElemNames = new ArrayList<String>();
StartingVelocityElemNames.add("0");
fields.add( new UAVObjectField("StartingVelocity", "m/s", UAVObjectField.FieldType.FLOAT32, StartingVelocityElemNames, null) );
List<String> EndingVelocityElemNames = new ArrayList<String>();
EndingVelocityElemNames.add("0");
fields.add( new UAVObjectField("EndingVelocity", "m/s", UAVObjectField.FieldType.FLOAT32, EndingVelocityElemNames, null) );
List<String> ModeElemNames = new ArrayList<String>();
ModeElemNames.add("0");
List<String> ModeEnumOptions = new ArrayList<String>();
ModeEnumOptions.add("Endpoint");
ModeEnumOptions.add("Path");
ModeEnumOptions.add("Land");
fields.add( new UAVObjectField("Mode", "", UAVObjectField.FieldType.ENUM, ModeElemNames, ModeEnumOptions) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.gcsTelemetryUpdatePeriod = 0;
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 {
PathDesired obj = new PathDesired();
obj.initialize(instID, this.getMetaObject());
return obj;
} catch (Exception e) {
return null;
}
}
/**
* Static function to retrieve an instance of the object.
*/
public PathDesired GetInstance(UAVObjectManager objMngr, int instID)
{
return (PathDesired)(objMngr.getObject(PathDesired.OBJID, instID));
}
// Constants
protected static final int OBJID = 0x5A4DC71A;
protected static final String NAME = "PathDesired";
protected static String DESCRIPTION = "The endpoint or path the craft is trying to achieve. Can come from @ref ManualControl or @ref PathPlanner ";
protected static final boolean ISSINGLEINST = 1 == 1;
protected static final boolean ISSETTINGS = 0 == 1;
protected static int NUMBYTES = 0;
}

View File

@ -0,0 +1,151 @@
/**
******************************************************************************
*
* @file uavobjecttemplate.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Template for an uavobject in java
* This is a autogenerated file!! Do not modify and expect a result.
* Settings for the @ref PathPlanner 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;
/**
Settings for the @ref PathPlanner Module
generated from pathplannersettings.xml
**/
public class PathPlannerSettings extends UAVDataObject {
public PathPlannerSettings() {
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> PathModeElemNames = new ArrayList<String>();
PathModeElemNames.add("0");
List<String> PathModeEnumOptions = new ArrayList<String>();
PathModeEnumOptions.add("ENDPOINT");
PathModeEnumOptions.add("PATH");
fields.add( new UAVObjectField("PathMode", "", UAVObjectField.FieldType.ENUM, PathModeElemNames, PathModeEnumOptions) );
List<String> PreprogrammedPathElemNames = new ArrayList<String>();
PreprogrammedPathElemNames.add("0");
List<String> PreprogrammedPathEnumOptions = new ArrayList<String>();
PreprogrammedPathEnumOptions.add("NONE");
PreprogrammedPathEnumOptions.add("10M_BOX");
PreprogrammedPathEnumOptions.add("LOGO");
fields.add( new UAVObjectField("PreprogrammedPath", "", UAVObjectField.FieldType.ENUM, PreprogrammedPathElemNames, PreprogrammedPathEnumOptions) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.gcsTelemetryUpdatePeriod = 0;
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("PathMode").setValue("PATH");
getField("PreprogrammedPath").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 {
PathPlannerSettings obj = new PathPlannerSettings();
obj.initialize(instID, this.getMetaObject());
return obj;
} catch (Exception e) {
return null;
}
}
/**
* Static function to retrieve an instance of the object.
*/
public PathPlannerSettings GetInstance(UAVObjectManager objMngr, int instID)
{
return (PathPlannerSettings)(objMngr.getObject(PathPlannerSettings.OBJID, instID));
}
// Constants
protected static final int OBJID = 0x290E45DA;
protected static final String NAME = "PathPlannerSettings";
protected static String DESCRIPTION = "Settings for the @ref PathPlanner Module";
protected static final boolean ISSINGLEINST = 1 == 1;
protected static final boolean ISSETTINGS = 1 == 1;
protected static int NUMBYTES = 0;
}

View File

@ -0,0 +1,326 @@
/**
******************************************************************************
*
* @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.
* PipXtreme configurations options.
*
* @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;
/**
PipXtreme configurations options.
generated from pipxsettings.xml
**/
public class PipXSettings extends UAVDataObject {
public PipXSettings() {
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> PairIDElemNames = new ArrayList<String>();
PairIDElemNames.add("0");
fields.add( new UAVObjectField("PairID", "", UAVObjectField.FieldType.UINT32, PairIDElemNames, null) );
List<String> FrequencyElemNames = new ArrayList<String>();
FrequencyElemNames.add("0");
fields.add( new UAVObjectField("Frequency", "", UAVObjectField.FieldType.UINT32, FrequencyElemNames, null) );
List<String> SendTimeoutElemNames = new ArrayList<String>();
SendTimeoutElemNames.add("0");
fields.add( new UAVObjectField("SendTimeout", "ms", UAVObjectField.FieldType.UINT16, SendTimeoutElemNames, null) );
List<String> TelemetryConfigElemNames = new ArrayList<String>();
TelemetryConfigElemNames.add("0");
List<String> TelemetryConfigEnumOptions = new ArrayList<String>();
TelemetryConfigEnumOptions.add("Disabled");
TelemetryConfigEnumOptions.add("Serial");
TelemetryConfigEnumOptions.add("UAVTalk");
TelemetryConfigEnumOptions.add("GCS");
TelemetryConfigEnumOptions.add("Debug");
fields.add( new UAVObjectField("TelemetryConfig", "function", UAVObjectField.FieldType.ENUM, TelemetryConfigElemNames, TelemetryConfigEnumOptions) );
List<String> TelemetrySpeedElemNames = new ArrayList<String>();
TelemetrySpeedElemNames.add("0");
List<String> TelemetrySpeedEnumOptions = new ArrayList<String>();
TelemetrySpeedEnumOptions.add("2400");
TelemetrySpeedEnumOptions.add("4800");
TelemetrySpeedEnumOptions.add("9600");
TelemetrySpeedEnumOptions.add("19200");
TelemetrySpeedEnumOptions.add("38400");
TelemetrySpeedEnumOptions.add("57600");
TelemetrySpeedEnumOptions.add("115200");
fields.add( new UAVObjectField("TelemetrySpeed", "bps", UAVObjectField.FieldType.ENUM, TelemetrySpeedElemNames, TelemetrySpeedEnumOptions) );
List<String> FlexiConfigElemNames = new ArrayList<String>();
FlexiConfigElemNames.add("0");
List<String> FlexiConfigEnumOptions = new ArrayList<String>();
FlexiConfigEnumOptions.add("Disabled");
FlexiConfigEnumOptions.add("Serial");
FlexiConfigEnumOptions.add("UAVTalk");
FlexiConfigEnumOptions.add("GCS");
FlexiConfigEnumOptions.add("PPM_In");
FlexiConfigEnumOptions.add("PPM_Out");
FlexiConfigEnumOptions.add("RSSI");
FlexiConfigEnumOptions.add("Debug");
fields.add( new UAVObjectField("FlexiConfig", "function", UAVObjectField.FieldType.ENUM, FlexiConfigElemNames, FlexiConfigEnumOptions) );
List<String> FlexiSpeedElemNames = new ArrayList<String>();
FlexiSpeedElemNames.add("0");
List<String> FlexiSpeedEnumOptions = new ArrayList<String>();
FlexiSpeedEnumOptions.add("2400");
FlexiSpeedEnumOptions.add("4800");
FlexiSpeedEnumOptions.add("9600");
FlexiSpeedEnumOptions.add("19200");
FlexiSpeedEnumOptions.add("38400");
FlexiSpeedEnumOptions.add("57600");
FlexiSpeedEnumOptions.add("115200");
fields.add( new UAVObjectField("FlexiSpeed", "bps", UAVObjectField.FieldType.ENUM, FlexiSpeedElemNames, FlexiSpeedEnumOptions) );
List<String> VCPConfigElemNames = new ArrayList<String>();
VCPConfigElemNames.add("0");
List<String> VCPConfigEnumOptions = new ArrayList<String>();
VCPConfigEnumOptions.add("Disabled");
VCPConfigEnumOptions.add("Serial");
VCPConfigEnumOptions.add("Debug");
fields.add( new UAVObjectField("VCPConfig", "function", UAVObjectField.FieldType.ENUM, VCPConfigElemNames, VCPConfigEnumOptions) );
List<String> VCPSpeedElemNames = new ArrayList<String>();
VCPSpeedElemNames.add("0");
List<String> VCPSpeedEnumOptions = new ArrayList<String>();
VCPSpeedEnumOptions.add("2400");
VCPSpeedEnumOptions.add("4800");
VCPSpeedEnumOptions.add("9600");
VCPSpeedEnumOptions.add("19200");
VCPSpeedEnumOptions.add("38400");
VCPSpeedEnumOptions.add("57600");
VCPSpeedEnumOptions.add("115200");
fields.add( new UAVObjectField("VCPSpeed", "bps", UAVObjectField.FieldType.ENUM, VCPSpeedElemNames, VCPSpeedEnumOptions) );
List<String> RFSpeedElemNames = new ArrayList<String>();
RFSpeedElemNames.add("0");
List<String> RFSpeedEnumOptions = new ArrayList<String>();
RFSpeedEnumOptions.add("2400");
RFSpeedEnumOptions.add("4800");
RFSpeedEnumOptions.add("9600");
RFSpeedEnumOptions.add("19200");
RFSpeedEnumOptions.add("38400");
RFSpeedEnumOptions.add("57600");
RFSpeedEnumOptions.add("115200");
fields.add( new UAVObjectField("RFSpeed", "bps", UAVObjectField.FieldType.ENUM, RFSpeedElemNames, RFSpeedEnumOptions) );
List<String> MaxRFPowerElemNames = new ArrayList<String>();
MaxRFPowerElemNames.add("0");
List<String> MaxRFPowerEnumOptions = new ArrayList<String>();
MaxRFPowerEnumOptions.add("1.25");
MaxRFPowerEnumOptions.add("1.6");
MaxRFPowerEnumOptions.add("3.16");
MaxRFPowerEnumOptions.add("6.3");
MaxRFPowerEnumOptions.add("12.6");
MaxRFPowerEnumOptions.add("25");
MaxRFPowerEnumOptions.add("50");
MaxRFPowerEnumOptions.add("100");
fields.add( new UAVObjectField("MaxRFPower", "mW", UAVObjectField.FieldType.ENUM, MaxRFPowerElemNames, MaxRFPowerEnumOptions) );
List<String> MinPacketSizeElemNames = new ArrayList<String>();
MinPacketSizeElemNames.add("0");
fields.add( new UAVObjectField("MinPacketSize", "bytes", UAVObjectField.FieldType.UINT8, MinPacketSizeElemNames, null) );
List<String> FrequencyCalibrationElemNames = new ArrayList<String>();
FrequencyCalibrationElemNames.add("0");
fields.add( new UAVObjectField("FrequencyCalibration", "", UAVObjectField.FieldType.UINT8, FrequencyCalibrationElemNames, null) );
List<String> AESKeyElemNames = new ArrayList<String>();
AESKeyElemNames.add("0");
AESKeyElemNames.add("1");
AESKeyElemNames.add("2");
AESKeyElemNames.add("3");
AESKeyElemNames.add("4");
AESKeyElemNames.add("5");
AESKeyElemNames.add("6");
AESKeyElemNames.add("7");
AESKeyElemNames.add("8");
AESKeyElemNames.add("9");
AESKeyElemNames.add("10");
AESKeyElemNames.add("11");
AESKeyElemNames.add("12");
AESKeyElemNames.add("13");
AESKeyElemNames.add("14");
AESKeyElemNames.add("15");
AESKeyElemNames.add("16");
AESKeyElemNames.add("17");
AESKeyElemNames.add("18");
AESKeyElemNames.add("19");
AESKeyElemNames.add("20");
AESKeyElemNames.add("21");
AESKeyElemNames.add("22");
AESKeyElemNames.add("23");
AESKeyElemNames.add("24");
AESKeyElemNames.add("25");
AESKeyElemNames.add("26");
AESKeyElemNames.add("27");
AESKeyElemNames.add("28");
AESKeyElemNames.add("29");
AESKeyElemNames.add("30");
AESKeyElemNames.add("31");
fields.add( new UAVObjectField("AESKey", "", UAVObjectField.FieldType.UINT8, AESKeyElemNames, null) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.gcsTelemetryUpdatePeriod = 0;
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("PairID").setValue(0);
getField("Frequency").setValue(434000000);
getField("SendTimeout").setValue(50);
getField("TelemetryConfig").setValue("UAVTalk");
getField("TelemetrySpeed").setValue("57600");
getField("FlexiConfig").setValue("Disabled");
getField("FlexiSpeed").setValue("57600");
getField("VCPConfig").setValue("Disabled");
getField("VCPSpeed").setValue("57600");
getField("RFSpeed").setValue("115200");
getField("MaxRFPower").setValue("100");
getField("MinPacketSize").setValue(50);
getField("FrequencyCalibration").setValue(127);
getField("AESKey").setValue(0,0);
getField("AESKey").setValue(0,1);
getField("AESKey").setValue(0,2);
getField("AESKey").setValue(0,3);
getField("AESKey").setValue(0,4);
getField("AESKey").setValue(0,5);
getField("AESKey").setValue(0,6);
getField("AESKey").setValue(0,7);
getField("AESKey").setValue(0,8);
getField("AESKey").setValue(0,9);
getField("AESKey").setValue(0,10);
getField("AESKey").setValue(0,11);
getField("AESKey").setValue(0,12);
getField("AESKey").setValue(0,13);
getField("AESKey").setValue(0,14);
getField("AESKey").setValue(0,15);
getField("AESKey").setValue(0,16);
getField("AESKey").setValue(0,17);
getField("AESKey").setValue(0,18);
getField("AESKey").setValue(0,19);
getField("AESKey").setValue(0,20);
getField("AESKey").setValue(0,21);
getField("AESKey").setValue(0,22);
getField("AESKey").setValue(0,23);
getField("AESKey").setValue(0,24);
getField("AESKey").setValue(0,25);
getField("AESKey").setValue(0,26);
getField("AESKey").setValue(0,27);
getField("AESKey").setValue(0,28);
getField("AESKey").setValue(0,29);
getField("AESKey").setValue(0,30);
getField("AESKey").setValue(0,31);
}
/**
* 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 {
PipXSettings obj = new PipXSettings();
obj.initialize(instID, this.getMetaObject());
return obj;
} catch (Exception e) {
return null;
}
}
/**
* Static function to retrieve an instance of the object.
*/
public PipXSettings GetInstance(UAVObjectManager objMngr, int instID)
{
return (PipXSettings)(objMngr.getObject(PipXSettings.OBJID, instID));
}
// Constants
protected static final int OBJID = 0xBA192BCA;
protected static final String NAME = "PipXSettings";
protected static String DESCRIPTION = "PipXtreme configurations options.";
protected static final boolean ISSINGLEINST = 1 == 1;
protected static final boolean ISSETTINGS = 1 == 1;
protected static int NUMBYTES = 0;
}

View File

@ -0,0 +1,301 @@
/**
******************************************************************************
*
* @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.
* PipXtreme device status.
*
* @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;
/**
PipXtreme device status.
generated from pipxstatus.xml
**/
public class PipXStatus extends UAVDataObject {
public PipXStatus() {
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> MinFrequencyElemNames = new ArrayList<String>();
MinFrequencyElemNames.add("0");
fields.add( new UAVObjectField("MinFrequency", "Hz", UAVObjectField.FieldType.UINT32, MinFrequencyElemNames, null) );
List<String> MaxFrequencyElemNames = new ArrayList<String>();
MaxFrequencyElemNames.add("0");
fields.add( new UAVObjectField("MaxFrequency", "Hz", UAVObjectField.FieldType.UINT32, MaxFrequencyElemNames, null) );
List<String> FrequencyStepSizeElemNames = new ArrayList<String>();
FrequencyStepSizeElemNames.add("0");
fields.add( new UAVObjectField("FrequencyStepSize", "", UAVObjectField.FieldType.FLOAT32, FrequencyStepSizeElemNames, null) );
List<String> DeviceIDElemNames = new ArrayList<String>();
DeviceIDElemNames.add("0");
fields.add( new UAVObjectField("DeviceID", "", UAVObjectField.FieldType.UINT32, DeviceIDElemNames, null) );
List<String> AFCElemNames = new ArrayList<String>();
AFCElemNames.add("0");
fields.add( new UAVObjectField("AFC", "", UAVObjectField.FieldType.INT32, AFCElemNames, null) );
List<String> PairIDsElemNames = new ArrayList<String>();
PairIDsElemNames.add("0");
PairIDsElemNames.add("1");
PairIDsElemNames.add("2");
PairIDsElemNames.add("3");
fields.add( new UAVObjectField("PairIDs", "", UAVObjectField.FieldType.UINT32, PairIDsElemNames, null) );
List<String> BoardRevisionElemNames = new ArrayList<String>();
BoardRevisionElemNames.add("0");
fields.add( new UAVObjectField("BoardRevision", "", UAVObjectField.FieldType.UINT16, BoardRevisionElemNames, null) );
List<String> RetriesElemNames = new ArrayList<String>();
RetriesElemNames.add("0");
fields.add( new UAVObjectField("Retries", "", UAVObjectField.FieldType.UINT16, RetriesElemNames, null) );
List<String> ErrorsElemNames = new ArrayList<String>();
ErrorsElemNames.add("0");
fields.add( new UAVObjectField("Errors", "", UAVObjectField.FieldType.UINT16, ErrorsElemNames, null) );
List<String> UAVTalkErrorsElemNames = new ArrayList<String>();
UAVTalkErrorsElemNames.add("0");
fields.add( new UAVObjectField("UAVTalkErrors", "", UAVObjectField.FieldType.UINT16, UAVTalkErrorsElemNames, null) );
List<String> DroppedElemNames = new ArrayList<String>();
DroppedElemNames.add("0");
fields.add( new UAVObjectField("Dropped", "", UAVObjectField.FieldType.UINT16, DroppedElemNames, null) );
List<String> ResetsElemNames = new ArrayList<String>();
ResetsElemNames.add("0");
fields.add( new UAVObjectField("Resets", "", UAVObjectField.FieldType.UINT16, ResetsElemNames, null) );
List<String> TXRateElemNames = new ArrayList<String>();
TXRateElemNames.add("0");
fields.add( new UAVObjectField("TXRate", "Bps", UAVObjectField.FieldType.UINT16, TXRateElemNames, null) );
List<String> RXRateElemNames = new ArrayList<String>();
RXRateElemNames.add("0");
fields.add( new UAVObjectField("RXRate", "Bps", UAVObjectField.FieldType.UINT16, RXRateElemNames, null) );
List<String> DescriptionElemNames = new ArrayList<String>();
DescriptionElemNames.add("0");
DescriptionElemNames.add("1");
DescriptionElemNames.add("2");
DescriptionElemNames.add("3");
DescriptionElemNames.add("4");
DescriptionElemNames.add("5");
DescriptionElemNames.add("6");
DescriptionElemNames.add("7");
DescriptionElemNames.add("8");
DescriptionElemNames.add("9");
DescriptionElemNames.add("10");
DescriptionElemNames.add("11");
DescriptionElemNames.add("12");
DescriptionElemNames.add("13");
DescriptionElemNames.add("14");
DescriptionElemNames.add("15");
DescriptionElemNames.add("16");
DescriptionElemNames.add("17");
DescriptionElemNames.add("18");
DescriptionElemNames.add("19");
DescriptionElemNames.add("20");
DescriptionElemNames.add("21");
DescriptionElemNames.add("22");
DescriptionElemNames.add("23");
DescriptionElemNames.add("24");
DescriptionElemNames.add("25");
DescriptionElemNames.add("26");
DescriptionElemNames.add("27");
DescriptionElemNames.add("28");
DescriptionElemNames.add("29");
DescriptionElemNames.add("30");
DescriptionElemNames.add("31");
DescriptionElemNames.add("32");
DescriptionElemNames.add("33");
DescriptionElemNames.add("34");
DescriptionElemNames.add("35");
DescriptionElemNames.add("36");
DescriptionElemNames.add("37");
DescriptionElemNames.add("38");
DescriptionElemNames.add("39");
fields.add( new UAVObjectField("Description", "", UAVObjectField.FieldType.UINT8, DescriptionElemNames, null) );
List<String> CPUSerialElemNames = new ArrayList<String>();
CPUSerialElemNames.add("0");
CPUSerialElemNames.add("1");
CPUSerialElemNames.add("2");
CPUSerialElemNames.add("3");
CPUSerialElemNames.add("4");
CPUSerialElemNames.add("5");
CPUSerialElemNames.add("6");
CPUSerialElemNames.add("7");
CPUSerialElemNames.add("8");
CPUSerialElemNames.add("9");
CPUSerialElemNames.add("10");
CPUSerialElemNames.add("11");
fields.add( new UAVObjectField("CPUSerial", "", UAVObjectField.FieldType.UINT8, CPUSerialElemNames, null) );
List<String> BoardTypeElemNames = new ArrayList<String>();
BoardTypeElemNames.add("0");
fields.add( new UAVObjectField("BoardType", "", UAVObjectField.FieldType.UINT8, BoardTypeElemNames, null) );
List<String> FrequencyBandElemNames = new ArrayList<String>();
FrequencyBandElemNames.add("0");
fields.add( new UAVObjectField("FrequencyBand", "", UAVObjectField.FieldType.UINT8, FrequencyBandElemNames, null) );
List<String> RSSIElemNames = new ArrayList<String>();
RSSIElemNames.add("0");
fields.add( new UAVObjectField("RSSI", "dBm", UAVObjectField.FieldType.INT8, RSSIElemNames, null) );
List<String> LinkStateElemNames = new ArrayList<String>();
LinkStateElemNames.add("0");
List<String> LinkStateEnumOptions = new ArrayList<String>();
LinkStateEnumOptions.add("Disconnected");
LinkStateEnumOptions.add("Connecting");
LinkStateEnumOptions.add("Connected");
fields.add( new UAVObjectField("LinkState", "function", UAVObjectField.FieldType.ENUM, LinkStateElemNames, LinkStateEnumOptions) );
List<String> PairSignalStrengthsElemNames = new ArrayList<String>();
PairSignalStrengthsElemNames.add("0");
PairSignalStrengthsElemNames.add("1");
PairSignalStrengthsElemNames.add("2");
PairSignalStrengthsElemNames.add("3");
fields.add( new UAVObjectField("PairSignalStrengths", "dBm", UAVObjectField.FieldType.INT8, PairSignalStrengthsElemNames, null) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READONLY) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 1000;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
getField("MinFrequency").setValue(0);
getField("MaxFrequency").setValue(0);
getField("FrequencyStepSize").setValue(0);
getField("DeviceID").setValue(0);
getField("AFC").setValue(0);
getField("PairIDs").setValue(0,0);
getField("PairIDs").setValue(0,1);
getField("PairIDs").setValue(0,2);
getField("PairIDs").setValue(0,3);
getField("Retries").setValue(0);
getField("Errors").setValue(0);
getField("UAVTalkErrors").setValue(0);
getField("Dropped").setValue(0);
getField("Resets").setValue(0);
getField("TXRate").setValue(0);
getField("RXRate").setValue(0);
getField("FrequencyBand").setValue(0);
getField("RSSI").setValue(0);
getField("LinkState").setValue("Disconnected");
getField("PairSignalStrengths").setValue(-127,0);
getField("PairSignalStrengths").setValue(-127,1);
getField("PairSignalStrengths").setValue(-127,2);
getField("PairSignalStrengths").setValue(-127,3);
}
/**
* 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 {
PipXStatus obj = new PipXStatus();
obj.initialize(instID, this.getMetaObject());
return obj;
} catch (Exception e) {
return null;
}
}
/**
* Static function to retrieve an instance of the object.
*/
public PipXStatus GetInstance(UAVObjectManager objMngr, int instID)
{
return (PipXStatus)(objMngr.getObject(PipXStatus.OBJID, instID));
}
// Constants
protected static final int OBJID = 0x3FC68A86;
protected static final String NAME = "PipXStatus";
protected static String DESCRIPTION = "PipXtreme device status.";
protected static final boolean ISSINGLEINST = 1 == 1;
protected static final boolean ISSETTINGS = 0 == 1;
protected static int NUMBYTES = 0;
}

View File

@ -0,0 +1,249 @@
/**
******************************************************************************
*
* @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 INS 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 INS to control the algorithm and what is updated
generated from revocalibration.xml
**/
public class RevoCalibration extends UAVDataObject {
public RevoCalibration() {
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> accel_biasElemNames = new ArrayList<String>();
accel_biasElemNames.add("X");
accel_biasElemNames.add("Y");
accel_biasElemNames.add("Z");
fields.add( new UAVObjectField("accel_bias", "m/s", UAVObjectField.FieldType.FLOAT32, accel_biasElemNames, null) );
List<String> accel_scaleElemNames = new ArrayList<String>();
accel_scaleElemNames.add("X");
accel_scaleElemNames.add("Y");
accel_scaleElemNames.add("Z");
fields.add( new UAVObjectField("accel_scale", "gain", UAVObjectField.FieldType.FLOAT32, accel_scaleElemNames, null) );
List<String> accel_varElemNames = new ArrayList<String>();
accel_varElemNames.add("X");
accel_varElemNames.add("Y");
accel_varElemNames.add("Z");
fields.add( new UAVObjectField("accel_var", "(m/s)^2", UAVObjectField.FieldType.FLOAT32, accel_varElemNames, null) );
List<String> gyro_biasElemNames = new ArrayList<String>();
gyro_biasElemNames.add("X");
gyro_biasElemNames.add("Y");
gyro_biasElemNames.add("Z");
fields.add( new UAVObjectField("gyro_bias", "deg/s", UAVObjectField.FieldType.FLOAT32, gyro_biasElemNames, null) );
List<String> gyro_scaleElemNames = new ArrayList<String>();
gyro_scaleElemNames.add("X");
gyro_scaleElemNames.add("Y");
gyro_scaleElemNames.add("Z");
fields.add( new UAVObjectField("gyro_scale", "gain", UAVObjectField.FieldType.FLOAT32, gyro_scaleElemNames, null) );
List<String> gyro_varElemNames = new ArrayList<String>();
gyro_varElemNames.add("X");
gyro_varElemNames.add("Y");
gyro_varElemNames.add("Z");
fields.add( new UAVObjectField("gyro_var", "(deg/s)^2", UAVObjectField.FieldType.FLOAT32, gyro_varElemNames, null) );
List<String> gyro_tempcoeffElemNames = new ArrayList<String>();
gyro_tempcoeffElemNames.add("X");
gyro_tempcoeffElemNames.add("Y");
gyro_tempcoeffElemNames.add("Z");
fields.add( new UAVObjectField("gyro_tempcoeff", "(deg/s)/deg", UAVObjectField.FieldType.FLOAT32, gyro_tempcoeffElemNames, null) );
List<String> mag_biasElemNames = new ArrayList<String>();
mag_biasElemNames.add("X");
mag_biasElemNames.add("Y");
mag_biasElemNames.add("Z");
fields.add( new UAVObjectField("mag_bias", "mGau", UAVObjectField.FieldType.FLOAT32, mag_biasElemNames, null) );
List<String> mag_scaleElemNames = new ArrayList<String>();
mag_scaleElemNames.add("X");
mag_scaleElemNames.add("Y");
mag_scaleElemNames.add("Z");
fields.add( new UAVObjectField("mag_scale", "gain", UAVObjectField.FieldType.FLOAT32, mag_scaleElemNames, null) );
List<String> mag_varElemNames = new ArrayList<String>();
mag_varElemNames.add("X");
mag_varElemNames.add("Y");
mag_varElemNames.add("Z");
fields.add( new UAVObjectField("mag_var", "mGau^2", UAVObjectField.FieldType.FLOAT32, mag_varElemNames, null) );
List<String> gps_varElemNames = new ArrayList<String>();
gps_varElemNames.add("Pos");
gps_varElemNames.add("Vel");
fields.add( new UAVObjectField("gps_var", "m^2", UAVObjectField.FieldType.FLOAT32, gps_varElemNames, null) );
List<String> baro_varElemNames = new ArrayList<String>();
baro_varElemNames.add("0");
fields.add( new UAVObjectField("baro_var", "m^2", UAVObjectField.FieldType.FLOAT32, baro_varElemNames, null) );
List<String> MagBiasNullingRateElemNames = new ArrayList<String>();
MagBiasNullingRateElemNames.add("0");
fields.add( new UAVObjectField("MagBiasNullingRate", "", UAVObjectField.FieldType.FLOAT32, MagBiasNullingRateElemNames, null) );
List<String> BiasCorrectedRawElemNames = new ArrayList<String>();
BiasCorrectedRawElemNames.add("0");
List<String> BiasCorrectedRawEnumOptions = new ArrayList<String>();
BiasCorrectedRawEnumOptions.add("FALSE");
BiasCorrectedRawEnumOptions.add("TRUE");
fields.add( new UAVObjectField("BiasCorrectedRaw", "", UAVObjectField.FieldType.ENUM, BiasCorrectedRawElemNames, BiasCorrectedRawEnumOptions) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.gcsTelemetryUpdatePeriod = 0;
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(0,0);
getField("accel_bias").setValue(0,1);
getField("accel_bias").setValue(0,2);
getField("accel_scale").setValue(1,0);
getField("accel_scale").setValue(1,1);
getField("accel_scale").setValue(1,2);
getField("accel_var").setValue(0.01,0);
getField("accel_var").setValue(0.01,1);
getField("accel_var").setValue(0.01,2);
getField("gyro_bias").setValue(0,0);
getField("gyro_bias").setValue(0,1);
getField("gyro_bias").setValue(0,2);
getField("gyro_scale").setValue(1,0);
getField("gyro_scale").setValue(1,1);
getField("gyro_scale").setValue(1,2);
getField("gyro_var").setValue(0.01,0);
getField("gyro_var").setValue(0.01,1);
getField("gyro_var").setValue(0.01,2);
getField("gyro_tempcoeff").setValue(1,0);
getField("gyro_tempcoeff").setValue(1,1);
getField("gyro_tempcoeff").setValue(1,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(0.01,0);
getField("mag_var").setValue(0.01,1);
getField("mag_var").setValue(10,2);
getField("gps_var").setValue(1,0);
getField("gps_var").setValue(1,1);
getField("baro_var").setValue(1);
getField("MagBiasNullingRate").setValue(0);
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 {
RevoCalibration obj = new RevoCalibration();
obj.initialize(instID, this.getMetaObject());
return obj;
} catch (Exception e) {
return null;
}
}
/**
* Static function to retrieve an instance of the object.
*/
public RevoCalibration GetInstance(UAVObjectManager objMngr, int instID)
{
return (RevoCalibration)(objMngr.getObject(RevoCalibration.OBJID, instID));
}
// Constants
protected static final int OBJID = 0xA2A63C7C;
protected static final String NAME = "RevoCalibration";
protected static String DESCRIPTION = "Settings for the INS 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;
}

View File

@ -0,0 +1,143 @@
/**
******************************************************************************
*
* @file uavobjecttemplate.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Template for an uavobject in java
* This is a autogenerated file!! Do not modify and expect a result.
* Settings for the revo 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 revo to control the algorithm and what is updated
generated from revosettings.xml
**/
public class RevoSettings extends UAVDataObject {
public RevoSettings() {
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> FusionAlgorithmElemNames = new ArrayList<String>();
FusionAlgorithmElemNames.add("0");
List<String> FusionAlgorithmEnumOptions = new ArrayList<String>();
FusionAlgorithmEnumOptions.add("Complimentary");
FusionAlgorithmEnumOptions.add("INSIndoor");
FusionAlgorithmEnumOptions.add("INSOutdoor");
fields.add( new UAVObjectField("FusionAlgorithm", "", UAVObjectField.FieldType.ENUM, FusionAlgorithmElemNames, FusionAlgorithmEnumOptions) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.gcsTelemetryUpdatePeriod = 0;
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("FusionAlgorithm").setValue("Complimentary");
}
/**
* 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 {
RevoSettings obj = new RevoSettings();
obj.initialize(instID, this.getMetaObject());
return obj;
} catch (Exception e) {
return null;
}
}
/**
* Static function to retrieve an instance of the object.
*/
public RevoSettings GetInstance(UAVObjectManager objMngr, int instID)
{
return (RevoSettings)(objMngr.getObject(RevoSettings.OBJID, instID));
}
// Constants
protected static final int OBJID = 0xE2DA70EA;
protected static final String NAME = "RevoSettings";
protected static String DESCRIPTION = "Settings for the revo 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;
}

View File

@ -0,0 +1,225 @@
/**
******************************************************************************
*
* @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 used by @ref TxPID optional module to tune PID settings using R/C transmitter
*
* @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 used by @ref TxPID optional module to tune PID settings using R/C transmitter
generated from txpidsettings.xml
**/
public class TxPIDSettings extends UAVDataObject {
public TxPIDSettings() {
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> ThrottleRangeElemNames = new ArrayList<String>();
ThrottleRangeElemNames.add("Min");
ThrottleRangeElemNames.add("Max");
fields.add( new UAVObjectField("ThrottleRange", "%", UAVObjectField.FieldType.FLOAT32, ThrottleRangeElemNames, null) );
List<String> MinPIDElemNames = new ArrayList<String>();
MinPIDElemNames.add("Instance1");
MinPIDElemNames.add("Instance2");
MinPIDElemNames.add("Instance3");
fields.add( new UAVObjectField("MinPID", "", UAVObjectField.FieldType.FLOAT32, MinPIDElemNames, null) );
List<String> MaxPIDElemNames = new ArrayList<String>();
MaxPIDElemNames.add("Instance1");
MaxPIDElemNames.add("Instance2");
MaxPIDElemNames.add("Instance3");
fields.add( new UAVObjectField("MaxPID", "", UAVObjectField.FieldType.FLOAT32, MaxPIDElemNames, null) );
List<String> UpdateModeElemNames = new ArrayList<String>();
UpdateModeElemNames.add("0");
List<String> UpdateModeEnumOptions = new ArrayList<String>();
UpdateModeEnumOptions.add("Never");
UpdateModeEnumOptions.add("When Armed");
UpdateModeEnumOptions.add("Always");
fields.add( new UAVObjectField("UpdateMode", "option", UAVObjectField.FieldType.ENUM, UpdateModeElemNames, UpdateModeEnumOptions) );
List<String> InputsElemNames = new ArrayList<String>();
InputsElemNames.add("Instance1");
InputsElemNames.add("Instance2");
InputsElemNames.add("Instance3");
List<String> InputsEnumOptions = new ArrayList<String>();
InputsEnumOptions.add("Throttle");
InputsEnumOptions.add("Accessory0");
InputsEnumOptions.add("Accessory1");
InputsEnumOptions.add("Accessory2");
InputsEnumOptions.add("Accessory3");
InputsEnumOptions.add("Accessory4");
InputsEnumOptions.add("Accessory5");
fields.add( new UAVObjectField("Inputs", "channel", UAVObjectField.FieldType.ENUM, InputsElemNames, InputsEnumOptions) );
List<String> PIDsElemNames = new ArrayList<String>();
PIDsElemNames.add("Instance1");
PIDsElemNames.add("Instance2");
PIDsElemNames.add("Instance3");
List<String> PIDsEnumOptions = new ArrayList<String>();
PIDsEnumOptions.add("Disabled");
PIDsEnumOptions.add("Roll Rate.Kp");
PIDsEnumOptions.add("Pitch Rate.Kp");
PIDsEnumOptions.add("Roll+Pitch Rate.Kp");
PIDsEnumOptions.add("Yaw Rate.Kp");
PIDsEnumOptions.add("Roll Rate.Ki");
PIDsEnumOptions.add("Pitch Rate.Ki");
PIDsEnumOptions.add("Roll+Pitch Rate.Ki");
PIDsEnumOptions.add("Yaw Rate.Ki");
PIDsEnumOptions.add("Roll Rate.Kd");
PIDsEnumOptions.add("Pitch Rate.Kd");
PIDsEnumOptions.add("Roll+Pitch Rate.Kd");
PIDsEnumOptions.add("Yaw Rate.Kd");
PIDsEnumOptions.add("Roll Rate.ILimit");
PIDsEnumOptions.add("Pitch Rate.ILimit");
PIDsEnumOptions.add("Roll+Pitch Rate.ILimit");
PIDsEnumOptions.add("Yaw Rate.ILimit");
PIDsEnumOptions.add("Roll Attitude.Kp");
PIDsEnumOptions.add("Pitch Attitude.Kp");
PIDsEnumOptions.add("Roll+Pitch Attitude.Kp");
PIDsEnumOptions.add("Yaw Attitude.Kp");
PIDsEnumOptions.add("Roll Attitude.Ki");
PIDsEnumOptions.add("Pitch Attitude.Ki");
PIDsEnumOptions.add("Roll+Pitch Attitude.Ki");
PIDsEnumOptions.add("Yaw Attitude.Ki");
PIDsEnumOptions.add("Roll Attitude.ILimit");
PIDsEnumOptions.add("Pitch Attitude.ILimit");
PIDsEnumOptions.add("Roll+Pitch Attitude.ILimit");
PIDsEnumOptions.add("Yaw Attitude.ILimit");
PIDsEnumOptions.add("GyroTau");
fields.add( new UAVObjectField("PIDs", "option", UAVObjectField.FieldType.ENUM, PIDsElemNames, PIDsEnumOptions) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.gcsTelemetryUpdatePeriod = 0;
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("ThrottleRange").setValue(0.2,0);
getField("ThrottleRange").setValue(0.8,1);
getField("MinPID").setValue(0,0);
getField("MinPID").setValue(0,1);
getField("MinPID").setValue(0,2);
getField("MaxPID").setValue(0,0);
getField("MaxPID").setValue(0,1);
getField("MaxPID").setValue(0,2);
getField("UpdateMode").setValue("When Armed");
getField("Inputs").setValue("Throttle",0);
getField("Inputs").setValue("Accessory0",1);
getField("Inputs").setValue("Accessory1",2);
getField("PIDs").setValue("Disabled",0);
getField("PIDs").setValue("Disabled",1);
getField("PIDs").setValue("Disabled",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 {
TxPIDSettings obj = new TxPIDSettings();
obj.initialize(instID, this.getMetaObject());
return obj;
} catch (Exception e) {
return null;
}
}
/**
* Static function to retrieve an instance of the object.
*/
public TxPIDSettings GetInstance(UAVObjectManager objMngr, int instID)
{
return (TxPIDSettings)(objMngr.getObject(TxPIDSettings.OBJID, instID));
}
// Constants
protected static final int OBJID = 0x42B2D2AE;
protected static final String NAME = "TxPIDSettings";
protected static String DESCRIPTION = "Settings used by @ref TxPID optional module to tune PID settings using R/C transmitter";
protected static final boolean ISSINGLEINST = 1 == 1;
protected static final boolean ISSETTINGS = 1 == 1;
protected static int NUMBYTES = 0;
}

View File

@ -0,0 +1,232 @@
/**
******************************************************************************
*
* @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 VtolPathFollower 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;
/**
Settings for the @ref VtolPathFollower module
generated from vtolpathfollowersettings.xml
**/
public class VtolPathFollowerSettings extends UAVDataObject {
public VtolPathFollowerSettings() {
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> HorizontalPosPIElemNames = new ArrayList<String>();
HorizontalPosPIElemNames.add("Kp");
HorizontalPosPIElemNames.add("Ki");
HorizontalPosPIElemNames.add("ILimit");
fields.add( new UAVObjectField("HorizontalPosPI", "(m/s)/m", UAVObjectField.FieldType.FLOAT32, HorizontalPosPIElemNames, null) );
List<String> HorizontalVelPIDElemNames = new ArrayList<String>();
HorizontalVelPIDElemNames.add("Kp");
HorizontalVelPIDElemNames.add("Ki");
HorizontalVelPIDElemNames.add("Kd");
HorizontalVelPIDElemNames.add("ILimit");
fields.add( new UAVObjectField("HorizontalVelPID", "deg/(m/s)", UAVObjectField.FieldType.FLOAT32, HorizontalVelPIDElemNames, null) );
List<String> VerticalPosPIElemNames = new ArrayList<String>();
VerticalPosPIElemNames.add("Kp");
VerticalPosPIElemNames.add("Ki");
VerticalPosPIElemNames.add("ILimit");
fields.add( new UAVObjectField("VerticalPosPI", "", UAVObjectField.FieldType.FLOAT32, VerticalPosPIElemNames, null) );
List<String> VerticalVelPIDElemNames = new ArrayList<String>();
VerticalVelPIDElemNames.add("Kp");
VerticalVelPIDElemNames.add("Ki");
VerticalVelPIDElemNames.add("Kd");
VerticalVelPIDElemNames.add("ILimit");
fields.add( new UAVObjectField("VerticalVelPID", "", UAVObjectField.FieldType.FLOAT32, VerticalVelPIDElemNames, null) );
List<String> VelocityFeedforwardElemNames = new ArrayList<String>();
VelocityFeedforwardElemNames.add("0");
fields.add( new UAVObjectField("VelocityFeedforward", "deg/(m/s)", UAVObjectField.FieldType.FLOAT32, VelocityFeedforwardElemNames, null) );
List<String> MaxRollPitchElemNames = new ArrayList<String>();
MaxRollPitchElemNames.add("0");
fields.add( new UAVObjectField("MaxRollPitch", "deg", UAVObjectField.FieldType.FLOAT32, MaxRollPitchElemNames, null) );
List<String> UpdatePeriodElemNames = new ArrayList<String>();
UpdatePeriodElemNames.add("0");
fields.add( new UAVObjectField("UpdatePeriod", "ms", UAVObjectField.FieldType.INT32, UpdatePeriodElemNames, null) );
List<String> HorizontalVelMaxElemNames = new ArrayList<String>();
HorizontalVelMaxElemNames.add("0");
fields.add( new UAVObjectField("HorizontalVelMax", "m/s", UAVObjectField.FieldType.UINT16, HorizontalVelMaxElemNames, null) );
List<String> VerticalVelMaxElemNames = new ArrayList<String>();
VerticalVelMaxElemNames.add("0");
fields.add( new UAVObjectField("VerticalVelMax", "m/s", UAVObjectField.FieldType.UINT16, VerticalVelMaxElemNames, null) );
List<String> GuidanceModeElemNames = new ArrayList<String>();
GuidanceModeElemNames.add("0");
List<String> GuidanceModeEnumOptions = new ArrayList<String>();
GuidanceModeEnumOptions.add("DUAL_LOOP");
GuidanceModeEnumOptions.add("VELOCITY_CONTROL");
fields.add( new UAVObjectField("GuidanceMode", "", UAVObjectField.FieldType.ENUM, GuidanceModeElemNames, GuidanceModeEnumOptions) );
List<String> ThrottleControlElemNames = new ArrayList<String>();
ThrottleControlElemNames.add("0");
List<String> ThrottleControlEnumOptions = new ArrayList<String>();
ThrottleControlEnumOptions.add("FALSE");
ThrottleControlEnumOptions.add("TRUE");
fields.add( new UAVObjectField("ThrottleControl", "", UAVObjectField.FieldType.ENUM, ThrottleControlElemNames, ThrottleControlEnumOptions) );
List<String> VelocitySourceElemNames = new ArrayList<String>();
VelocitySourceElemNames.add("0");
List<String> VelocitySourceEnumOptions = new ArrayList<String>();
VelocitySourceEnumOptions.add("EKF");
VelocitySourceEnumOptions.add("NEDVEL");
VelocitySourceEnumOptions.add("GPSPOS");
fields.add( new UAVObjectField("VelocitySource", "", UAVObjectField.FieldType.ENUM, VelocitySourceElemNames, VelocitySourceEnumOptions) );
List<String> PositionSourceElemNames = new ArrayList<String>();
PositionSourceElemNames.add("0");
List<String> PositionSourceEnumOptions = new ArrayList<String>();
PositionSourceEnumOptions.add("EKF");
PositionSourceEnumOptions.add("GPSPOS");
fields.add( new UAVObjectField("PositionSource", "", UAVObjectField.FieldType.ENUM, PositionSourceElemNames, PositionSourceEnumOptions) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.gcsTelemetryUpdatePeriod = 0;
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("HorizontalPosPI").setValue(1,0);
getField("HorizontalPosPI").setValue(0,1);
getField("HorizontalPosPI").setValue(0,2);
getField("HorizontalVelPID").setValue(5,0);
getField("HorizontalVelPID").setValue(0,1);
getField("HorizontalVelPID").setValue(1,2);
getField("HorizontalVelPID").setValue(0,3);
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("VelocityFeedforward").setValue(0);
getField("MaxRollPitch").setValue(20);
getField("UpdatePeriod").setValue(100);
getField("HorizontalVelMax").setValue(10);
getField("VerticalVelMax").setValue(1);
getField("GuidanceMode").setValue("DUAL_LOOP");
getField("ThrottleControl").setValue("FALSE");
getField("VelocitySource").setValue("EKF");
getField("PositionSource").setValue("EKF");
}
/**
* 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 {
VtolPathFollowerSettings obj = new VtolPathFollowerSettings();
obj.initialize(instID, this.getMetaObject());
return obj;
} catch (Exception e) {
return null;
}
}
/**
* Static function to retrieve an instance of the object.
*/
public VtolPathFollowerSettings GetInstance(UAVObjectManager objMngr, int instID)
{
return (VtolPathFollowerSettings)(objMngr.getObject(VtolPathFollowerSettings.OBJID, instID));
}
// Constants
protected static final int OBJID = 0x973991F6;
protected static final String NAME = "VtolPathFollowerSettings";
protected static String DESCRIPTION = "Settings for the @ref VtolPathFollower module";
protected static final boolean ISSINGLEINST = 1 == 1;
protected static final boolean ISSETTINGS = 1 == 1;
protected static int NUMBYTES = 0;
}

View File

@ -0,0 +1,159 @@
/**
******************************************************************************
*
* @file uavobjecttemplate.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Template for an uavobject in java
* This is a autogenerated file!! Do not modify and expect a result.
* A waypoint the aircraft can try and hit. Used by the @ref PathPlanner 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;
/**
A waypoint the aircraft can try and hit. Used by the @ref PathPlanner module
generated from waypoint.xml
**/
public class Waypoint extends UAVDataObject {
public Waypoint() {
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> PositionElemNames = new ArrayList<String>();
PositionElemNames.add("North");
PositionElemNames.add("East");
PositionElemNames.add("Down");
fields.add( new UAVObjectField("Position", "m", UAVObjectField.FieldType.FLOAT32, PositionElemNames, null) );
List<String> VelocityElemNames = new ArrayList<String>();
VelocityElemNames.add("North");
VelocityElemNames.add("East");
VelocityElemNames.add("Down");
fields.add( new UAVObjectField("Velocity", "m/s", UAVObjectField.FieldType.FLOAT32, VelocityElemNames, null) );
List<String> YawDesiredElemNames = new ArrayList<String>();
YawDesiredElemNames.add("0");
fields.add( new UAVObjectField("YawDesired", "deg", UAVObjectField.FieldType.FLOAT32, YawDesiredElemNames, null) );
List<String> ActionElemNames = new ArrayList<String>();
ActionElemNames.add("0");
List<String> ActionEnumOptions = new ArrayList<String>();
ActionEnumOptions.add("PathToNext");
ActionEnumOptions.add("EndpointToNext");
ActionEnumOptions.add("Land");
ActionEnumOptions.add("Stop");
fields.add( new UAVObjectField("Action", "", UAVObjectField.FieldType.ENUM, ActionElemNames, ActionEnumOptions) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 4000;
metadata.gcsTelemetryUpdatePeriod = 0;
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 {
Waypoint obj = new Waypoint();
obj.initialize(instID, this.getMetaObject());
return obj;
} catch (Exception e) {
return null;
}
}
/**
* Static function to retrieve an instance of the object.
*/
public Waypoint GetInstance(UAVObjectManager objMngr, int instID)
{
return (Waypoint)(objMngr.getObject(Waypoint.OBJID, instID));
}
// Constants
protected static final int OBJID = 0x338C5F90;
protected static final String NAME = "Waypoint";
protected static String DESCRIPTION = "A waypoint the aircraft can try and hit. Used by the @ref PathPlanner module";
protected static final boolean ISSINGLEINST = 0 == 1;
protected static final boolean ISSETTINGS = 0 == 1;
protected static int NUMBYTES = 0;
}

View File

@ -0,0 +1,138 @@
/**
******************************************************************************
*
* @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.
* Indicates the currently active waypoint
*
* @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;
/**
Indicates the currently active waypoint
generated from waypointactive.xml
**/
public class WaypointActive extends UAVDataObject {
public WaypointActive() {
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> IndexElemNames = new ArrayList<String>();
IndexElemNames.add("0");
fields.add( new UAVObjectField("Index", "", UAVObjectField.FieldType.UINT8, IndexElemNames, null) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.gcsTelemetryUpdatePeriod = 0;
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 {
WaypointActive obj = new WaypointActive();
obj.initialize(instID, this.getMetaObject());
return obj;
} catch (Exception e) {
return null;
}
}
/**
* Static function to retrieve an instance of the object.
*/
public WaypointActive GetInstance(UAVObjectManager objMngr, int instID)
{
return (WaypointActive)(objMngr.getObject(WaypointActive.OBJID, instID));
}
// Constants
protected static final int OBJID = 0x1EA5B192;
protected static final String NAME = "WaypointActive";
protected static String DESCRIPTION = "Indicates the currently active waypoint";
protected static final boolean ISSINGLEINST = 1 == 1;
protected static final boolean ISSETTINGS = 0 == 1;
protected static int NUMBYTES = 0;
}