1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-17 02:52:12 +01:00

Finish porting the meta data changes from GCS and update all the UAVOs

This commit is contained in:
James Cotton 2012-08-02 12:49:34 -05:00
parent 1a63c21be9
commit 62bb4601c5
53 changed files with 880 additions and 1244 deletions

View File

@ -10,8 +10,6 @@ import java.util.Queue;
import java.util.Timer;
import java.util.TimerTask;
import org.openpilot.uavtalk.UAVObject.Acked;
import android.util.Log;
public class Telemetry {
@ -20,7 +18,7 @@ public class Telemetry {
public static int LOGLEVEL = 0;
public static boolean WARN = LOGLEVEL > 1;
public static boolean DEBUG = LOGLEVEL > 0;
public class TelemetryStats {
public int txBytes;
public int rxBytes;
@ -50,7 +48,7 @@ public class Telemetry {
boolean allInstances;
boolean objRequest;
int retriesRemaining;
Acked acked;
boolean acked;
} ;
/**
@ -249,7 +247,7 @@ public class Telemetry {
// Setup object depending on update mode
int eventMask;
if ( metadata.gcsTelemetryUpdateMode == UAVObject.UpdateMode.UPDATEMODE_PERIODIC )
if ( metadata.GetGcsTelemetryUpdateMode() == UAVObject.UpdateMode.UPDATEMODE_PERIODIC )
{
// Set update period
setUpdatePeriod(obj, metadata.gcsTelemetryUpdatePeriod);
@ -260,7 +258,7 @@ public class Telemetry {
connectToObjectInstances(obj, eventMask);
}
else if ( metadata.gcsTelemetryUpdateMode == UAVObject.UpdateMode.UPDATEMODE_ONCHANGE )
else if ( metadata.GetGcsTelemetryUpdateMode() == UAVObject.UpdateMode.UPDATEMODE_ONCHANGE )
{
// Set update period
setUpdatePeriod(obj, 0);
@ -271,7 +269,11 @@ public class Telemetry {
connectToObjectInstances(obj, eventMask);
}
else if ( metadata.gcsTelemetryUpdateMode == UAVObject.UpdateMode.UPDATEMODE_MANUAL )
else if ( metadata.GetGcsTelemetryUpdateMode() == UAVObject.UpdateMode.UPDATEMODE_THROTTLED )
{
// TODO
}
else if ( metadata.GetGcsTelemetryUpdateMode() == UAVObject.UpdateMode.UPDATEMODE_MANUAL )
{
// Set update period
setUpdatePeriod(obj, 0);
@ -282,13 +284,6 @@ public class Telemetry {
connectToObjectInstances(obj, eventMask);
}
else if ( metadata.gcsTelemetryUpdateMode == UAVObject.UpdateMode.UPDATEMODE_NEVER )
{
// Set update period
setUpdatePeriod(obj, 0);
// Disconnect from object
connectToObjectInstances(obj, 0);
}
}
/**
@ -360,10 +355,10 @@ public class Telemetry {
}
else
{
utalk.sendObject(transInfo.obj, transInfo.acked == Acked.TRUE, transInfo.allInstances);
utalk.sendObject(transInfo.obj, transInfo.acked, transInfo.allInstances);
}
// Start timer if a response is expected
if ( transInfo.objRequest || transInfo.acked == Acked.TRUE )
if ( transInfo.objRequest || transInfo.acked )
{
transTimerSetPeriod(REQ_TIMEOUT_MS);
}
@ -476,7 +471,7 @@ public class Telemetry {
transInfo.obj = objInfo.obj;
transInfo.allInstances = objInfo.allInstances;
transInfo.retriesRemaining = MAX_RETRIES;
transInfo.acked = metadata.gcsTelemetryAcked;
transInfo.acked = metadata.GetGcsTelemetryAcked();
if ( objInfo.event == EV_UPDATED || objInfo.event == EV_UPDATED_MANUAL )
{
transInfo.objRequest = false;

View File

@ -76,27 +76,24 @@ public class TelemetryMonitor extends Observable{
List <UAVObject> instList = objListIterator.next();
UAVObject obj = instList.get(0);
UAVObject.Metadata mdata = obj.getMetadata();
if ( mdata.gcsTelemetryUpdateMode != UAVObject.UpdateMode.UPDATEMODE_NEVER )
if ( obj.isMetadata() )
{
if ( obj.isMetadata() )
{
queue.add(obj);
}
else /* Data object */
{
UAVDataObject dobj = (UAVDataObject) obj;
if ( dobj.isSettings() )
{
queue.add(obj);
}
else
{
if ( mdata.flightTelemetryUpdateMode == UAVObject.UpdateMode.UPDATEMODE_ONCHANGE )
{
queue.add(obj);
}
}
}
queue.add(obj);
}
else /* Data object */
{
UAVDataObject dobj = (UAVDataObject) obj;
if ( dobj.isSettings() )
{
queue.add(obj);
}
else
{
if ( mdata.GetFlightTelemetryUpdateMode() == UAVObject.UpdateMode.UPDATEMODE_ONCHANGE )
{
queue.add(obj);
}
}
}
}
// Start retrieving

View File

@ -133,7 +133,15 @@ public abstract class UAVObject {
ACCESS_READWRITE, ACCESS_READONLY
};
public final class Metadata {
public final static int UAVOBJ_ACCESS_SHIFT = 0;
public final static int UAVOBJ_GCS_ACCESS_SHIFT = 1;
public final static int UAVOBJ_TELEMETRY_ACKED_SHIFT = 2;
public final static int UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT = 3;
public final static int UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT = 4;
public final static int UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT = 6;
public final static int UAVOBJ_UPDATE_MODE_MASK = 0x3;
public final static class Metadata {
/**
* Object metadata, each object has a meta object that holds its metadata. The metadata define
* properties for each object and can be used by multiple modules (e.g. telemetry and logger)
@ -164,6 +172,190 @@ public abstract class UAVObject {
* Update period used by the logging module (only if logging mode is
* PERIODIC)
*/
/**
* @brief Helper method for metadata accessors
* @param var The starting value
* @param shift The offset of these bits
* @param value The new value
* @param mask The mask of these bits
* @return
*/
private void SET_BITS(int shift, int value, int mask) {
this.flags = (this.flags & ~(mask << shift)) | (value << shift);
}
/**
* Get the UAVObject metadata access member
* \return the access type
*/
public AccessMode GetFlightAccess()
{
return AccessModeEnum((this.flags >> UAVOBJ_ACCESS_SHIFT) & 1);
}
/**
* Set the UAVObject metadata access member
* \param[in] mode The access mode
*/
public void SetFlightAccess(Metadata metadata, AccessMode mode)
{
// Need to convert java enums which have no numeric value to bits
SET_BITS(UAVOBJ_ACCESS_SHIFT, AccessModeNum(mode), 1);
}
/**
* Get the UAVObject metadata GCS access member
* \return the GCS access type
*/
public AccessMode GetGcsAccess()
{
return AccessModeEnum((this.flags >> UAVOBJ_GCS_ACCESS_SHIFT) & 1);
}
/**
* Set the UAVObject metadata GCS access member
* \param[in] mode The access mode
*/
public void SetGcsAccess(Metadata metadata, AccessMode mode) {
// Need to convert java enums which have no numeric value to bits
SET_BITS(UAVOBJ_GCS_ACCESS_SHIFT, AccessModeNum(mode), 1);
}
/**
* Get the UAVObject metadata telemetry acked member
* \return the telemetry acked boolean
*/
public boolean GetFlightTelemetryAcked() {
return (((this.flags >> UAVOBJ_TELEMETRY_ACKED_SHIFT) & 1) == 1);
}
/**
* Set the UAVObject metadata telemetry acked member
* \param[in] val The telemetry acked boolean
*/
public void SetFlightTelemetryAcked(boolean val) {
SET_BITS(UAVOBJ_TELEMETRY_ACKED_SHIFT, val ? 1 : 0, 1);
}
/**
* Get the UAVObject metadata GCS telemetry acked member
* \return the telemetry acked boolean
*/
public boolean GetGcsTelemetryAcked() {
return ((this.flags >> UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT) & 1) == 1;
}
/**
* Set the UAVObject metadata GCS telemetry acked member
* \param[in] val The GCS telemetry acked boolean
*/
public void SetGcsTelemetryAcked(boolean val) {
SET_BITS(UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT, val ? 1 : 0, 1);
}
/**
* Maps from the bitfield number to the symbolic java enumeration
* @param num The value in the bitfield after shifting
* @return The update mode
*/
public static AccessMode AccessModeEnum(int num) {
switch(num) {
case 0:
return AccessMode.ACCESS_READONLY;
case 1:
return AccessMode.ACCESS_READWRITE;
}
return AccessMode.ACCESS_READONLY;
}
/**
* Maps from the java symbolic enumeration of update mode to the bitfield value
* @param e The update mode
* @return The numeric value to use on the wire
*/
public static int AccessModeNum(AccessMode e) {
switch(e) {
case ACCESS_READONLY:
return 0;
case ACCESS_READWRITE:
return 1;
}
return 0;
}
/**
* Maps from the bitfield number to the symbolic java enumeration
* @param num The value in the bitfield after shifting
* @return The update mode
*/
public static UpdateMode UpdateModeEnum(int num) {
switch(num) {
case 0:
return UpdateMode.UPDATEMODE_MANUAL;
case 1:
return UpdateMode.UPDATEMODE_PERIODIC;
case 2:
return UpdateMode.UPDATEMODE_ONCHANGE;
default:
return UpdateMode.UPDATEMODE_THROTTLED;
}
}
/**
* Maps from the java symbolic enumeration of update mode to the bitfield value
* @param e The update mode
* @return The numeric value to use on the wire
*/
public static int UpdateModeNum(UpdateMode e) {
switch(e) {
case UPDATEMODE_MANUAL:
return 0;
case UPDATEMODE_PERIODIC:
return 1;
case UPDATEMODE_ONCHANGE:
return 2;
case UPDATEMODE_THROTTLED:
return 3;
}
return 0;
}
/**
* Get the UAVObject metadata telemetry update mode
* \return the telemetry update mode
*/
public UpdateMode GetFlightTelemetryUpdateMode() {
return UpdateModeEnum((this.flags >> UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT) & UAVOBJ_UPDATE_MODE_MASK);
}
/**
* Set the UAVObject metadata telemetry update mode member
* \param[in] metadata The metadata object
* \param[in] val The telemetry update mode
*/
public void SetFlightTelemetryUpdateMode(UpdateMode val) {
SET_BITS(UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT, UpdateModeNum(val), UAVOBJ_UPDATE_MODE_MASK);
}
/**
* Get the UAVObject metadata GCS telemetry update mode
* \param[in] metadata The metadata object
* \return the GCS telemetry update mode
*/
public UpdateMode GetGcsTelemetryUpdateMode() {
return UpdateModeEnum((this.flags >> UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT) & UAVOBJ_UPDATE_MODE_MASK);
}
/**
* Set the UAVObject metadata GCS telemetry update mode member
* \param[in] metadata The metadata object
* \param[in] val The GCS telemetry update mode
*/
public void SetGcsTelemetryUpdateMode(UpdateMode val) {
SET_BITS(UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT, UpdateModeNum(val), UAVOBJ_UPDATE_MODE_MASK);
}
};
public UAVObject(int objID, Boolean isSingleInst, String name) {

View File

@ -314,7 +314,7 @@ public class UAVObjectField {
// Get metadata
UAVObject.Metadata mdata = obj.getMetadata();
// Update value if the access mode permits
if ( mdata.gcsAccess == UAVObject.AccessMode.ACCESS_READWRITE )
if ( mdata.GetGcsAccess() == UAVObject.AccessMode.ACCESS_READWRITE )
{
switch (type)
{

View File

@ -78,18 +78,17 @@ public class AccessoryDesired extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_NEVER;
metadata.loggingUpdatePeriod = 0;
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;
}

View File

@ -99,18 +99,17 @@ public class ActuatorCommand extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_NEVER;
metadata.loggingUpdatePeriod = 0;
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;
}

View File

@ -98,18 +98,17 @@ public class ActuatorDesired extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_NEVER;
metadata.loggingUpdatePeriod = 0;
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;
}

View File

@ -97,246 +97,6 @@ public class ActuatorSettings extends UAVDataObject {
ChannelMinElemNames.add("9");
fields.add( new UAVObjectField("ChannelMin", "us", UAVObjectField.FieldType.INT16, ChannelMinElemNames, null) );
List<String> FixedWingRoll1ElemNames = new ArrayList<String>();
FixedWingRoll1ElemNames.add("0");
List<String> FixedWingRoll1EnumOptions = new ArrayList<String>();
FixedWingRoll1EnumOptions.add("Channel1");
FixedWingRoll1EnumOptions.add("Channel2");
FixedWingRoll1EnumOptions.add("Channel3");
FixedWingRoll1EnumOptions.add("Channel4");
FixedWingRoll1EnumOptions.add("Channel5");
FixedWingRoll1EnumOptions.add("Channel6");
FixedWingRoll1EnumOptions.add("Channel7");
FixedWingRoll1EnumOptions.add("Channel8");
FixedWingRoll1EnumOptions.add("Channel9");
FixedWingRoll1EnumOptions.add("Channel10");
FixedWingRoll1EnumOptions.add("None");
fields.add( new UAVObjectField("FixedWingRoll1", "channel", UAVObjectField.FieldType.ENUM, FixedWingRoll1ElemNames, FixedWingRoll1EnumOptions) );
List<String> FixedWingRoll2ElemNames = new ArrayList<String>();
FixedWingRoll2ElemNames.add("0");
List<String> FixedWingRoll2EnumOptions = new ArrayList<String>();
FixedWingRoll2EnumOptions.add("Channel1");
FixedWingRoll2EnumOptions.add("Channel2");
FixedWingRoll2EnumOptions.add("Channel3");
FixedWingRoll2EnumOptions.add("Channel4");
FixedWingRoll2EnumOptions.add("Channel5");
FixedWingRoll2EnumOptions.add("Channel6");
FixedWingRoll2EnumOptions.add("Channel7");
FixedWingRoll2EnumOptions.add("Channel8");
FixedWingRoll2EnumOptions.add("Channel9");
FixedWingRoll2EnumOptions.add("Channel10");
FixedWingRoll2EnumOptions.add("None");
fields.add( new UAVObjectField("FixedWingRoll2", "channel", UAVObjectField.FieldType.ENUM, FixedWingRoll2ElemNames, FixedWingRoll2EnumOptions) );
List<String> FixedWingPitch1ElemNames = new ArrayList<String>();
FixedWingPitch1ElemNames.add("0");
List<String> FixedWingPitch1EnumOptions = new ArrayList<String>();
FixedWingPitch1EnumOptions.add("Channel1");
FixedWingPitch1EnumOptions.add("Channel2");
FixedWingPitch1EnumOptions.add("Channel3");
FixedWingPitch1EnumOptions.add("Channel4");
FixedWingPitch1EnumOptions.add("Channel5");
FixedWingPitch1EnumOptions.add("Channel6");
FixedWingPitch1EnumOptions.add("Channel7");
FixedWingPitch1EnumOptions.add("Channel8");
FixedWingPitch1EnumOptions.add("Channel9");
FixedWingPitch1EnumOptions.add("Channel10");
FixedWingPitch1EnumOptions.add("None");
fields.add( new UAVObjectField("FixedWingPitch1", "channel", UAVObjectField.FieldType.ENUM, FixedWingPitch1ElemNames, FixedWingPitch1EnumOptions) );
List<String> FixedWingPitch2ElemNames = new ArrayList<String>();
FixedWingPitch2ElemNames.add("0");
List<String> FixedWingPitch2EnumOptions = new ArrayList<String>();
FixedWingPitch2EnumOptions.add("Channel1");
FixedWingPitch2EnumOptions.add("Channel2");
FixedWingPitch2EnumOptions.add("Channel3");
FixedWingPitch2EnumOptions.add("Channel4");
FixedWingPitch2EnumOptions.add("Channel5");
FixedWingPitch2EnumOptions.add("Channel6");
FixedWingPitch2EnumOptions.add("Channel7");
FixedWingPitch2EnumOptions.add("Channel8");
FixedWingPitch2EnumOptions.add("Channel9");
FixedWingPitch2EnumOptions.add("Channel10");
FixedWingPitch2EnumOptions.add("None");
fields.add( new UAVObjectField("FixedWingPitch2", "channel", UAVObjectField.FieldType.ENUM, FixedWingPitch2ElemNames, FixedWingPitch2EnumOptions) );
List<String> FixedWingYaw1ElemNames = new ArrayList<String>();
FixedWingYaw1ElemNames.add("0");
List<String> FixedWingYaw1EnumOptions = new ArrayList<String>();
FixedWingYaw1EnumOptions.add("Channel1");
FixedWingYaw1EnumOptions.add("Channel2");
FixedWingYaw1EnumOptions.add("Channel3");
FixedWingYaw1EnumOptions.add("Channel4");
FixedWingYaw1EnumOptions.add("Channel5");
FixedWingYaw1EnumOptions.add("Channel6");
FixedWingYaw1EnumOptions.add("Channel7");
FixedWingYaw1EnumOptions.add("Channel8");
FixedWingYaw1EnumOptions.add("Channel9");
FixedWingYaw1EnumOptions.add("Channel10");
FixedWingYaw1EnumOptions.add("None");
fields.add( new UAVObjectField("FixedWingYaw1", "channel", UAVObjectField.FieldType.ENUM, FixedWingYaw1ElemNames, FixedWingYaw1EnumOptions) );
List<String> FixedWingYaw2ElemNames = new ArrayList<String>();
FixedWingYaw2ElemNames.add("0");
List<String> FixedWingYaw2EnumOptions = new ArrayList<String>();
FixedWingYaw2EnumOptions.add("Channel1");
FixedWingYaw2EnumOptions.add("Channel2");
FixedWingYaw2EnumOptions.add("Channel3");
FixedWingYaw2EnumOptions.add("Channel4");
FixedWingYaw2EnumOptions.add("Channel5");
FixedWingYaw2EnumOptions.add("Channel6");
FixedWingYaw2EnumOptions.add("Channel7");
FixedWingYaw2EnumOptions.add("Channel8");
FixedWingYaw2EnumOptions.add("Channel9");
FixedWingYaw2EnumOptions.add("Channel10");
FixedWingYaw2EnumOptions.add("None");
fields.add( new UAVObjectField("FixedWingYaw2", "channel", UAVObjectField.FieldType.ENUM, FixedWingYaw2ElemNames, FixedWingYaw2EnumOptions) );
List<String> FixedWingThrottleElemNames = new ArrayList<String>();
FixedWingThrottleElemNames.add("0");
List<String> FixedWingThrottleEnumOptions = new ArrayList<String>();
FixedWingThrottleEnumOptions.add("Channel1");
FixedWingThrottleEnumOptions.add("Channel2");
FixedWingThrottleEnumOptions.add("Channel3");
FixedWingThrottleEnumOptions.add("Channel4");
FixedWingThrottleEnumOptions.add("Channel5");
FixedWingThrottleEnumOptions.add("Channel6");
FixedWingThrottleEnumOptions.add("Channel7");
FixedWingThrottleEnumOptions.add("Channel8");
FixedWingThrottleEnumOptions.add("Channel9");
FixedWingThrottleEnumOptions.add("Channel10");
FixedWingThrottleEnumOptions.add("None");
fields.add( new UAVObjectField("FixedWingThrottle", "channel", UAVObjectField.FieldType.ENUM, FixedWingThrottleElemNames, FixedWingThrottleEnumOptions) );
List<String> VTOLMotorNElemNames = new ArrayList<String>();
VTOLMotorNElemNames.add("0");
List<String> VTOLMotorNEnumOptions = new ArrayList<String>();
VTOLMotorNEnumOptions.add("Channel1");
VTOLMotorNEnumOptions.add("Channel2");
VTOLMotorNEnumOptions.add("Channel3");
VTOLMotorNEnumOptions.add("Channel4");
VTOLMotorNEnumOptions.add("Channel5");
VTOLMotorNEnumOptions.add("Channel6");
VTOLMotorNEnumOptions.add("Channel7");
VTOLMotorNEnumOptions.add("Channel8");
VTOLMotorNEnumOptions.add("Channel9");
VTOLMotorNEnumOptions.add("Channel10");
VTOLMotorNEnumOptions.add("None");
fields.add( new UAVObjectField("VTOLMotorN", "channel", UAVObjectField.FieldType.ENUM, VTOLMotorNElemNames, VTOLMotorNEnumOptions) );
List<String> VTOLMotorNEElemNames = new ArrayList<String>();
VTOLMotorNEElemNames.add("0");
List<String> VTOLMotorNEEnumOptions = new ArrayList<String>();
VTOLMotorNEEnumOptions.add("Channel1");
VTOLMotorNEEnumOptions.add("Channel2");
VTOLMotorNEEnumOptions.add("Channel3");
VTOLMotorNEEnumOptions.add("Channel4");
VTOLMotorNEEnumOptions.add("Channel5");
VTOLMotorNEEnumOptions.add("Channel6");
VTOLMotorNEEnumOptions.add("Channel7");
VTOLMotorNEEnumOptions.add("Channel8");
VTOLMotorNEEnumOptions.add("Channel9");
VTOLMotorNEEnumOptions.add("Channel10");
VTOLMotorNEEnumOptions.add("None");
fields.add( new UAVObjectField("VTOLMotorNE", "channel", UAVObjectField.FieldType.ENUM, VTOLMotorNEElemNames, VTOLMotorNEEnumOptions) );
List<String> VTOLMotorEElemNames = new ArrayList<String>();
VTOLMotorEElemNames.add("0");
List<String> VTOLMotorEEnumOptions = new ArrayList<String>();
VTOLMotorEEnumOptions.add("Channel1");
VTOLMotorEEnumOptions.add("Channel2");
VTOLMotorEEnumOptions.add("Channel3");
VTOLMotorEEnumOptions.add("Channel4");
VTOLMotorEEnumOptions.add("Channel5");
VTOLMotorEEnumOptions.add("Channel6");
VTOLMotorEEnumOptions.add("Channel7");
VTOLMotorEEnumOptions.add("Channel8");
VTOLMotorEEnumOptions.add("Channel9");
VTOLMotorEEnumOptions.add("Channel10");
VTOLMotorEEnumOptions.add("None");
fields.add( new UAVObjectField("VTOLMotorE", "channel", UAVObjectField.FieldType.ENUM, VTOLMotorEElemNames, VTOLMotorEEnumOptions) );
List<String> VTOLMotorSEElemNames = new ArrayList<String>();
VTOLMotorSEElemNames.add("0");
List<String> VTOLMotorSEEnumOptions = new ArrayList<String>();
VTOLMotorSEEnumOptions.add("Channel1");
VTOLMotorSEEnumOptions.add("Channel2");
VTOLMotorSEEnumOptions.add("Channel3");
VTOLMotorSEEnumOptions.add("Channel4");
VTOLMotorSEEnumOptions.add("Channel5");
VTOLMotorSEEnumOptions.add("Channel6");
VTOLMotorSEEnumOptions.add("Channel7");
VTOLMotorSEEnumOptions.add("Channel8");
VTOLMotorSEEnumOptions.add("Channel9");
VTOLMotorSEEnumOptions.add("Channel10");
VTOLMotorSEEnumOptions.add("None");
fields.add( new UAVObjectField("VTOLMotorSE", "channel", UAVObjectField.FieldType.ENUM, VTOLMotorSEElemNames, VTOLMotorSEEnumOptions) );
List<String> VTOLMotorSElemNames = new ArrayList<String>();
VTOLMotorSElemNames.add("0");
List<String> VTOLMotorSEnumOptions = new ArrayList<String>();
VTOLMotorSEnumOptions.add("Channel1");
VTOLMotorSEnumOptions.add("Channel2");
VTOLMotorSEnumOptions.add("Channel3");
VTOLMotorSEnumOptions.add("Channel4");
VTOLMotorSEnumOptions.add("Channel5");
VTOLMotorSEnumOptions.add("Channel6");
VTOLMotorSEnumOptions.add("Channel7");
VTOLMotorSEnumOptions.add("Channel8");
VTOLMotorSEnumOptions.add("Channel9");
VTOLMotorSEnumOptions.add("Channel10");
VTOLMotorSEnumOptions.add("None");
fields.add( new UAVObjectField("VTOLMotorS", "channel", UAVObjectField.FieldType.ENUM, VTOLMotorSElemNames, VTOLMotorSEnumOptions) );
List<String> VTOLMotorSWElemNames = new ArrayList<String>();
VTOLMotorSWElemNames.add("0");
List<String> VTOLMotorSWEnumOptions = new ArrayList<String>();
VTOLMotorSWEnumOptions.add("Channel1");
VTOLMotorSWEnumOptions.add("Channel2");
VTOLMotorSWEnumOptions.add("Channel3");
VTOLMotorSWEnumOptions.add("Channel4");
VTOLMotorSWEnumOptions.add("Channel5");
VTOLMotorSWEnumOptions.add("Channel6");
VTOLMotorSWEnumOptions.add("Channel7");
VTOLMotorSWEnumOptions.add("Channel8");
VTOLMotorSWEnumOptions.add("Channel9");
VTOLMotorSWEnumOptions.add("Channel10");
VTOLMotorSWEnumOptions.add("None");
fields.add( new UAVObjectField("VTOLMotorSW", "channel", UAVObjectField.FieldType.ENUM, VTOLMotorSWElemNames, VTOLMotorSWEnumOptions) );
List<String> VTOLMotorWElemNames = new ArrayList<String>();
VTOLMotorWElemNames.add("0");
List<String> VTOLMotorWEnumOptions = new ArrayList<String>();
VTOLMotorWEnumOptions.add("Channel1");
VTOLMotorWEnumOptions.add("Channel2");
VTOLMotorWEnumOptions.add("Channel3");
VTOLMotorWEnumOptions.add("Channel4");
VTOLMotorWEnumOptions.add("Channel5");
VTOLMotorWEnumOptions.add("Channel6");
VTOLMotorWEnumOptions.add("Channel7");
VTOLMotorWEnumOptions.add("Channel8");
VTOLMotorWEnumOptions.add("Channel9");
VTOLMotorWEnumOptions.add("Channel10");
VTOLMotorWEnumOptions.add("None");
fields.add( new UAVObjectField("VTOLMotorW", "channel", UAVObjectField.FieldType.ENUM, VTOLMotorWElemNames, VTOLMotorWEnumOptions) );
List<String> VTOLMotorNWElemNames = new ArrayList<String>();
VTOLMotorNWElemNames.add("0");
List<String> VTOLMotorNWEnumOptions = new ArrayList<String>();
VTOLMotorNWEnumOptions.add("Channel1");
VTOLMotorNWEnumOptions.add("Channel2");
VTOLMotorNWEnumOptions.add("Channel3");
VTOLMotorNWEnumOptions.add("Channel4");
VTOLMotorNWEnumOptions.add("Channel5");
VTOLMotorNWEnumOptions.add("Channel6");
VTOLMotorNWEnumOptions.add("Channel7");
VTOLMotorNWEnumOptions.add("Channel8");
VTOLMotorNWEnumOptions.add("Channel9");
VTOLMotorNWEnumOptions.add("Channel10");
VTOLMotorNWEnumOptions.add("None");
fields.add( new UAVObjectField("VTOLMotorNW", "channel", UAVObjectField.FieldType.ENUM, VTOLMotorNWElemNames, VTOLMotorNWEnumOptions) );
List<String> ChannelTypeElemNames = new ArrayList<String>();
ChannelTypeElemNames.add("0");
ChannelTypeElemNames.add("1");
@ -398,18 +158,17 @@ public class ActuatorSettings extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.TRUE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.TRUE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_NEVER;
metadata.loggingUpdatePeriod = 0;
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;
}
@ -454,21 +213,6 @@ public class ActuatorSettings extends UAVDataObject {
getField("ChannelMin").setValue(1000,7);
getField("ChannelMin").setValue(1000,8);
getField("ChannelMin").setValue(1000,9);
getField("FixedWingRoll1").setValue("None");
getField("FixedWingRoll2").setValue("None");
getField("FixedWingPitch1").setValue("None");
getField("FixedWingPitch2").setValue("None");
getField("FixedWingYaw1").setValue("None");
getField("FixedWingYaw2").setValue("None");
getField("FixedWingThrottle").setValue("None");
getField("VTOLMotorN").setValue("None");
getField("VTOLMotorNE").setValue("None");
getField("VTOLMotorE").setValue("None");
getField("VTOLMotorSE").setValue("None");
getField("VTOLMotorS").setValue("None");
getField("VTOLMotorSW").setValue("None");
getField("VTOLMotorW").setValue("None");
getField("VTOLMotorNW").setValue("None");
getField("ChannelType").setValue("PWM",0);
getField("ChannelType").setValue("PWM",1);
getField("ChannelType").setValue("PWM",2);
@ -518,7 +262,7 @@ public class ActuatorSettings extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0xF2875746;
protected static final int OBJID = 0x7D555646;
protected static final String NAME = "ActuatorSettings";
protected static String DESCRIPTION = "Settings for the @ref ActuatorModule that controls the channel assignments for the mixer based on AircraftType";
protected static final boolean ISSINGLEINST = 1 == 1;

View File

@ -102,18 +102,17 @@ public class AttitudeActual extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.flightTelemetryUpdatePeriod = 100;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_NEVER;
metadata.loggingUpdatePeriod = 0;
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;
}

View File

@ -130,18 +130,17 @@ public class AttitudeSettings extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.TRUE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.TRUE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_NEVER;
metadata.loggingUpdatePeriod = 0;
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;
}

View File

@ -86,18 +86,17 @@ public class BaroAltitude extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_NEVER;
metadata.loggingUpdatePeriod = 0;
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;
}

View File

@ -86,18 +86,17 @@ public class CameraDesired extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_NEVER;
metadata.loggingUpdatePeriod = 0;
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;
}

View File

@ -125,18 +125,17 @@ public class CameraStabSettings extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.TRUE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.TRUE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_NEVER;
metadata.loggingUpdatePeriod = 0;
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;
}

View File

@ -85,18 +85,17 @@ public class FaultSettings extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.TRUE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.TRUE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_NEVER;
metadata.loggingUpdatePeriod = 0;
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;
}

View File

@ -152,18 +152,17 @@ public class FirmwareIAPObj extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.TRUE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.TRUE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_NEVER;
metadata.loggingUpdatePeriod = 0;
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_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 = 0;
return metadata;
}

View File

@ -80,9 +80,12 @@ public class FlightBatterySettings extends UAVDataObject {
fields.add( new UAVObjectField("NbCells", "", UAVObjectField.FieldType.UINT8, NbCellsElemNames, null) );
List<String> SensorTypeElemNames = new ArrayList<String>();
SensorTypeElemNames.add("0");
SensorTypeElemNames.add("BatteryCurrent");
SensorTypeElemNames.add("BatteryVoltage");
SensorTypeElemNames.add("BoardVoltage");
List<String> SensorTypeEnumOptions = new ArrayList<String>();
SensorTypeEnumOptions.add("None");
SensorTypeEnumOptions.add("Disabled");
SensorTypeEnumOptions.add("Enabled");
fields.add( new UAVObjectField("SensorType", "", UAVObjectField.FieldType.ENUM, SensorTypeElemNames, SensorTypeEnumOptions) );
@ -108,18 +111,17 @@ public class FlightBatterySettings extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.TRUE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.TRUE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_NEVER;
metadata.loggingUpdatePeriod = 0;
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;
}
@ -137,7 +139,9 @@ public class FlightBatterySettings extends UAVDataObject {
getField("SensorCalibrations").setValue(1,1);
getField("Type").setValue("LiPo");
getField("NbCells").setValue(3);
getField("SensorType").setValue("None");
getField("SensorType").setValue("Disabled",0);
getField("SensorType").setValue("Disabled",1);
getField("SensorType").setValue("Disabled",2);
}
@ -166,7 +170,7 @@ public class FlightBatterySettings extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0xF172BB18;
protected static final int OBJID = 0x94AC6AD2;
protected static final String NAME = "FlightBatterySettings";
protected static String DESCRIPTION = "Flight Battery configuration.";
protected static final boolean ISSINGLEINST = 1 == 1;

View File

@ -59,6 +59,10 @@ public class FlightBatteryState extends UAVDataObject {
CurrentElemNames.add("0");
fields.add( new UAVObjectField("Current", "A", UAVObjectField.FieldType.FLOAT32, CurrentElemNames, null) );
List<String> BoardSupplyVoltageElemNames = new ArrayList<String>();
BoardSupplyVoltageElemNames.add("0");
fields.add( new UAVObjectField("BoardSupplyVoltage", "V", UAVObjectField.FieldType.FLOAT32, BoardSupplyVoltageElemNames, null) );
List<String> PeakCurrentElemNames = new ArrayList<String>();
PeakCurrentElemNames.add("0");
fields.add( new UAVObjectField("PeakCurrent", "A", UAVObjectField.FieldType.FLOAT32, PeakCurrentElemNames, null) );
@ -98,18 +102,17 @@ public class FlightBatteryState extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READONLY;
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_NEVER;
metadata.loggingUpdatePeriod = 0;
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_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;
}
@ -122,6 +125,7 @@ public class FlightBatteryState extends UAVDataObject {
{
getField("Voltage").setValue(0);
getField("Current").setValue(0);
getField("BoardSupplyVoltage").setValue(0);
getField("PeakCurrent").setValue(0);
getField("AvgCurrent").setValue(0);
getField("ConsumedEnergy").setValue(0);
@ -154,7 +158,7 @@ public class FlightBatteryState extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0x8C0D756;
protected static final int OBJID = 0xD2083596;
protected static final String NAME = "FlightBatteryState";
protected static String DESCRIPTION = "Battery status information.";
protected static final boolean ISSINGLEINST = 1 == 1;

View File

@ -82,18 +82,17 @@ public class FlightPlanControl extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.TRUE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.TRUE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_NEVER;
metadata.loggingUpdatePeriod = 0;
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_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 = 0;
return metadata;
}

View File

@ -78,18 +78,17 @@ public class FlightPlanSettings extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.TRUE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.TRUE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_NEVER;
metadata.loggingUpdatePeriod = 0;
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;
}

View File

@ -119,18 +119,17 @@ public class FlightPlanStatus extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.flightTelemetryUpdatePeriod = 2000;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_NEVER;
metadata.loggingUpdatePeriod = 0;
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 = 2000;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}

View File

@ -70,6 +70,7 @@ public class FlightStatus extends UAVDataObject {
FlightModeEnumOptions.add("VelocityControl");
FlightModeEnumOptions.add("PositionHold");
FlightModeEnumOptions.add("PathPlanner");
FlightModeEnumOptions.add("RTH");
fields.add( new UAVObjectField("FlightMode", "", UAVObjectField.FieldType.ENUM, FlightModeElemNames, FlightModeEnumOptions) );
@ -95,18 +96,17 @@ public class FlightStatus extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
metadata.flightTelemetryUpdatePeriod = 5000;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_NEVER;
metadata.loggingUpdatePeriod = 0;
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 = 5000;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
@ -146,7 +146,7 @@ public class FlightStatus extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0x19B92D8;
protected static final int OBJID = 0x884FEF66;
protected static final String NAME = "FlightStatus";
protected static String DESCRIPTION = "Contains major flight status information for other modules.";
protected static final boolean ISSINGLEINST = 1 == 1;

View File

@ -103,18 +103,17 @@ public class FlightTelemetryStats extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.TRUE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.TRUE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.flightTelemetryUpdatePeriod = 5000;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.loggingUpdatePeriod = 5000;
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_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 5000;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 5000;
return metadata;
}

View File

@ -58,6 +58,8 @@ public class GCSReceiver extends UAVDataObject {
ChannelElemNames.add("3");
ChannelElemNames.add("4");
ChannelElemNames.add("5");
ChannelElemNames.add("6");
ChannelElemNames.add("7");
fields.add( new UAVObjectField("Channel", "us", UAVObjectField.FieldType.UINT16, ChannelElemNames, null) );
@ -83,18 +85,17 @@ public class GCSReceiver extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READONLY;
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_NEVER;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_NEVER;
metadata.loggingUpdatePeriod = 0;
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_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
@ -133,7 +134,7 @@ public class GCSReceiver extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0xCC7E2BBC;
protected static final int OBJID = 0xCC7E1470;
protected static final String NAME = "GCSReceiver";
protected static String DESCRIPTION = "A receiver channel group carried over the telemetry link.";
protected static final boolean ISSINGLEINST = 1 == 1;

View File

@ -103,18 +103,17 @@ public class GCSTelemetryStats extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.TRUE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.gcsTelemetryUpdatePeriod = 5000;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.TRUE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_NEVER;
metadata.loggingUpdatePeriod = 0;
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_MANUAL) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.gcsTelemetryUpdatePeriod = 5000;
metadata.loggingUpdatePeriod = 0;
return metadata;
}

View File

@ -123,18 +123,17 @@ public class GPSPosition extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.loggingUpdatePeriod = 1000;
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;
}

View File

@ -154,18 +154,17 @@ public class GPSSatellites extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.flightTelemetryUpdatePeriod = 10000;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.loggingUpdatePeriod = 30000;
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 = 10000;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 30000;
return metadata;
}

View File

@ -98,18 +98,17 @@ public class GPSTime extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.flightTelemetryUpdatePeriod = 10000;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.loggingUpdatePeriod = 30000;
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 = 10000;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 30000;
return metadata;
}

View File

@ -1,211 +0,0 @@
/**
******************************************************************************
*
* @file uavobjecttemplate.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Template for an uavobject in java
* This is a autogenerated file!! Do not modify and expect a result.
* Settings for the @ref GuidanceModule
*
* @see The GNU Public License (GPL) Version 3
*
*****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.openpilot.uavtalk.uavobjects;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;
import org.openpilot.uavtalk.UAVObjectManager;
import org.openpilot.uavtalk.UAVObject;
import org.openpilot.uavtalk.UAVDataObject;
import org.openpilot.uavtalk.UAVObjectField;
/**
Settings for the @ref GuidanceModule
generated from guidancesettings.xml
**/
public class GuidanceSettings extends UAVDataObject {
public GuidanceSettings() {
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> 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> MaxRollPitchElemNames = new ArrayList<String>();
MaxRollPitchElemNames.add("0");
fields.add( new UAVObjectField("MaxRollPitch", "deg", UAVObjectField.FieldType.FLOAT32, MaxRollPitchElemNames, null) );
List<String> UpdatePeriodElemNames = new ArrayList<String>();
UpdatePeriodElemNames.add("0");
fields.add( new UAVObjectField("UpdatePeriod", "", UAVObjectField.FieldType.INT32, UpdatePeriodElemNames, null) );
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) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.TRUE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.TRUE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_NEVER;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
getField("HorizontalPosPI").setValue(0.1,0);
getField("HorizontalPosPI").setValue(0.001,1);
getField("HorizontalPosPI").setValue(300,2);
getField("HorizontalVelPID").setValue(0.05,0);
getField("HorizontalVelPID").setValue(0.002,1);
getField("HorizontalVelPID").setValue(0,2);
getField("HorizontalVelPID").setValue(1000,3);
getField("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("MaxRollPitch").setValue(10);
getField("UpdatePeriod").setValue(100);
getField("HorizontalVelMax").setValue(300);
getField("VerticalVelMax").setValue(150);
getField("GuidanceMode").setValue("DUAL_LOOP");
getField("ThrottleControl").setValue("FALSE");
}
/**
* Create a clone of this object, a new instance ID must be specified.
* Do not use this function directly to create new instances, the
* UAVObjectManager should be used instead.
*/
public UAVDataObject clone(int instID) {
// TODO: Need to get specific instance to clone
try {
GuidanceSettings obj = new GuidanceSettings();
obj.initialize(instID, this.getMetaObject());
return obj;
} catch (Exception e) {
return null;
}
}
/**
* Static function to retrieve an instance of the object.
*/
public GuidanceSettings GetInstance(UAVObjectManager objMngr, int instID)
{
return (GuidanceSettings)(objMngr.getObject(GuidanceSettings.OBJID, instID));
}
// Constants
protected static final int OBJID = 0x6EA79FB4;
protected static final String NAME = "GuidanceSettings";
protected static String DESCRIPTION = "Settings for the @ref GuidanceModule";
protected static final boolean ISSINGLEINST = 1 == 1;
protected static final boolean ISSETTINGS = 1 == 1;
protected static int NUMBYTES = 0;
}

View File

@ -103,18 +103,17 @@ public class HomeLocation extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.TRUE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.TRUE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_NEVER;
metadata.loggingUpdatePeriod = 0;
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;
}

View File

@ -190,14 +190,6 @@ public class HwSettings extends UAVDataObject {
ComUsbBridgeSpeedEnumOptions.add("115200");
fields.add( new UAVObjectField("ComUsbBridgeSpeed", "bps", UAVObjectField.FieldType.ENUM, ComUsbBridgeSpeedElemNames, ComUsbBridgeSpeedEnumOptions) );
List<String> USB_DeviceTypeElemNames = new ArrayList<String>();
USB_DeviceTypeElemNames.add("0");
List<String> USB_DeviceTypeEnumOptions = new ArrayList<String>();
USB_DeviceTypeEnumOptions.add("HID-only");
USB_DeviceTypeEnumOptions.add("HID+VCP");
USB_DeviceTypeEnumOptions.add("VCP-only");
fields.add( new UAVObjectField("USB_DeviceType", "descriptor", UAVObjectField.FieldType.ENUM, USB_DeviceTypeElemNames, USB_DeviceTypeEnumOptions) );
List<String> USB_HIDPortElemNames = new ArrayList<String>();
USB_HIDPortElemNames.add("0");
List<String> USB_HIDPortEnumOptions = new ArrayList<String>();
@ -219,7 +211,12 @@ public class HwSettings extends UAVDataObject {
OptionalModulesElemNames.add("ComUsbBridge");
OptionalModulesElemNames.add("Fault");
OptionalModulesElemNames.add("Altitude");
OptionalModulesElemNames.add("Airspeed");
OptionalModulesElemNames.add("TxPID");
OptionalModulesElemNames.add("VtolPathFollower");
OptionalModulesElemNames.add("FixedWingPathFollower");
OptionalModulesElemNames.add("Battery");
OptionalModulesElemNames.add("Overo");
List<String> OptionalModulesEnumOptions = new ArrayList<String>();
OptionalModulesEnumOptions.add("Disabled");
OptionalModulesEnumOptions.add("Enabled");
@ -252,18 +249,17 @@ public class HwSettings extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.TRUE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.TRUE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_NEVER;
metadata.loggingUpdatePeriod = 0;
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;
}
@ -286,7 +282,6 @@ public class HwSettings extends UAVDataObject {
getField("TelemetrySpeed").setValue("57600");
getField("GPSSpeed").setValue("57600");
getField("ComUsbBridgeSpeed").setValue("57600");
getField("USB_DeviceType").setValue("HID-only");
getField("USB_HIDPort").setValue("USBTelemetry");
getField("USB_VCPPort").setValue("Disabled");
getField("OptionalModules").setValue("Disabled",0);
@ -295,6 +290,11 @@ public class HwSettings extends UAVDataObject {
getField("OptionalModules").setValue("Disabled",3);
getField("OptionalModules").setValue("Disabled",4);
getField("OptionalModules").setValue("Disabled",5);
getField("OptionalModules").setValue("Disabled",6);
getField("OptionalModules").setValue("Disabled",7);
getField("OptionalModules").setValue("Disabled",8);
getField("OptionalModules").setValue("Disabled",9);
getField("OptionalModules").setValue("Disabled",10);
getField("DSMxBind").setValue(0);
}
@ -324,7 +324,7 @@ public class HwSettings extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0x4730375C;
protected static final int OBJID = 0x5D950E50;
protected static final String NAME = "HwSettings";
protected static String DESCRIPTION = "Selection of optional hardware configurations.";
protected static final boolean ISSINGLEINST = 1 == 1;

View File

@ -177,18 +177,17 @@ public class I2CStats extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.flightTelemetryUpdatePeriod = 10000;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.loggingUpdatePeriod = 30000;
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 = 10000;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 30000;
return metadata;
}

View File

@ -113,18 +113,17 @@ public class ManualControlCommand extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.flightTelemetryUpdatePeriod = 2000;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_NEVER;
metadata.loggingUpdatePeriod = 0;
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 = 2000;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}

View File

@ -51,6 +51,10 @@ public class ManualControlSettings extends UAVDataObject {
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> DeadbandElemNames = new ArrayList<String>();
DeadbandElemNames.add("0");
fields.add( new UAVObjectField("Deadband", "%", UAVObjectField.FieldType.FLOAT32, DeadbandElemNames, null) );
List<String> ChannelMinElemNames = new ArrayList<String>();
ChannelMinElemNames.add("Throttle");
ChannelMinElemNames.add("Roll");
@ -146,6 +150,7 @@ public class ManualControlSettings extends UAVDataObject {
Stabilization1SettingsEnumOptions.add("Attitude");
Stabilization1SettingsEnumOptions.add("AxisLock");
Stabilization1SettingsEnumOptions.add("WeakLeveling");
Stabilization1SettingsEnumOptions.add("VirtualBar");
fields.add( new UAVObjectField("Stabilization1Settings", "", UAVObjectField.FieldType.ENUM, Stabilization1SettingsElemNames, Stabilization1SettingsEnumOptions) );
List<String> Stabilization2SettingsElemNames = new ArrayList<String>();
@ -158,6 +163,7 @@ public class ManualControlSettings extends UAVDataObject {
Stabilization2SettingsEnumOptions.add("Attitude");
Stabilization2SettingsEnumOptions.add("AxisLock");
Stabilization2SettingsEnumOptions.add("WeakLeveling");
Stabilization2SettingsEnumOptions.add("VirtualBar");
fields.add( new UAVObjectField("Stabilization2Settings", "", UAVObjectField.FieldType.ENUM, Stabilization2SettingsElemNames, Stabilization2SettingsEnumOptions) );
List<String> Stabilization3SettingsElemNames = new ArrayList<String>();
@ -170,6 +176,7 @@ public class ManualControlSettings extends UAVDataObject {
Stabilization3SettingsEnumOptions.add("Attitude");
Stabilization3SettingsEnumOptions.add("AxisLock");
Stabilization3SettingsEnumOptions.add("WeakLeveling");
Stabilization3SettingsEnumOptions.add("VirtualBar");
fields.add( new UAVObjectField("Stabilization3Settings", "", UAVObjectField.FieldType.ENUM, Stabilization3SettingsElemNames, Stabilization3SettingsEnumOptions) );
List<String> FlightModePositionElemNames = new ArrayList<String>();
@ -185,8 +192,21 @@ public class ManualControlSettings extends UAVDataObject {
FlightModePositionEnumOptions.add("VelocityControl");
FlightModePositionEnumOptions.add("PositionHold");
FlightModePositionEnumOptions.add("PathPlanner");
FlightModePositionEnumOptions.add("RTH");
FlightModePositionEnumOptions.add("Land");
fields.add( new UAVObjectField("FlightModePosition", "", UAVObjectField.FieldType.ENUM, FlightModePositionElemNames, FlightModePositionEnumOptions) );
List<String> FlightModeNumberElemNames = new ArrayList<String>();
FlightModeNumberElemNames.add("0");
fields.add( new UAVObjectField("FlightModeNumber", "", UAVObjectField.FieldType.UINT8, FlightModeNumberElemNames, null) );
List<String> FailsafeBehaviorElemNames = new ArrayList<String>();
FailsafeBehaviorElemNames.add("0");
List<String> FailsafeBehaviorEnumOptions = new ArrayList<String>();
FailsafeBehaviorEnumOptions.add("None");
FailsafeBehaviorEnumOptions.add("RTH");
fields.add( new UAVObjectField("FailsafeBehavior", "", UAVObjectField.FieldType.ENUM, FailsafeBehaviorElemNames, FailsafeBehaviorEnumOptions) );
// Compute the number of bytes for this object
int numBytes = 0;
@ -210,18 +230,17 @@ public class ManualControlSettings extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.TRUE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.TRUE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_NEVER;
metadata.loggingUpdatePeriod = 0;
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;
}
@ -232,6 +251,7 @@ public class ManualControlSettings extends UAVDataObject {
*/
public void setDefaultFieldValues()
{
getField("Deadband").setValue(0);
getField("ChannelMin").setValue(1000,0);
getField("ChannelMin").setValue(1000,1);
getField("ChannelMin").setValue(1000,2);
@ -291,6 +311,8 @@ public class ManualControlSettings extends UAVDataObject {
getField("FlightModePosition").setValue("Manual",0);
getField("FlightModePosition").setValue("Stabilized1",1);
getField("FlightModePosition").setValue("Stabilized2",2);
getField("FlightModeNumber").setValue(3);
getField("FailsafeBehavior").setValue("None");
}
@ -319,7 +341,7 @@ public class ManualControlSettings extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0x59C4551C;
protected static final int OBJID = 0x6C188320;
protected static final String NAME = "ManualControlSettings";
protected static String DESCRIPTION = "Settings to indicate how to decode receiver input by @ref ManualControlModule.";
protected static final boolean ISSINGLEINST = 1 == 1;

View File

@ -372,18 +372,17 @@ public class MixerSettings extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.TRUE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.TRUE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_NEVER;
metadata.loggingUpdatePeriod = 0;
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;
}

View File

@ -114,18 +114,17 @@ public class MixerStatus extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.loggingUpdatePeriod = 1000;
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;
}

View File

@ -86,18 +86,17 @@ public class NedAccel extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.flightTelemetryUpdatePeriod = 10001;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_NEVER;
metadata.loggingUpdatePeriod = 0;
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 = 10001;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}

View File

@ -68,6 +68,7 @@ public class ObjectPersistence extends UAVDataObject {
OperationEnumOptions.add("Delete");
OperationEnumOptions.add("FullErase");
OperationEnumOptions.add("Completed");
OperationEnumOptions.add("Error");
fields.add( new UAVObjectField("Operation", "", UAVObjectField.FieldType.ENUM, OperationElemNames, OperationEnumOptions) );
List<String> SelectionElemNames = new ArrayList<String>();
@ -102,18 +103,17 @@ public class ObjectPersistence extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.TRUE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.TRUE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_NEVER;
metadata.loggingUpdatePeriod = 0;
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_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
@ -152,7 +152,7 @@ public class ObjectPersistence extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0xF69AD8B8;
protected static final int OBJID = 0x99C63292;
protected static final String NAME = "ObjectPersistence";
protected static String DESCRIPTION = "Someone who knows please enter this";
protected static final boolean ISSINGLEINST = 1 == 1;

View File

@ -86,18 +86,17 @@ public class PositionActual extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.loggingUpdatePeriod = 1000;
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_PERIODIC) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.gcsTelemetryUpdatePeriod = 1000;
metadata.loggingUpdatePeriod = 1000;
return metadata;
}

View File

@ -1,147 +0,0 @@
/**
******************************************************************************
*
* @file uavobjecttemplate.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Template for an uavobject in java
* This is a autogenerated file!! Do not modify and expect a result.
* The position the craft is trying t achieve. Can come from GCS or @ref PathPlanner
*
* @see The GNU Public License (GPL) Version 3
*
*****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.openpilot.uavtalk.uavobjects;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;
import org.openpilot.uavtalk.UAVObjectManager;
import org.openpilot.uavtalk.UAVObject;
import org.openpilot.uavtalk.UAVDataObject;
import org.openpilot.uavtalk.UAVObjectField;
/**
The position the craft is trying t achieve. Can come from GCS or @ref PathPlanner
generated from positiondesired.xml
**/
public class PositionDesired extends UAVDataObject {
public PositionDesired() {
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> NorthElemNames = new ArrayList<String>();
NorthElemNames.add("0");
fields.add( new UAVObjectField("North", "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.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.loggingUpdatePeriod = 1000;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
}
/**
* Create a clone of this object, a new instance ID must be specified.
* Do not use this function directly to create new instances, the
* UAVObjectManager should be used instead.
*/
public UAVDataObject clone(int instID) {
// TODO: Need to get specific instance to clone
try {
PositionDesired obj = new PositionDesired();
obj.initialize(instID, this.getMetaObject());
return obj;
} catch (Exception e) {
return null;
}
}
/**
* Static function to retrieve an instance of the object.
*/
public PositionDesired GetInstance(UAVObjectManager objMngr, int instID)
{
return (PositionDesired)(objMngr.getObject(PositionDesired.OBJID, instID));
}
// Constants
protected static final int OBJID = 0x778DBE24;
protected static final String NAME = "PositionDesired";
protected static String DESCRIPTION = "The position the craft is trying t achieve. Can come from GCS or @ref PathPlanner ";
protected static final boolean ISSINGLEINST = 1 == 1;
protected static final boolean ISSETTINGS = 0 == 1;
protected static int NUMBYTES = 0;
}

View File

@ -86,18 +86,17 @@ public class RateDesired extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.loggingUpdatePeriod = 1000;
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;
}

View File

@ -90,18 +90,17 @@ public class ReceiverActivity extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READONLY;
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_NEVER;
metadata.loggingUpdatePeriod = 0;
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_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 = 0;
return metadata;
}

View File

@ -78,18 +78,17 @@ public class SonarAltitude extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_NEVER;
metadata.loggingUpdatePeriod = 0;
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;
}

View File

@ -77,6 +77,7 @@ public class StabilizationDesired extends UAVDataObject {
StabilizationModeEnumOptions.add("Attitude");
StabilizationModeEnumOptions.add("AxisLock");
StabilizationModeEnumOptions.add("WeakLeveling");
StabilizationModeEnumOptions.add("VirtualBar");
fields.add( new UAVObjectField("StabilizationMode", "", UAVObjectField.FieldType.ENUM, StabilizationModeElemNames, StabilizationModeEnumOptions) );
@ -102,18 +103,17 @@ public class StabilizationDesired extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_NEVER;
metadata.loggingUpdatePeriod = 0;
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;
}
@ -152,7 +152,7 @@ public class StabilizationDesired extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0xDB8FFC3C;
protected static final int OBJID = 0xDE1EAAD6;
protected static final String NAME = "StabilizationDesired";
protected static String DESCRIPTION = "The desired attitude that @ref StabilizationModule will try and achieve if FlightMode is Stabilized. Comes from @ref ManaulControlModule.";
protected static final boolean ISSINGLEINST = 1 == 1;

View File

@ -102,6 +102,31 @@ public class StabilizationSettings extends UAVDataObject {
YawPIElemNames.add("ILimit");
fields.add( new UAVObjectField("YawPI", "", UAVObjectField.FieldType.FLOAT32, YawPIElemNames, null) );
List<String> VbarSensitivityElemNames = new ArrayList<String>();
VbarSensitivityElemNames.add("Roll");
VbarSensitivityElemNames.add("Pitch");
VbarSensitivityElemNames.add("Yaw");
fields.add( new UAVObjectField("VbarSensitivity", "frac", UAVObjectField.FieldType.FLOAT32, VbarSensitivityElemNames, null) );
List<String> VbarRollPIElemNames = new ArrayList<String>();
VbarRollPIElemNames.add("Kp");
VbarRollPIElemNames.add("Ki");
fields.add( new UAVObjectField("VbarRollPI", "1/(deg/s)", UAVObjectField.FieldType.FLOAT32, VbarRollPIElemNames, null) );
List<String> VbarPitchPIElemNames = new ArrayList<String>();
VbarPitchPIElemNames.add("Kp");
VbarPitchPIElemNames.add("Ki");
fields.add( new UAVObjectField("VbarPitchPI", "1/(deg/s)", UAVObjectField.FieldType.FLOAT32, VbarPitchPIElemNames, null) );
List<String> VbarYawPIElemNames = new ArrayList<String>();
VbarYawPIElemNames.add("Kp");
VbarYawPIElemNames.add("Ki");
fields.add( new UAVObjectField("VbarYawPI", "1/(deg/s)", UAVObjectField.FieldType.FLOAT32, VbarYawPIElemNames, null) );
List<String> VbarTauElemNames = new ArrayList<String>();
VbarTauElemNames.add("0");
fields.add( new UAVObjectField("VbarTau", "sec", UAVObjectField.FieldType.FLOAT32, VbarTauElemNames, null) );
List<String> GyroTauElemNames = new ArrayList<String>();
GyroTauElemNames.add("0");
fields.add( new UAVObjectField("GyroTau", "", UAVObjectField.FieldType.FLOAT32, GyroTauElemNames, null) );
@ -122,6 +147,21 @@ public class StabilizationSettings extends UAVDataObject {
YawMaxElemNames.add("0");
fields.add( new UAVObjectField("YawMax", "degrees", UAVObjectField.FieldType.UINT8, YawMaxElemNames, null) );
List<String> VbarGyroSuppressElemNames = new ArrayList<String>();
VbarGyroSuppressElemNames.add("0");
fields.add( new UAVObjectField("VbarGyroSuppress", "%", UAVObjectField.FieldType.INT8, VbarGyroSuppressElemNames, null) );
List<String> VbarPiroCompElemNames = new ArrayList<String>();
VbarPiroCompElemNames.add("0");
List<String> VbarPiroCompEnumOptions = new ArrayList<String>();
VbarPiroCompEnumOptions.add("FALSE");
VbarPiroCompEnumOptions.add("TRUE");
fields.add( new UAVObjectField("VbarPiroComp", "", UAVObjectField.FieldType.ENUM, VbarPiroCompElemNames, VbarPiroCompEnumOptions) );
List<String> VbarMaxAngleElemNames = new ArrayList<String>();
VbarMaxAngleElemNames.add("0");
fields.add( new UAVObjectField("VbarMaxAngle", "deg", UAVObjectField.FieldType.UINT8, VbarMaxAngleElemNames, null) );
List<String> MaxAxisLockElemNames = new ArrayList<String>();
MaxAxisLockElemNames.add("0");
fields.add( new UAVObjectField("MaxAxisLock", "deg", UAVObjectField.FieldType.UINT8, MaxAxisLockElemNames, null) );
@ -164,18 +204,17 @@ public class StabilizationSettings extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.TRUE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.TRUE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_NEVER;
metadata.loggingUpdatePeriod = 0;
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;
}
@ -213,11 +252,24 @@ public class StabilizationSettings extends UAVDataObject {
getField("YawPI").setValue(2,0);
getField("YawPI").setValue(0,1);
getField("YawPI").setValue(50,2);
getField("VbarSensitivity").setValue(0.5,0);
getField("VbarSensitivity").setValue(0.5,1);
getField("VbarSensitivity").setValue(0.5,2);
getField("VbarRollPI").setValue(0.005,0);
getField("VbarRollPI").setValue(0.002,1);
getField("VbarPitchPI").setValue(0.005,0);
getField("VbarPitchPI").setValue(0.002,1);
getField("VbarYawPI").setValue(0.005,0);
getField("VbarYawPI").setValue(0.002,1);
getField("VbarTau").setValue(0.5);
getField("GyroTau").setValue(0.005);
getField("WeakLevelingKp").setValue(0.1);
getField("RollMax").setValue(55);
getField("PitchMax").setValue(55);
getField("YawMax").setValue(35);
getField("VbarGyroSuppress").setValue(30);
getField("VbarPiroComp").setValue("FALSE");
getField("VbarMaxAngle").setValue(10);
getField("MaxAxisLock").setValue(15);
getField("MaxAxisLockRate").setValue(2);
getField("MaxWeakLevelingRate").setValue(5);
@ -250,7 +302,7 @@ public class StabilizationSettings extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0x5F78C51E;
protected static final int OBJID = 0xBBC337D4;
protected static final String NAME = "StabilizationSettings";
protected static String DESCRIPTION = "PID settings used by the Stabilization module to combine the @ref AttitudeActual and @ref AttitudeDesired to compute @ref ActuatorDesired";
protected static final boolean ISSINGLEINST = 1 == 1;

View File

@ -56,7 +56,6 @@ public class SystemAlarms extends UAVDataObject {
AlarmElemNames.add("StackOverflow");
AlarmElemNames.add("CPUOverload");
AlarmElemNames.add("EventSystem");
AlarmElemNames.add("SDCard");
AlarmElemNames.add("Telemetry");
AlarmElemNames.add("ManualControl");
AlarmElemNames.add("Actuator");
@ -64,12 +63,12 @@ public class SystemAlarms extends UAVDataObject {
AlarmElemNames.add("Sensors");
AlarmElemNames.add("Stabilization");
AlarmElemNames.add("Guidance");
AlarmElemNames.add("AHRSComms");
AlarmElemNames.add("Battery");
AlarmElemNames.add("FlightTime");
AlarmElemNames.add("I2C");
AlarmElemNames.add("GPS");
AlarmElemNames.add("BootFault");
AlarmElemNames.add("Power");
List<String> AlarmEnumOptions = new ArrayList<String>();
AlarmEnumOptions.add("Uninitialised");
AlarmEnumOptions.add("OK");
@ -101,18 +100,17 @@ public class SystemAlarms extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.TRUE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.TRUE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.loggingUpdatePeriod = 1000;
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 = 1000;
return metadata;
}
@ -140,7 +138,6 @@ public class SystemAlarms extends UAVDataObject {
getField("Alarm").setValue("Uninitialised",14);
getField("Alarm").setValue("Uninitialised",15);
getField("Alarm").setValue("Uninitialised",16);
getField("Alarm").setValue("Uninitialised",17);
}
@ -169,7 +166,7 @@ public class SystemAlarms extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0x9C7CBFE;
protected static final int OBJID = 0x737ADCF2;
protected static final String NAME = "SystemAlarms";
protected static String DESCRIPTION = "Alarms from OpenPilot to indicate failure conditions or warnings. Set by various modules.";
protected static final boolean ISSINGLEINST = 1 == 1;

View File

@ -54,6 +54,8 @@ public class SystemSettings extends UAVDataObject {
List<String> GUIConfigDataElemNames = new ArrayList<String>();
GUIConfigDataElemNames.add("0");
GUIConfigDataElemNames.add("1");
GUIConfigDataElemNames.add("2");
GUIConfigDataElemNames.add("3");
fields.add( new UAVObjectField("GUIConfigData", "bits", UAVObjectField.FieldType.UINT32, GUIConfigDataElemNames, null) );
List<String> AirframeTypeElemNames = new ArrayList<String>();
@ -75,6 +77,9 @@ public class SystemSettings extends UAVDataObject {
AirframeTypeEnumOptions.add("OctoCoaxX");
AirframeTypeEnumOptions.add("HexaCoax");
AirframeTypeEnumOptions.add("Tri");
AirframeTypeEnumOptions.add("GroundVehicleCar");
AirframeTypeEnumOptions.add("GroundVehicleDifferential");
AirframeTypeEnumOptions.add("GroundVehicleMotorcycle");
fields.add( new UAVObjectField("AirframeType", "", UAVObjectField.FieldType.ENUM, AirframeTypeElemNames, AirframeTypeEnumOptions) );
@ -100,18 +105,17 @@ public class SystemSettings extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.TRUE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.TRUE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_NEVER;
metadata.loggingUpdatePeriod = 0;
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;
}
@ -124,7 +128,9 @@ public class SystemSettings extends UAVDataObject {
{
getField("GUIConfigData").setValue(0,0);
getField("GUIConfigData").setValue(0,1);
getField("AirframeType").setValue("FixedWing");
getField("GUIConfigData").setValue(0,2);
getField("GUIConfigData").setValue(0,3);
getField("AirframeType").setValue("QuadX");
}
@ -153,7 +159,7 @@ public class SystemSettings extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0x30BD5D7C;
protected static final int OBJID = 0xC72A326E;
protected static final String NAME = "SystemSettings";
protected static String DESCRIPTION = "Select airframe type. Currently used by @ref ActuatorModule to choose mixing from @ref ActuatorDesired to @ref ActuatorCommand";
protected static final boolean ISSINGLEINST = 1 == 1;

View File

@ -106,18 +106,17 @@ public class SystemStats extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.loggingUpdatePeriod = 1000;
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;
}

View File

@ -62,11 +62,12 @@ public class TaskInfo extends UAVDataObject {
StackRemainingElemNames.add("GPS");
StackRemainingElemNames.add("ManualControl");
StackRemainingElemNames.add("Altitude");
StackRemainingElemNames.add("Airspeed");
StackRemainingElemNames.add("Stabilization");
StackRemainingElemNames.add("AltitudeHold");
StackRemainingElemNames.add("Guidance");
StackRemainingElemNames.add("FlightPlan");
StackRemainingElemNames.add("PathPlanner");
StackRemainingElemNames.add("PathFollower");
StackRemainingElemNames.add("FlightPlan");
StackRemainingElemNames.add("Com2UsbBridge");
StackRemainingElemNames.add("Usb2ComBridge");
StackRemainingElemNames.add("OveroSync");
@ -83,11 +84,12 @@ public class TaskInfo extends UAVDataObject {
RunningElemNames.add("GPS");
RunningElemNames.add("ManualControl");
RunningElemNames.add("Altitude");
RunningElemNames.add("Airspeed");
RunningElemNames.add("Stabilization");
RunningElemNames.add("AltitudeHold");
RunningElemNames.add("Guidance");
RunningElemNames.add("FlightPlan");
RunningElemNames.add("PathPlanner");
RunningElemNames.add("PathFollower");
RunningElemNames.add("FlightPlan");
RunningElemNames.add("Com2UsbBridge");
RunningElemNames.add("Usb2ComBridge");
RunningElemNames.add("OveroSync");
@ -107,11 +109,12 @@ public class TaskInfo extends UAVDataObject {
RunningTimeElemNames.add("GPS");
RunningTimeElemNames.add("ManualControl");
RunningTimeElemNames.add("Altitude");
RunningTimeElemNames.add("Airspeed");
RunningTimeElemNames.add("Stabilization");
RunningTimeElemNames.add("AltitudeHold");
RunningTimeElemNames.add("Guidance");
RunningTimeElemNames.add("FlightPlan");
RunningTimeElemNames.add("PathPlanner");
RunningTimeElemNames.add("PathFollower");
RunningTimeElemNames.add("FlightPlan");
RunningTimeElemNames.add("Com2UsbBridge");
RunningTimeElemNames.add("Usb2ComBridge");
RunningTimeElemNames.add("OveroSync");
@ -140,18 +143,17 @@ public class TaskInfo extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.TRUE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_ONCHANGE;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.TRUE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.flightTelemetryUpdatePeriod = 10000;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.loggingUpdatePeriod = 1000;
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_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 10000;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 1000;
return metadata;
}
@ -190,7 +192,7 @@ public class TaskInfo extends UAVDataObject {
}
// Constants
protected static final int OBJID = 0x498F54BA;
protected static final int OBJID = 0xB81CD2AE;
protected static final String NAME = "TaskInfo";
protected static String DESCRIPTION = "Task information";
protected static final boolean ISSINGLEINST = 1 == 1;

View File

@ -45,11 +45,15 @@ public class UAVObjectsInitialize {
objMngr.registerObject( new AltitudeHoldSettings() );
objMngr.registerObject( new AttitudeActual() );
objMngr.registerObject( new AttitudeSettings() );
objMngr.registerObject( new AttitudeSimulated() );
objMngr.registerObject( new BaroAirspeed() );
objMngr.registerObject( new BaroAltitude() );
objMngr.registerObject( new CameraDesired() );
objMngr.registerObject( new CameraStabSettings() );
objMngr.registerObject( new FaultSettings() );
objMngr.registerObject( new FirmwareIAPObj() );
objMngr.registerObject( new FixedWingPathFollowerSettings() );
objMngr.registerObject( new FixedWingPathFollowerStatus() );
objMngr.registerObject( new FlightBatterySettings() );
objMngr.registerObject( new FlightBatteryState() );
objMngr.registerObject( new FlightPlanControl() );
@ -61,38 +65,45 @@ public class UAVObjectsInitialize {
objMngr.registerObject( new GCSTelemetryStats() );
objMngr.registerObject( new GPSPosition() );
objMngr.registerObject( new GPSSatellites() );
objMngr.registerObject( new GPSSettings() );
objMngr.registerObject( new GPSTime() );
objMngr.registerObject( new GPSVelocity() );
objMngr.registerObject( new Gyros() );
objMngr.registerObject( new GyrosBias() );
objMngr.registerObject( new GuidanceSettings() );
objMngr.registerObject( new HomeLocation() );
objMngr.registerObject( new HwSettings() );
objMngr.registerObject( new I2CStats() );
objMngr.registerObject( new GPSPosition() );
objMngr.registerObject( new MagBias() );
objMngr.registerObject( new Magnetometer() );
objMngr.registerObject( new ManualControlCommand() );
objMngr.registerObject( new ManualControlSettings() );
objMngr.registerObject( new MixerSettings() );
objMngr.registerObject( new MixerStatus() );
objMngr.registerObject( new NEDPosition() );
objMngr.registerObject( new NedAccel() );
objMngr.registerObject( new NEDPosition() );
objMngr.registerObject( new ObjectPersistence() );
objMngr.registerObject( new OveroSyncSettings() );
objMngr.registerObject( new OveroSyncStats() );
objMngr.registerObject( new PathDesired() );
objMngr.registerObject( new PathPlannerSettings() );
objMngr.registerObject( new PipXSettings() );
objMngr.registerObject( new PipXStatus() );
objMngr.registerObject( new PositionActual() );
objMngr.registerObject( new PositionDesired() );
objMngr.registerObject( new RateDesired() );
objMngr.registerObject( new ReceiverActivity() );
objMngr.registerObject( new RevoCalibration() );
objMngr.registerObject( new RevoSettings() );
objMngr.registerObject( new SonarAltitude() );
objMngr.registerObject( new StabilizationDesired() );
objMngr.registerObject( new StabilizationSettings() );
objMngr.registerObject( new SystemAlarms() );
objMngr.registerObject( new SystemSettings() );
objMngr.registerObject( new SystemStats() );
objMngr.registerObject( new TxPIDSettings() );
objMngr.registerObject( new TaskInfo() );
objMngr.registerObject( new TxPIDSettings() );
objMngr.registerObject( new VelocityActual() );
objMngr.registerObject( new VelocityDesired() );
objMngr.registerObject( new VtolPathFollowerSettings() );
objMngr.registerObject( new WatchdogStatus() );
objMngr.registerObject( new Waypoint() );
objMngr.registerObject( new WaypointActive() );

View File

@ -86,18 +86,17 @@ public class VelocityActual extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.loggingUpdatePeriod = 1000;
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;
}

View File

@ -86,18 +86,17 @@ public class VelocityDesired extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.loggingUpdatePeriod = 1000;
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;
}

View File

@ -82,18 +82,17 @@ public class WatchdogStatus extends UAVDataObject {
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.gcsTelemetryAcked = UAVObject.Acked.FALSE;
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_MANUAL;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.flightAccess = UAVObject.AccessMode.ACCESS_READWRITE;
metadata.flightTelemetryAcked = UAVObject.Acked.FALSE;
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.flightTelemetryUpdatePeriod = 5000;
metadata.loggingUpdateMode = UAVObject.UpdateMode.UPDATEMODE_PERIODIC;
metadata.loggingUpdatePeriod = 5000;
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 = 5000;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 5000;
return metadata;
}

View File

@ -74,18 +74,17 @@ $(FIELDSINIT)
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.gcsAccess = UAVObject.AccessMode.$(GCSACCESS);
metadata.gcsTelemetryAcked = UAVObject.Acked.$(GCSTELEM_ACKEDTF);
metadata.gcsTelemetryUpdateMode = UAVObject.UpdateMode.$(GCSTELEM_UPDATEMODE);
metadata.gcsTelemetryUpdatePeriod = $(GCSTELEM_UPDATEPERIOD);
metadata.flightAccess = UAVObject.AccessMode.$(FLIGHTACCESS);
metadata.flightTelemetryAcked = UAVObject.Acked.$(FLIGHTTELEM_ACKEDTF);
metadata.flightTelemetryUpdateMode = UAVObject.UpdateMode.$(FLIGHTTELEM_UPDATEMODE);
metadata.flightTelemetryUpdatePeriod = $(FLIGHTTELEM_UPDATEPERIOD);
metadata.loggingUpdateMode = UAVObject.UpdateMode.$(LOGGING_UPDATEMODE);
metadata.loggingUpdatePeriod = $(LOGGING_UPDATEPERIOD);
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.$(FLIGHTACCESS)) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.$(GCSACCESS)) << UAVOBJ_GCS_ACCESS_SHIFT |
$(FLIGHTTELEM_ACKED) << UAVOBJ_TELEMETRY_ACKED_SHIFT |
$(GCSTELEM_ACKED) << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.$(FLIGHTTELEM_UPDATEMODE)) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.$(GCSTELEM_UPDATEMODE)) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = $(FLIGHTTELEM_UPDATEPERIOD);
metadata.gcsTelemetryUpdatePeriod = $(GCSTELEM_UPDATEPERIOD);
metadata.loggingUpdatePeriod = $(LOGGING_UPDATEPERIOD);
return metadata;
}