diff --git a/.gitignore b/.gitignore index c9478a9c1..ad73a5535 100644 --- a/.gitignore +++ b/.gitignore @@ -72,7 +72,13 @@ GTAGS plane quad -# Ignore auto generated java files +# Ignore intermediate files generated by command-line android builds +# Couldn't figure out how to force these files into the ./build directory +androidgcs/build.xml +androidgcs/local.properties +androidgcs/proguard-project.txt + +# Ignore build output from Eclipse android builds androidgcs/bin/ androidgcs/gen/ /.cproject diff --git a/Makefile b/Makefile index 73c3a02b0..de4886a92 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,10 @@ TOOLS_DIR=$(ROOT_DIR)/tools BUILD_DIR=$(ROOT_DIR)/build DL_DIR=$(ROOT_DIR)/downloads +# Function for converting an absolute path to one relative +# to the top of the source tree. +toprel = $(subst $(realpath $(ROOT_DIR))/,,$(abspath $(1))) + # Clean out undesirable variables from the environment and command-line # to remove the chance that they will cause problems with our build define SANITIZE_VAR @@ -73,6 +77,7 @@ help: @echo " openocd_install - Install the OpenOCD JTAG daemon" @echo " stm32flash_install - Install the stm32flash tool for unbricking boards" @echo " dfuutil_install - Install the dfu-util tool for unbricking F4-based boards" + @echo " android_sdk_install - Install the Android SDK tools" @echo @echo " [Big Hammer]" @echo " all - Generate UAVObjects, build openpilot firmware and gcs" @@ -428,6 +433,32 @@ dfuutil_clean: $(V0) @echo " CLEAN $(DFUUTIL_DIR)" $(V1) [ ! -d "$(DFUUTIL_DIR)" ] || $(RM) -r "$(DFUUTIL_DIR)" +# see http://developer.android.com/sdk/ for latest versions +ANDROID_SDK_DIR := $(TOOLS_DIR)/android-sdk-linux +.PHONY: android_sdk_install +android_sdk_install: ANDROID_SDK_URL := http://dl.google.com/android/android-sdk_r20.0.3-linux.tgz +android_sdk_install: ANDROID_SDK_FILE := $(notdir $(ANDROID_SDK_URL)) +# order-only prereq on directory existance: +android_sdk_install: | $(DL_DIR) $(TOOLS_DIR) +android_sdk_install: android_sdk_clean + # download the source only if it's newer than what we already have + $(V0) @echo " DOWNLOAD $(ANDROID_SDK_URL)" + $(V1) wget --no-check-certificate -N -P "$(DL_DIR)" "$(ANDROID_SDK_URL)" + + # binary only release so just extract it + $(V0) @echo " EXTRACT $(ANDROID_SDK_FILE)" + $(V1) tar -C $(TOOLS_DIR) -xf "$(DL_DIR)/$(ANDROID_SDK_FILE)" + +.PHONY: android_sdk_clean +android_sdk_clean: + $(V0) @echo " CLEAN $(ANDROID_SDK_DIR)" + $(V1) [ ! -d "$(ANDROID_SDK_DIR)" ] || $(RM) -r $(ANDROID_SDK_DIR) + +.PHONY: android_sdk_update +android_sdk_update: + $(V0) @echo " UPDATE $(ANDROID_SDK_DIR)" + $(ANDROID_SDK_DIR)/tools/android update sdk --no-ui -t platform-tools,android-16,addon-google_apis-google-16 + ############################## # # Set up paths to tools @@ -455,6 +486,15 @@ else OPENOCD ?= openocd endif +ifeq ($(shell [ -d "$(ANDROID_SDK_DIR)" ] && echo "exists"), exists) + ANDROID := $(ANDROID_SDK_DIR)/tools/android + ANDROID_DX := $(ANDROID_SDK_DIR)/platform-tools/dx +else + # not installed, hope it's in the path... + ANDROID ?= android + ANDROID_DX ?= dx +endif + ############################## # # GCS related components @@ -512,6 +552,154 @@ uavobjects_clean: $(V0) @echo " CLEAN $@" $(V1) [ ! -d "$(UAVOBJ_OUT_DIR)" ] || $(RM) -r "$(UAVOBJ_OUT_DIR)" +################################ +# +# Android GCS related components +# +################################ + + +# Build the output directory for the Android GCS build +ANDROIDGCS_OUT_DIR := $(BUILD_DIR)/androidgcs +$(ANDROIDGCS_OUT_DIR): + $(V1) mkdir -p $@ + +# Build the asset directory for the android assets +ANDROIDGCS_ASSETS_DIR := $(ANDROIDGCS_OUT_DIR)/assets +$(ANDROIDGCS_ASSETS_DIR)/uavos: + $(V1) mkdir -p $@ + +ifeq ($(V), 1) +ANT_QUIET := +ANDROID_SILENT := +else +ANT_QUIET := -q +ANDROID_SILENT := -s +endif +.PHONY: androidgcs +androidgcs: uavo-collections_java + $(V0) @echo " ANDROID $(call toprel, $(ANDROIDGCS_OUT_DIR))" + $(V1) mkdir -p $(ANDROIDGCS_OUT_DIR) + $(V1) $(ANDROID) $(ANDROID_SILENT) update project --target 'Google Inc.:Google APIs:16' --name androidgcs --path ./androidgcs + $(V1) ant -f ./androidgcs/build.xml \ + $(ANT_QUIET) \ + -Dout.dir="../$(call toprel, $(ANDROIDGCS_OUT_DIR)/bin)" \ + -Dgen.absolute.dir="$(ANDROIDGCS_OUT_DIR)/gen" \ + debug + +.PHONY: androidgcs_clean +androidgcs_clean: + $(V0) @echo " CLEAN $@" + $(V1) [ ! -d "$(ANDROIDGCS_OUT_DIR)" ] || $(RM) -r "$(ANDROIDGCS_OUT_DIR)" + +# We want to take snapshots of the UAVOs at each point that they change +# to allow the GCS to be compatible with as many versions as possible. +# +# Find the git hashes of each commit that changes uavobjects with: +# git log --format=%h -- shared/uavobjectdefinition/ | head -n 2 +UAVO_GIT_VERSIONS := 684620d 43f85d9 + +# All versions includes a pseudo collection called "working" which represents +# the UAVOs in the source tree +UAVO_ALL_VERSIONS := $(UAVO_GIT_VERSIONS) srctree + +# This is where the UAVO collections are stored +UAVO_COLLECTION_DIR := $(BUILD_DIR)/uavo-collections + +# $(1) git hash of a UAVO snapshot +define UAVO_COLLECTION_GIT_TEMPLATE + +# Make the output directory that will contain all of the synthetics for the +# uavo collection referenced by the git hash $(1) +$$(UAVO_COLLECTION_DIR)/$(1): + $$(V1) mkdir -p $$(UAVO_COLLECTION_DIR)/$(1) + +# Extract the snapshot of shared/uavobjectdefinition from git hash $(1) +$$(UAVO_COLLECTION_DIR)/$(1)/uavo-xml.tar: | $$(UAVO_COLLECTION_DIR)/$(1) +$$(UAVO_COLLECTION_DIR)/$(1)/uavo-xml.tar: + $$(V0) @echo " UAVOTAR $(1)" + $$(V1) git archive $(1) -o $$@ -- shared/uavobjectdefinition/ + +# Extract the uavo xml files from our snapshot +$$(UAVO_COLLECTION_DIR)/$(1)/uavo-xml: $$(UAVO_COLLECTION_DIR)/$(1)/uavo-xml.tar + $$(V0) @echo " UAVOUNTAR $(1)" + $$(V1) rm -rf $$@ + $$(V1) mkdir -p $$@ + $$(V1) tar -C $$@ -xf $$< || rm -rf $$@ +endef + +# Map the current working directory into the set of UAVO collections +$(UAVO_COLLECTION_DIR)/srctree: + $(V1) mkdir -p $@ + +$(UAVO_COLLECTION_DIR)/srctree/uavo-xml: | $(UAVO_COLLECTION_DIR)/srctree +$(UAVO_COLLECTION_DIR)/srctree/uavo-xml: $(UAVOBJ_XML_DIR) + $(V1) ln -sf $(ROOT_DIR) $(UAVO_COLLECTION_DIR)/srctree/uavo-xml + +# $(1) git hash (or symbolic name) of a UAVO snapshot +define UAVO_COLLECTION_BUILD_TEMPLATE + +# This leaves us with a (broken) symlink that points to the full sha1sum of the collection +$$(UAVO_COLLECTION_DIR)/$(1)/uavohash: $$(UAVO_COLLECTION_DIR)/$(1)/uavo-xml + # Compute the sha1 hash for this UAVO collection + $$(V1) python $$(ROOT_DIR)/make/scripts/version-info.py \ + --path=$$(ROOT_DIR) \ + --uavodir=$$(UAVO_COLLECTION_DIR)/$(1)/uavo-xml/shared/uavobjectdefinition \ + --format='$$$${UAVOSHA1TXT}' | xargs -n1 -I{} ln -sf {} $$(UAVO_COLLECTION_DIR)/$(1)/uavohash + + # Create the target of the symlink (ie. a directory named by the actual UAVO hash) + $$(V0) @echo " UAVOHASH $(1) ->" $$$$(readlink $$(UAVO_COLLECTION_DIR)/$(1)/uavohash) + $$(V1) mkdir -p $$(UAVO_COLLECTION_DIR)/$(1)/$$$$(readlink $$(UAVO_COLLECTION_DIR)/$(1)/uavohash) + +# Generate the java uavobjects for this UAVO collection +$$(UAVO_COLLECTION_DIR)/$(1)/uavohash/java-build/java: $$(UAVO_COLLECTION_DIR)/$(1)/uavohash + $$(V0) @echo " UAVOJAVA $(1) " $$$$(readlink $$(UAVO_COLLECTION_DIR)/$(1)/uavohash) + $$(V1) mkdir -p $$@ + $$(V1) ( \ + cd $$(UAVO_COLLECTION_DIR)/$(1)/uavohash/java-build && \ + $$(UAVOBJGENERATOR) -java $$(UAVO_COLLECTION_DIR)/$(1)/uavo-xml/shared/uavobjectdefinition $$(ROOT_DIR) ; \ + ) + +# Build a jar file for this UAVO collection +$$(UAVO_COLLECTION_DIR)/$(1)/uavohash/java-build/uavobjects.jar: | $$(ANDROIDGCS_ASSETS_DIR)/uavos +$$(UAVO_COLLECTION_DIR)/$(1)/uavohash/java-build/uavobjects.jar: $$(UAVO_COLLECTION_DIR)/$(1)/uavohash/java-build/java + $$(V0) @echo " UAVOJAR $(1) " $$$$(readlink $$(UAVO_COLLECTION_DIR)/$(1)/uavohash) + $$(V1) ( \ + HASH=$$$$(readlink $$(UAVO_COLLECTION_DIR)/$(1)/uavohash) && \ + cd $$(UAVO_COLLECTION_DIR)/$(1)/uavohash/java-build && \ + javac java/*.java \ + $$(ROOT_DIR)/androidgcs/src/org/openpilot/uavtalk/UAVDataObject.java \ + $$(ROOT_DIR)/androidgcs/src/org/openpilot/uavtalk/UAVObject*.java \ + $$(ROOT_DIR)/androidgcs/src/org/openpilot/uavtalk/UAVMetaObject.java \ + -d . && \ + find ./org/openpilot/uavtalk/uavobjects -type f -name '*.class' > classlist.txt && \ + jar cf tmp_uavobjects.jar @classlist.txt && \ + $$(ANDROID_DX) \ + --dex \ + --output $$(ANDROIDGCS_ASSETS_DIR)/uavos/$$$${HASH}.jar \ + tmp_uavobjects.jar && \ + ln -sf $$(ANDROIDGCS_ASSETS_DIR)/uavos/$$$${HASH}.jar uavobjects.jar \ + ) + +endef + +# One of these for each element of UAVO_GIT_VERSIONS so we can extract the UAVOs from git +$(foreach githash, $(UAVO_GIT_VERSIONS), $(eval $(call UAVO_COLLECTION_GIT_TEMPLATE,$(githash)))) + +# One of these for each UAVO_ALL_VERSIONS which includes the ones in the srctree +$(foreach githash, $(UAVO_ALL_VERSIONS), $(eval $(call UAVO_COLLECTION_BUILD_TEMPLATE,$(githash)))) + +.PHONY: uavo-collections_java +uavo-collections_java: $(foreach githash, $(UAVO_ALL_VERSIONS), $(UAVO_COLLECTION_DIR)/$(githash)/uavohash/java-build/uavobjects.jar) + +.PHONY: uavo-collections +uavo-collections: uavo-collections_java + +.PHONY: uavo-collections_clean +uavo-collections_clean: + $(V0) @echo " CLEAN $(UAVO_COLLECTION_DIR)" + $(V1) [ ! -d "$(UAVO_COLLECTION_DIR)" ] || $(RM) -r $(UAVO_COLLECTION_DIR) + ############################## # # Flight related components diff --git a/androidgcs/.classpath b/androidgcs/.classpath index c88f96260..9e9c6b0d0 100644 --- a/androidgcs/.classpath +++ b/androidgcs/.classpath @@ -2,7 +2,6 @@ - diff --git a/androidgcs/AndroidManifest.xml b/androidgcs/AndroidManifest.xml index ac895fa28..068a01198 100644 --- a/androidgcs/AndroidManifest.xml +++ b/androidgcs/AndroidManifest.xml @@ -68,4 +68,4 @@ - \ No newline at end of file + diff --git a/androidgcs/assets/uavos b/androidgcs/assets/uavos new file mode 120000 index 000000000..913c42fb4 --- /dev/null +++ b/androidgcs/assets/uavos @@ -0,0 +1 @@ +../../build/androidgcs/assets/uavos \ No newline at end of file diff --git a/androidgcs/res/values/arrays.xml b/androidgcs/res/values/arrays.xml index d27dc7b11..4333bcc16 100644 --- a/androidgcs/res/values/arrays.xml +++ b/androidgcs/res/values/arrays.xml @@ -2,14 +2,12 @@ None - Fake Bluetooth Network HID 0 - 1 2 3 4 diff --git a/androidgcs/src/org/openpilot/androidgcs/CompassView.java b/androidgcs/src/org/openpilot/androidgcs/CompassView.java index b6b348588..01499011b 100644 --- a/androidgcs/src/org/openpilot/androidgcs/CompassView.java +++ b/androidgcs/src/org/openpilot/androidgcs/CompassView.java @@ -114,7 +114,7 @@ public class CompassView extends View { // Draw the background canvas.drawCircle(px, py, radius, circlePaint); - // Rotate our perspective so that the ÔtopÕ is + // Rotate our perspective so that the "top" is // facing the current bearing. canvas.save(); canvas.rotate((float) -bearing, px, py); diff --git a/androidgcs/src/org/openpilot/androidgcs/ObjectManagerActivity.java b/androidgcs/src/org/openpilot/androidgcs/ObjectManagerActivity.java index cf6b949a1..2d158ecbf 100644 --- a/androidgcs/src/org/openpilot/androidgcs/ObjectManagerActivity.java +++ b/androidgcs/src/org/openpilot/androidgcs/ObjectManagerActivity.java @@ -36,7 +36,6 @@ import java.util.Observable; import java.util.Observer; import java.util.Set; -import org.junit.Assert; import org.openpilot.androidgcs.fragments.ObjectManagerFragment; import org.openpilot.androidgcs.telemetry.OPTelemetryService; import org.openpilot.androidgcs.telemetry.OPTelemetryService.LocalBinder; @@ -206,7 +205,6 @@ public abstract class ObjectManagerActivity extends Activity { if (telemetryStatsConnected) { UAVObject stats = objMngr.getObject("GCSTelemetryStats"); - Assert.assertNotNull(stats); // Should not be null if we connected stats.removeUpdatedObserver(telemetryObserver); telemetryStatsConnected = false; diff --git a/androidgcs/src/org/openpilot/androidgcs/telemetry/OPTelemetryService.java b/androidgcs/src/org/openpilot/androidgcs/telemetry/OPTelemetryService.java index 69ab6e0d8..fe7b2b6d1 100644 --- a/androidgcs/src/org/openpilot/androidgcs/telemetry/OPTelemetryService.java +++ b/androidgcs/src/org/openpilot/androidgcs/telemetry/OPTelemetryService.java @@ -26,15 +26,22 @@ */ package org.openpilot.androidgcs.telemetry; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; import java.lang.ref.WeakReference; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; -import org.openpilot.uavtalk.UAVDataObject; import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.uavobjects.UAVObjectsInitialize; import android.app.Service; +import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; +import android.content.res.AssetManager; import android.os.Binder; import android.os.Handler; import android.os.HandlerThread; @@ -45,6 +52,7 @@ import android.os.Process; import android.preference.PreferenceManager; import android.util.Log; import android.widget.Toast; +import dalvik.system.DexClassLoader; public class OPTelemetryService extends Service { @@ -72,8 +80,6 @@ public class OPTelemetryService extends Service { static final int MSG_DISCONNECT = 3; static final int MSG_TOAST = 100; - private boolean terminate = false; - private Thread activeTelem; private TelemetryTask telemTask; @@ -103,7 +109,6 @@ public class OPTelemetryService extends Service { stopSelf(msg.arg2); break; case MSG_CONNECT: - terminate = false; int connection_type; SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(OPTelemetryService.this); try { @@ -115,10 +120,6 @@ public class OPTelemetryService extends Service { switch(connection_type) { case 0: // No connection return; - case 1: - Toast.makeText(getApplicationContext(), "Attempting fake connection", Toast.LENGTH_SHORT).show(); - activeTelem = new FakeTelemetryThread(); - break; case 2: Toast.makeText(getApplicationContext(), "Attempting BT connection", Toast.LENGTH_SHORT).show(); telemTask = new BluetoothUAVTalk(this); @@ -142,7 +143,6 @@ public class OPTelemetryService extends Service { case MSG_DISCONNECT: Toast.makeText(getApplicationContext(), "Disconnect requested", Toast.LENGTH_SHORT).show(); if (DEBUG) Log.d(TAG, "Calling disconnect"); - terminate = true; if (telemTask != null) { telemTask.disconnect(); telemTask = null; @@ -277,148 +277,120 @@ public class OPTelemetryService extends Service { public UAVObjectManager getObjectManager(); }; - // Fake class for testing, simply emits periodic updates on - private class FakeTelemetryThread extends Thread implements TelemTask { - private final UAVObjectManager objMngr; - @Override - public UAVObjectManager getObjectManager() { return objMngr; }; - FakeTelemetryThread() { - objMngr = new UAVObjectManager(); - UAVObjectsInitialize.register(objMngr); - } + /************************************************************/ + /* Everything below here has to do with getting the UAVOs */ + /* from the package. This shouldn't really be in the telem */ + /* service class but needs to be in this context */ + /************************************************************/ - @Override - public void run() { - System.out.println("Running fake thread"); + private static void copyStream(InputStream inputStream, OutputStream outputStream) throws IOException + { + byte[] buffer = new byte[1024 * 10]; + int numRead = inputStream.read(buffer); + while (numRead > 0) + { + outputStream.write(buffer, 0, numRead); + numRead = inputStream.read(buffer); + } + } + private void copyAssets(String JAR_DIR, String JAR_NAME) + { + File jarsDir = getDir(JAR_DIR, MODE_WORLD_READABLE); + AssetManager assetManager = getAssets(); + try + { + InputStream inputStream = null; + OutputStream outputStream = null; + try + { + File outputFile = new File(jarsDir, JAR_NAME); + inputStream = assetManager.open("uavos/" + JAR_NAME); + outputStream = new FileOutputStream(outputFile); + copyStream(inputStream, outputStream); + } + finally + { + if (inputStream != null) + inputStream.close(); + if (outputStream != null) + outputStream.close(); + } + } + catch (IOException e) + { + Log.e(TAG, e.toString(), e); + } + } - Intent intent = new Intent(); - intent.setAction(INTENT_ACTION_CONNECTED); - sendBroadcast(intent,null); + /** + * Delete the files in a directories + * @param directory + */ + private static void deleteDirectoryContents(File directory) + { + File contents[] = directory.listFiles(); + if (contents != null) + { + for (File file : contents) + { + if (file.isDirectory()) + deleteDirectoryContents(file); - //toastMessage("Started fake telemetry thread"); - UAVDataObject systemStats = (UAVDataObject) objMngr.getObject("SystemStats"); - UAVDataObject attitudeActual = (UAVDataObject) objMngr.getObject("AttitudeActual"); - UAVDataObject homeLocation = (UAVDataObject) objMngr.getObject("HomeLocation"); - UAVDataObject positionActual = (UAVDataObject) objMngr.getObject("PositionActual"); - UAVDataObject systemAlarms = (UAVDataObject) objMngr.getObject("SystemAlarms"); - - systemAlarms.getField("Alarm").setValue("Warning",0); - systemAlarms.getField("Alarm").setValue("OK",1); - systemAlarms.getField("Alarm").setValue("Critical",2); - systemAlarms.getField("Alarm").setValue("Error",3); - systemAlarms.updated(); - - homeLocation.getField("Latitude").setDouble(379420315); - homeLocation.getField("Longitude").setDouble(-88330078); - homeLocation.getField("Be").setDouble(26702.78710938,0); - homeLocation.getField("Be").setDouble(-1468.33605957,1); - homeLocation.getField("Be").setDouble(34181.78515625,2); - - - double roll = 0; - double pitch = 0; - double yaw = 0; - double north = 0; - double east = 0; - while( !terminate ) { - attitudeActual.getField("Roll").setDouble(roll); - attitudeActual.getField("Pitch").setDouble(pitch); - attitudeActual.getField("Yaw").setDouble(yaw); - positionActual.getField("North").setDouble(north += 100); - positionActual.getField("East").setDouble(east += 100); - roll = (roll + 10) % 180; - pitch = (pitch + 10) % 180; - yaw = (yaw + 10) % 360; - - systemStats.updated(); - attitudeActual.updated(); - positionActual.updated(); - try { - Thread.sleep(1000); - } catch (InterruptedException e) { - break; - } + file.delete(); } } } - /* - private class BTTelemetryThread extends Thread implements TelemTask { + /** + * Load the UAVObjects from a JAR file. This method must be called in the + * service context. + * @return True if success, False otherwise + */ + public boolean loadUavobjects(String jar, UAVObjectManager objMngr) { + final String JAR_DIR = "jars"; + final String DEX_DIR = "optimized_dex"; - private final UAVObjectManager objMngr; - private UAVTalk uavTalk; - private Telemetry tel; - private TelemetryMonitor mon; + copyAssets(JAR_DIR, jar); - @Override - public UAVObjectManager getObjectManager() { return objMngr; }; + Log.d(TAG, "Starting dex loader"); + File dexDir = getDir(DEX_DIR, Context.MODE_WORLD_READABLE); - BTTelemetryThread() { - objMngr = new UAVObjectManager(); - UAVObjectsInitialize.register(objMngr); + // Necessary to get dexOpt to run + if (dexDir.exists()) + deleteDirectoryContents(dexDir); + + File jarsDir = getDir(JAR_DIR, MODE_WORLD_READABLE); + String classpath = new File(jarsDir, jar).getAbsolutePath(); + + DexClassLoader loader = new DexClassLoader(classpath, dexDir.getAbsolutePath(), null, getClassLoader()); + + try { + Class initClass = loader.loadClass("org.openpilot.uavtalk.uavobjects.UAVObjectsInitialize"); + Method initMethod = initClass.getMethod("register", UAVObjectManager.class); + initMethod.invoke(null, objMngr); + } catch (ClassNotFoundException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + return false; + } catch (IllegalAccessException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + return false; + } catch (NoSuchMethodException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + return false; + } catch (IllegalArgumentException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + return false; + } catch (InvocationTargetException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + return false; } - @Override - public void run() { - if (DEBUG) Log.d(TAG, "Telemetry Thread started"); - - Looper.prepare(); - - BluetoothUAVTalk bt = new BluetoothUAVTalk(OPTelemetryService.this); - for( int i = 0; i < 10; i++ ) { - if (DEBUG) Log.d(TAG, "Attempting Bluetooth Connection"); - - bt.connect(objMngr); - - if (DEBUG) Log.d(TAG, "Done attempting connection"); - if( bt.getConnected() ) - break; - - try { - Thread.sleep(1000); - } catch (InterruptedException e) { - Log.e(TAG, "Thread interrupted while trying to connect"); - e.printStackTrace(); - return; - } - } - if( ! bt.getConnected() ) { - toastMessage("BT connection failed"); - return; - } - toastMessage("BT Connected"); - - if (DEBUG) Log.d(TAG, "Connected via bluetooth"); - - uavTalk = bt.getUavtalk(); - tel = new Telemetry(uavTalk, objMngr); - mon = new TelemetryMonitor(objMngr,tel); - mon.addObserver(new Observer() { - @Override - public void update(Observable arg0, Object arg1) { - if (DEBUG) Log.d(TAG, "Mon updated. Connected: " + mon.getConnected() + " objects updated: " + mon.getObjectsUpdated()); - if(mon.getConnected() ) { - Intent intent = new Intent(); - intent.setAction(INTENT_ACTION_CONNECTED); - sendBroadcast(intent,null); - } - } - }); - - - if (DEBUG) Log.d(TAG, "Entering UAVTalk processing loop"); - while( !terminate ) { - try { - if( !uavTalk.processInputStream() ) - break; - } catch (IOException e) { - // This occurs when they communication stream fails - toastMessage("Connection dropped"); - break; - } - } - if (DEBUG) Log.d(TAG, "UAVTalk stream disconnected"); - } - };*/ + return true; + } } diff --git a/androidgcs/src/org/openpilot/androidgcs/telemetry/TelemetryTask.java b/androidgcs/src/org/openpilot/androidgcs/telemetry/TelemetryTask.java index c9a44d6e1..aaa29a1e3 100644 --- a/androidgcs/src/org/openpilot/androidgcs/telemetry/TelemetryTask.java +++ b/androidgcs/src/org/openpilot/androidgcs/telemetry/TelemetryTask.java @@ -8,9 +8,11 @@ import java.util.Observer; import org.openpilot.uavtalk.Telemetry; import org.openpilot.uavtalk.TelemetryMonitor; +import org.openpilot.uavtalk.UAVObject; +import org.openpilot.uavtalk.UAVObjectField; import org.openpilot.uavtalk.UAVObjectManager; import org.openpilot.uavtalk.UAVTalk; -import org.openpilot.uavtalk.uavobjects.UAVObjectsInitialize; +import org.openpilot.uavtalk.uavobjects.TelemObjectsInitialize; import android.content.Intent; import android.os.Handler; @@ -91,6 +93,32 @@ public abstract class TelemetryTask implements Runnable { */ abstract boolean attemptConnection(); + private final Observer firmwareIapUpdated = new Observer() { + @Override + public void update(Observable observable, Object data) { + if (DEBUG) Log.d(TAG, "Received firmware IAP Updated message"); + + UAVObject obj = objMngr.getObject("FirmwareIAPObj"); + UAVObjectField description = obj.getField("Description"); + if(description == null || description.getNumElements() < 100) { + telemService.toastMessage("Failed to determine UAVO set"); + } else { + final int HASH_SIZE_USED = 20; + String jarName = new String(); + for(int i = 0; i < HASH_SIZE_USED; i++) + jarName += Integer.toHexString((int) description.getDouble(i+60)); + jarName += ".jar"; + if (DEBUG) Log.d(TAG, "Attempting to load: " + jarName); + if (telemService.loadUavobjects(jarName, objMngr) ) { + telemService.toastMessage("Loaded appropriate UAVO set"); + } else + telemService.toastMessage("Failed to determine UAVO set"); + } + + obj.removeUpdatedObserver(this); + } + }; + /** * Called when a physical channel is opened * @@ -103,7 +131,12 @@ public abstract class TelemetryTask implements Runnable { // be dependent on what is connected (e.g. board and // version number). objMngr = new UAVObjectManager(); - UAVObjectsInitialize.register(objMngr); + TelemObjectsInitialize.register(objMngr); + + // Register to get an update from FirmwareIAP in order to register + // the appropriate objects + UAVObject obj = objMngr.getObject("FirmwareIAPObj"); + obj.addUpdatedObserver(firmwareIapUpdated); // Create the required telemetry objects attached to this // data stream diff --git a/androidgcs/src/org/openpilot/uavtalk/UAVObjectManager.java b/androidgcs/src/org/openpilot/uavtalk/UAVObjectManager.java index 51cfeafd2..e61f78d67 100644 --- a/androidgcs/src/org/openpilot/uavtalk/UAVObjectManager.java +++ b/androidgcs/src/org/openpilot/uavtalk/UAVObjectManager.java @@ -70,7 +70,6 @@ public class UAVObjectManager { */ public synchronized boolean registerObject(UAVDataObject obj) throws Exception { - // QMutexLocker locker(mutex); ListIterator> objIt = objects.listIterator(0); diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/Accels.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/Accels.java deleted file mode 100644 index e3c386e30..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/Accels.java +++ /dev/null @@ -1,150 +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 accel data. - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -The accel data. - -generated from accels.xml - **/ -public class Accels extends UAVDataObject { - - public Accels() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List xElemNames = new ArrayList(); - xElemNames.add("0"); - fields.add( new UAVObjectField("x", "m/s^2", UAVObjectField.FieldType.FLOAT32, xElemNames, null) ); - - List yElemNames = new ArrayList(); - yElemNames.add("0"); - fields.add( new UAVObjectField("y", "m/s^2", UAVObjectField.FieldType.FLOAT32, yElemNames, null) ); - - List zElemNames = new ArrayList(); - zElemNames.add("0"); - fields.add( new UAVObjectField("z", "m/s^2", UAVObjectField.FieldType.FLOAT32, zElemNames, null) ); - - List temperatureElemNames = new ArrayList(); - temperatureElemNames.add("0"); - fields.add( new UAVObjectField("temperature", "deg C", UAVObjectField.FieldType.FLOAT32, temperatureElemNames, null) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 0 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 1000; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 0; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - Accels obj = new Accels(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public Accels GetInstance(UAVObjectManager objMngr, long instID) - { - return (Accels)(objMngr.getObject(Accels.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0xDD9D5FC0l; - protected static final String NAME = "Accels"; - protected static String DESCRIPTION = "The accel data."; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/AccessoryDesired.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/AccessoryDesired.java deleted file mode 100644 index 24da98961..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/AccessoryDesired.java +++ /dev/null @@ -1,138 +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. - * Desired Auxillary actuator settings. Comes from @ref ManualControlModule. - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -Desired Auxillary actuator settings. Comes from @ref ManualControlModule. - -generated from accessorydesired.xml - **/ -public class AccessoryDesired extends UAVDataObject { - - public AccessoryDesired() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List AccessoryValElemNames = new ArrayList(); - AccessoryValElemNames.add("0"); - fields.add( new UAVObjectField("AccessoryVal", "", UAVObjectField.FieldType.FLOAT32, AccessoryValElemNames, null) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 0 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 1000; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 0; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - AccessoryDesired obj = new AccessoryDesired(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public AccessoryDesired GetInstance(UAVObjectManager objMngr, long instID) - { - return (AccessoryDesired)(objMngr.getObject(AccessoryDesired.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0xC409985Al; - protected static final String NAME = "AccessoryDesired"; - protected static String DESCRIPTION = "Desired Auxillary actuator settings. Comes from @ref ManualControlModule."; - protected static final boolean ISSINGLEINST = 0 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/ActuatorCommand.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/ActuatorCommand.java deleted file mode 100644 index 917095171..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/ActuatorCommand.java +++ /dev/null @@ -1,159 +0,0 @@ -/** - ****************************************************************************** - * - * @file uavobjecttemplate.cpp - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * @brief Template for an uavobject in java - * This is a autogenerated file!! Do not modify and expect a result. - * Contains the pulse duration sent to each of the channels. Set by @ref ActuatorModule - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -Contains the pulse duration sent to each of the channels. Set by @ref ActuatorModule - -generated from actuatorcommand.xml - **/ -public class ActuatorCommand extends UAVDataObject { - - public ActuatorCommand() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List ChannelElemNames = new ArrayList(); - ChannelElemNames.add("0"); - ChannelElemNames.add("1"); - ChannelElemNames.add("2"); - ChannelElemNames.add("3"); - ChannelElemNames.add("4"); - ChannelElemNames.add("5"); - ChannelElemNames.add("6"); - ChannelElemNames.add("7"); - ChannelElemNames.add("8"); - ChannelElemNames.add("9"); - fields.add( new UAVObjectField("Channel", "us", UAVObjectField.FieldType.INT16, ChannelElemNames, null) ); - - List MaxUpdateTimeElemNames = new ArrayList(); - MaxUpdateTimeElemNames.add("0"); - fields.add( new UAVObjectField("MaxUpdateTime", "ms", UAVObjectField.FieldType.UINT16, MaxUpdateTimeElemNames, null) ); - - List UpdateTimeElemNames = new ArrayList(); - UpdateTimeElemNames.add("0"); - fields.add( new UAVObjectField("UpdateTime", "ms", UAVObjectField.FieldType.UINT8, UpdateTimeElemNames, null) ); - - List NumFailedUpdatesElemNames = new ArrayList(); - NumFailedUpdatesElemNames.add("0"); - fields.add( new UAVObjectField("NumFailedUpdates", "", UAVObjectField.FieldType.UINT8, NumFailedUpdatesElemNames, null) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 0 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 1000; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 0; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - ActuatorCommand obj = new ActuatorCommand(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public ActuatorCommand GetInstance(UAVObjectManager objMngr, long instID) - { - return (ActuatorCommand)(objMngr.getObject(ActuatorCommand.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x5324CB8l; - protected static final String NAME = "ActuatorCommand"; - protected static String DESCRIPTION = "Contains the pulse duration sent to each of the channels. Set by @ref ActuatorModule"; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/ActuatorDesired.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/ActuatorDesired.java deleted file mode 100644 index 8f7869ff9..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/ActuatorDesired.java +++ /dev/null @@ -1,158 +0,0 @@ -/** - ****************************************************************************** - * - * @file uavobjecttemplate.cpp - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * @brief Template for an uavobject in java - * This is a autogenerated file!! Do not modify and expect a result. - * Desired raw, pitch and yaw actuator settings. Comes from either @ref StabilizationModule or @ref ManualControlModule depending on FlightMode. - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -Desired raw, pitch and yaw actuator settings. Comes from either @ref StabilizationModule or @ref ManualControlModule depending on FlightMode. - -generated from actuatordesired.xml - **/ -public class ActuatorDesired extends UAVDataObject { - - public ActuatorDesired() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List RollElemNames = new ArrayList(); - RollElemNames.add("0"); - fields.add( new UAVObjectField("Roll", "%", UAVObjectField.FieldType.FLOAT32, RollElemNames, null) ); - - List PitchElemNames = new ArrayList(); - PitchElemNames.add("0"); - fields.add( new UAVObjectField("Pitch", "%", UAVObjectField.FieldType.FLOAT32, PitchElemNames, null) ); - - List YawElemNames = new ArrayList(); - YawElemNames.add("0"); - fields.add( new UAVObjectField("Yaw", "%", UAVObjectField.FieldType.FLOAT32, YawElemNames, null) ); - - List ThrottleElemNames = new ArrayList(); - ThrottleElemNames.add("0"); - fields.add( new UAVObjectField("Throttle", "%", UAVObjectField.FieldType.FLOAT32, ThrottleElemNames, null) ); - - List UpdateTimeElemNames = new ArrayList(); - UpdateTimeElemNames.add("0"); - fields.add( new UAVObjectField("UpdateTime", "ms", UAVObjectField.FieldType.FLOAT32, UpdateTimeElemNames, null) ); - - List NumLongUpdatesElemNames = new ArrayList(); - NumLongUpdatesElemNames.add("0"); - fields.add( new UAVObjectField("NumLongUpdates", "ms", UAVObjectField.FieldType.FLOAT32, NumLongUpdatesElemNames, null) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 0 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 1000; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 0; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - ActuatorDesired obj = new ActuatorDesired(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public ActuatorDesired GetInstance(UAVObjectManager objMngr, long instID) - { - return (ActuatorDesired)(objMngr.getObject(ActuatorDesired.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0xCA4BC4A4l; - protected static final String NAME = "ActuatorDesired"; - protected static String DESCRIPTION = "Desired raw, pitch and yaw actuator settings. Comes from either @ref StabilizationModule or @ref ManualControlModule depending on FlightMode."; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/ActuatorSettings.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/ActuatorSettings.java deleted file mode 100644 index a30913291..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/ActuatorSettings.java +++ /dev/null @@ -1,275 +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 ActuatorModule that controls the channel assignments for the mixer based on AircraftType - * - * @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 ActuatorModule that controls the channel assignments for the mixer based on AircraftType - -generated from actuatorsettings.xml - **/ -public class ActuatorSettings extends UAVDataObject { - - public ActuatorSettings() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List ChannelUpdateFreqElemNames = new ArrayList(); - ChannelUpdateFreqElemNames.add("0"); - ChannelUpdateFreqElemNames.add("1"); - ChannelUpdateFreqElemNames.add("2"); - ChannelUpdateFreqElemNames.add("3"); - fields.add( new UAVObjectField("ChannelUpdateFreq", "Hz", UAVObjectField.FieldType.UINT16, ChannelUpdateFreqElemNames, null) ); - - List ChannelMaxElemNames = new ArrayList(); - ChannelMaxElemNames.add("0"); - ChannelMaxElemNames.add("1"); - ChannelMaxElemNames.add("2"); - ChannelMaxElemNames.add("3"); - ChannelMaxElemNames.add("4"); - ChannelMaxElemNames.add("5"); - ChannelMaxElemNames.add("6"); - ChannelMaxElemNames.add("7"); - ChannelMaxElemNames.add("8"); - ChannelMaxElemNames.add("9"); - fields.add( new UAVObjectField("ChannelMax", "us", UAVObjectField.FieldType.INT16, ChannelMaxElemNames, null) ); - - List ChannelNeutralElemNames = new ArrayList(); - ChannelNeutralElemNames.add("0"); - ChannelNeutralElemNames.add("1"); - ChannelNeutralElemNames.add("2"); - ChannelNeutralElemNames.add("3"); - ChannelNeutralElemNames.add("4"); - ChannelNeutralElemNames.add("5"); - ChannelNeutralElemNames.add("6"); - ChannelNeutralElemNames.add("7"); - ChannelNeutralElemNames.add("8"); - ChannelNeutralElemNames.add("9"); - fields.add( new UAVObjectField("ChannelNeutral", "us", UAVObjectField.FieldType.INT16, ChannelNeutralElemNames, null) ); - - List ChannelMinElemNames = new ArrayList(); - ChannelMinElemNames.add("0"); - ChannelMinElemNames.add("1"); - ChannelMinElemNames.add("2"); - ChannelMinElemNames.add("3"); - ChannelMinElemNames.add("4"); - ChannelMinElemNames.add("5"); - ChannelMinElemNames.add("6"); - ChannelMinElemNames.add("7"); - ChannelMinElemNames.add("8"); - ChannelMinElemNames.add("9"); - fields.add( new UAVObjectField("ChannelMin", "us", UAVObjectField.FieldType.INT16, ChannelMinElemNames, null) ); - - List ChannelTypeElemNames = new ArrayList(); - ChannelTypeElemNames.add("0"); - ChannelTypeElemNames.add("1"); - ChannelTypeElemNames.add("2"); - ChannelTypeElemNames.add("3"); - ChannelTypeElemNames.add("4"); - ChannelTypeElemNames.add("5"); - ChannelTypeElemNames.add("6"); - ChannelTypeElemNames.add("7"); - ChannelTypeElemNames.add("8"); - ChannelTypeElemNames.add("9"); - List ChannelTypeEnumOptions = new ArrayList(); - ChannelTypeEnumOptions.add("PWM"); - ChannelTypeEnumOptions.add("MK"); - ChannelTypeEnumOptions.add("ASTEC4"); - ChannelTypeEnumOptions.add("PWM Alarm Buzzer"); - ChannelTypeEnumOptions.add("Arming led"); - ChannelTypeEnumOptions.add("Info led"); - fields.add( new UAVObjectField("ChannelType", "", UAVObjectField.FieldType.ENUM, ChannelTypeElemNames, ChannelTypeEnumOptions) ); - - List ChannelAddrElemNames = new ArrayList(); - ChannelAddrElemNames.add("0"); - ChannelAddrElemNames.add("1"); - ChannelAddrElemNames.add("2"); - ChannelAddrElemNames.add("3"); - ChannelAddrElemNames.add("4"); - ChannelAddrElemNames.add("5"); - ChannelAddrElemNames.add("6"); - ChannelAddrElemNames.add("7"); - ChannelAddrElemNames.add("8"); - ChannelAddrElemNames.add("9"); - fields.add( new UAVObjectField("ChannelAddr", "", UAVObjectField.FieldType.UINT8, ChannelAddrElemNames, null) ); - - List MotorsSpinWhileArmedElemNames = new ArrayList(); - MotorsSpinWhileArmedElemNames.add("0"); - List MotorsSpinWhileArmedEnumOptions = new ArrayList(); - MotorsSpinWhileArmedEnumOptions.add("FALSE"); - MotorsSpinWhileArmedEnumOptions.add("TRUE"); - fields.add( new UAVObjectField("MotorsSpinWhileArmed", "", UAVObjectField.FieldType.ENUM, MotorsSpinWhileArmedElemNames, MotorsSpinWhileArmedEnumOptions) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 1 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 0; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 0; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - getField("ChannelUpdateFreq").setValue(50,0); - getField("ChannelUpdateFreq").setValue(50,1); - getField("ChannelUpdateFreq").setValue(50,2); - getField("ChannelUpdateFreq").setValue(50,3); - getField("ChannelMax").setValue(1000,0); - getField("ChannelMax").setValue(1000,1); - getField("ChannelMax").setValue(1000,2); - getField("ChannelMax").setValue(1000,3); - getField("ChannelMax").setValue(1000,4); - getField("ChannelMax").setValue(1000,5); - getField("ChannelMax").setValue(1000,6); - getField("ChannelMax").setValue(1000,7); - getField("ChannelMax").setValue(1000,8); - getField("ChannelMax").setValue(1000,9); - getField("ChannelNeutral").setValue(1000,0); - getField("ChannelNeutral").setValue(1000,1); - getField("ChannelNeutral").setValue(1000,2); - getField("ChannelNeutral").setValue(1000,3); - getField("ChannelNeutral").setValue(1000,4); - getField("ChannelNeutral").setValue(1000,5); - getField("ChannelNeutral").setValue(1000,6); - getField("ChannelNeutral").setValue(1000,7); - getField("ChannelNeutral").setValue(1000,8); - getField("ChannelNeutral").setValue(1000,9); - getField("ChannelMin").setValue(1000,0); - getField("ChannelMin").setValue(1000,1); - getField("ChannelMin").setValue(1000,2); - getField("ChannelMin").setValue(1000,3); - getField("ChannelMin").setValue(1000,4); - getField("ChannelMin").setValue(1000,5); - getField("ChannelMin").setValue(1000,6); - getField("ChannelMin").setValue(1000,7); - getField("ChannelMin").setValue(1000,8); - getField("ChannelMin").setValue(1000,9); - getField("ChannelType").setValue("PWM",0); - getField("ChannelType").setValue("PWM",1); - getField("ChannelType").setValue("PWM",2); - getField("ChannelType").setValue("PWM",3); - getField("ChannelType").setValue("PWM",4); - getField("ChannelType").setValue("PWM",5); - getField("ChannelType").setValue("PWM",6); - getField("ChannelType").setValue("PWM",7); - getField("ChannelType").setValue("PWM",8); - getField("ChannelType").setValue("PWM",9); - getField("ChannelAddr").setValue(0,0); - getField("ChannelAddr").setValue(1,1); - getField("ChannelAddr").setValue(2,2); - getField("ChannelAddr").setValue(3,3); - getField("ChannelAddr").setValue(4,4); - getField("ChannelAddr").setValue(5,5); - getField("ChannelAddr").setValue(6,6); - getField("ChannelAddr").setValue(7,7); - getField("ChannelAddr").setValue(8,8); - getField("ChannelAddr").setValue(9,9); - getField("MotorsSpinWhileArmed").setValue("FALSE"); - - } - - /** - * 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(long instID) { - // TODO: Need to get specific instance to clone - try { - ActuatorSettings obj = new ActuatorSettings(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public ActuatorSettings GetInstance(UAVObjectManager objMngr, long instID) - { - return (ActuatorSettings)(objMngr.getObject(ActuatorSettings.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x1441DC6El; - 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 > 0; - protected static final boolean ISSETTINGS = 1 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/AltHoldSmoothed.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/AltHoldSmoothed.java deleted file mode 100644 index 4a49c8a5d..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/AltHoldSmoothed.java +++ /dev/null @@ -1,146 +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 output on the kalman filter on altitude. - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -The output on the kalman filter on altitude. - -generated from altholdsmoothed.xml - **/ -public class AltHoldSmoothed extends UAVDataObject { - - public AltHoldSmoothed() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List AltitudeElemNames = new ArrayList(); - AltitudeElemNames.add("0"); - fields.add( new UAVObjectField("Altitude", "m", UAVObjectField.FieldType.FLOAT32, AltitudeElemNames, null) ); - - List VelocityElemNames = new ArrayList(); - VelocityElemNames.add("0"); - fields.add( new UAVObjectField("Velocity", "m/s", UAVObjectField.FieldType.FLOAT32, VelocityElemNames, null) ); - - List AccelElemNames = new ArrayList(); - AccelElemNames.add("0"); - fields.add( new UAVObjectField("Accel", "m/s^2", UAVObjectField.FieldType.FLOAT32, AccelElemNames, null) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 0 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 1000; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 0; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - AltHoldSmoothed obj = new AltHoldSmoothed(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public AltHoldSmoothed GetInstance(UAVObjectManager objMngr, long instID) - { - return (AltHoldSmoothed)(objMngr.getObject(AltHoldSmoothed.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x2BC6B9D2l; - protected static final String NAME = "AltHoldSmoothed"; - protected static String DESCRIPTION = "The output on the kalman filter on altitude."; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/AltitudeHoldDesired.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/AltitudeHoldDesired.java deleted file mode 100644 index 880a88f3f..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/AltitudeHoldDesired.java +++ /dev/null @@ -1,150 +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. - * Holds the desired altitude (from manual control) as well as the desired attitude to pass through - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -Holds the desired altitude (from manual control) as well as the desired attitude to pass through - -generated from altitudeholddesired.xml - **/ -public class AltitudeHoldDesired extends UAVDataObject { - - public AltitudeHoldDesired() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List AltitudeElemNames = new ArrayList(); - AltitudeElemNames.add("0"); - fields.add( new UAVObjectField("Altitude", "m", UAVObjectField.FieldType.FLOAT32, AltitudeElemNames, null) ); - - List RollElemNames = new ArrayList(); - RollElemNames.add("0"); - fields.add( new UAVObjectField("Roll", "deg", UAVObjectField.FieldType.FLOAT32, RollElemNames, null) ); - - List PitchElemNames = new ArrayList(); - PitchElemNames.add("0"); - fields.add( new UAVObjectField("Pitch", "deg", UAVObjectField.FieldType.FLOAT32, PitchElemNames, null) ); - - List YawElemNames = new ArrayList(); - YawElemNames.add("0"); - fields.add( new UAVObjectField("Yaw", "deg/s", UAVObjectField.FieldType.FLOAT32, YawElemNames, null) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 0 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 0; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 1000; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - AltitudeHoldDesired obj = new AltitudeHoldDesired(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public AltitudeHoldDesired GetInstance(UAVObjectManager objMngr, long instID) - { - return (AltitudeHoldDesired)(objMngr.getObject(AltitudeHoldDesired.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x495BAD6El; - protected static final String NAME = "AltitudeHoldDesired"; - protected static String DESCRIPTION = "Holds the desired altitude (from manual control) as well as the desired attitude to pass through"; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/AltitudeHoldSettings.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/AltitudeHoldSettings.java deleted file mode 100644 index afe2ec487..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/AltitudeHoldSettings.java +++ /dev/null @@ -1,169 +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 AltitudeHold module - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -Settings for the @ref AltitudeHold module - -generated from altitudeholdsettings.xml - **/ -public class AltitudeHoldSettings extends UAVDataObject { - - public AltitudeHoldSettings() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List KpElemNames = new ArrayList(); - KpElemNames.add("0"); - fields.add( new UAVObjectField("Kp", "throttle/m", UAVObjectField.FieldType.FLOAT32, KpElemNames, null) ); - - List KiElemNames = new ArrayList(); - KiElemNames.add("0"); - fields.add( new UAVObjectField("Ki", "throttle/m", UAVObjectField.FieldType.FLOAT32, KiElemNames, null) ); - - List KdElemNames = new ArrayList(); - KdElemNames.add("0"); - fields.add( new UAVObjectField("Kd", "throttle/m", UAVObjectField.FieldType.FLOAT32, KdElemNames, null) ); - - List KaElemNames = new ArrayList(); - KaElemNames.add("0"); - fields.add( new UAVObjectField("Ka", "throttle/(m/s^2)", UAVObjectField.FieldType.FLOAT32, KaElemNames, null) ); - - List PressureNoiseElemNames = new ArrayList(); - PressureNoiseElemNames.add("0"); - fields.add( new UAVObjectField("PressureNoise", "m", UAVObjectField.FieldType.FLOAT32, PressureNoiseElemNames, null) ); - - List AccelNoiseElemNames = new ArrayList(); - AccelNoiseElemNames.add("0"); - fields.add( new UAVObjectField("AccelNoise", "m/s^2", UAVObjectField.FieldType.FLOAT32, AccelNoiseElemNames, null) ); - - List AccelDriftElemNames = new ArrayList(); - AccelDriftElemNames.add("0"); - fields.add( new UAVObjectField("AccelDrift", "m/s^2", UAVObjectField.FieldType.FLOAT32, AccelDriftElemNames, null) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 1 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 0; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 0; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - getField("Kp").setValue(0.03); - getField("Ki").setValue(0); - getField("Kd").setValue(0.03); - getField("Ka").setValue(0.005); - getField("PressureNoise").setValue(0.4); - getField("AccelNoise").setValue(5); - getField("AccelDrift").setValue(0.001); - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - AltitudeHoldSettings obj = new AltitudeHoldSettings(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public AltitudeHoldSettings GetInstance(UAVObjectManager objMngr, long instID) - { - return (AltitudeHoldSettings)(objMngr.getObject(AltitudeHoldSettings.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0xFEC55B42l; - protected static final String NAME = "AltitudeHoldSettings"; - protected static String DESCRIPTION = "Settings for the @ref AltitudeHold module"; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 1 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/AttitudeActual.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/AttitudeActual.java deleted file mode 100644 index d62253d0e..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/AttitudeActual.java +++ /dev/null @@ -1,162 +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 updated Attitude estimation from @ref AHRSCommsModule. - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -The updated Attitude estimation from @ref AHRSCommsModule. - -generated from attitudeactual.xml - **/ -public class AttitudeActual extends UAVDataObject { - - public AttitudeActual() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List q1ElemNames = new ArrayList(); - q1ElemNames.add("0"); - fields.add( new UAVObjectField("q1", "", UAVObjectField.FieldType.FLOAT32, q1ElemNames, null) ); - - List q2ElemNames = new ArrayList(); - q2ElemNames.add("0"); - fields.add( new UAVObjectField("q2", "", UAVObjectField.FieldType.FLOAT32, q2ElemNames, null) ); - - List q3ElemNames = new ArrayList(); - q3ElemNames.add("0"); - fields.add( new UAVObjectField("q3", "", UAVObjectField.FieldType.FLOAT32, q3ElemNames, null) ); - - List q4ElemNames = new ArrayList(); - q4ElemNames.add("0"); - fields.add( new UAVObjectField("q4", "", UAVObjectField.FieldType.FLOAT32, q4ElemNames, null) ); - - List RollElemNames = new ArrayList(); - RollElemNames.add("0"); - fields.add( new UAVObjectField("Roll", "degrees", UAVObjectField.FieldType.FLOAT32, RollElemNames, null) ); - - List PitchElemNames = new ArrayList(); - PitchElemNames.add("0"); - fields.add( new UAVObjectField("Pitch", "degrees", UAVObjectField.FieldType.FLOAT32, PitchElemNames, null) ); - - List YawElemNames = new ArrayList(); - YawElemNames.add("0"); - fields.add( new UAVObjectField("Yaw", "degrees", UAVObjectField.FieldType.FLOAT32, YawElemNames, null) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 0 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 100; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 0; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - AttitudeActual obj = new AttitudeActual(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public AttitudeActual GetInstance(UAVObjectManager objMngr, long instID) - { - return (AttitudeActual)(objMngr.getObject(AttitudeActual.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x33DAD5E6l; - protected static final String NAME = "AttitudeActual"; - protected static String DESCRIPTION = "The updated Attitude estimation from @ref AHRSCommsModule."; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/AttitudeSettings.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/AttitudeSettings.java deleted file mode 100644 index c43a2a993..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/AttitudeSettings.java +++ /dev/null @@ -1,206 +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 Attitude module used on CopterControl - * - * @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 Attitude module used on CopterControl - -generated from attitudesettings.xml - **/ -public class AttitudeSettings extends UAVDataObject { - - public AttitudeSettings() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List GyroGainElemNames = new ArrayList(); - GyroGainElemNames.add("0"); - fields.add( new UAVObjectField("GyroGain", "(rad/s)/lsb", UAVObjectField.FieldType.FLOAT32, GyroGainElemNames, null) ); - - List AccelKpElemNames = new ArrayList(); - AccelKpElemNames.add("0"); - fields.add( new UAVObjectField("AccelKp", "channel", UAVObjectField.FieldType.FLOAT32, AccelKpElemNames, null) ); - - List AccelKiElemNames = new ArrayList(); - AccelKiElemNames.add("0"); - fields.add( new UAVObjectField("AccelKi", "channel", UAVObjectField.FieldType.FLOAT32, AccelKiElemNames, null) ); - - List YawBiasRateElemNames = new ArrayList(); - YawBiasRateElemNames.add("0"); - fields.add( new UAVObjectField("YawBiasRate", "channel", UAVObjectField.FieldType.FLOAT32, YawBiasRateElemNames, null) ); - - List AccelBiasElemNames = new ArrayList(); - AccelBiasElemNames.add("X"); - AccelBiasElemNames.add("Y"); - AccelBiasElemNames.add("Z"); - fields.add( new UAVObjectField("AccelBias", "lsb", UAVObjectField.FieldType.INT16, AccelBiasElemNames, null) ); - - List GyroBiasElemNames = new ArrayList(); - GyroBiasElemNames.add("X"); - GyroBiasElemNames.add("Y"); - GyroBiasElemNames.add("Z"); - fields.add( new UAVObjectField("GyroBias", "deg/s * 100", UAVObjectField.FieldType.INT16, GyroBiasElemNames, null) ); - - List BoardRotationElemNames = new ArrayList(); - BoardRotationElemNames.add("Roll"); - BoardRotationElemNames.add("Pitch"); - BoardRotationElemNames.add("Yaw"); - fields.add( new UAVObjectField("BoardRotation", "deg", UAVObjectField.FieldType.INT16, BoardRotationElemNames, null) ); - - List ZeroDuringArmingElemNames = new ArrayList(); - ZeroDuringArmingElemNames.add("0"); - List ZeroDuringArmingEnumOptions = new ArrayList(); - ZeroDuringArmingEnumOptions.add("FALSE"); - ZeroDuringArmingEnumOptions.add("TRUE"); - fields.add( new UAVObjectField("ZeroDuringArming", "channel", UAVObjectField.FieldType.ENUM, ZeroDuringArmingElemNames, ZeroDuringArmingEnumOptions) ); - - List BiasCorrectGyroElemNames = new ArrayList(); - BiasCorrectGyroElemNames.add("0"); - List BiasCorrectGyroEnumOptions = new ArrayList(); - BiasCorrectGyroEnumOptions.add("FALSE"); - BiasCorrectGyroEnumOptions.add("TRUE"); - fields.add( new UAVObjectField("BiasCorrectGyro", "channel", UAVObjectField.FieldType.ENUM, BiasCorrectGyroElemNames, BiasCorrectGyroEnumOptions) ); - - List TrimFlightElemNames = new ArrayList(); - TrimFlightElemNames.add("0"); - List TrimFlightEnumOptions = new ArrayList(); - TrimFlightEnumOptions.add("NORMAL"); - TrimFlightEnumOptions.add("START"); - TrimFlightEnumOptions.add("LOAD"); - fields.add( new UAVObjectField("TrimFlight", "channel", UAVObjectField.FieldType.ENUM, TrimFlightElemNames, TrimFlightEnumOptions) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 1 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 0; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 0; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - getField("GyroGain").setValue(0.42); - getField("AccelKp").setValue(0.05); - getField("AccelKi").setValue(0.0001); - getField("YawBiasRate").setValue(1e-06); - getField("AccelBias").setValue(0,0); - getField("AccelBias").setValue(0,1); - getField("AccelBias").setValue(0,2); - getField("GyroBias").setValue(0,0); - getField("GyroBias").setValue(0,1); - getField("GyroBias").setValue(0,2); - getField("BoardRotation").setValue(0,0); - getField("BoardRotation").setValue(0,1); - getField("BoardRotation").setValue(0,2); - getField("ZeroDuringArming").setValue("TRUE"); - getField("BiasCorrectGyro").setValue("TRUE"); - getField("TrimFlight").setValue("NORMAL"); - - } - - /** - * 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(long instID) { - // TODO: Need to get specific instance to clone - try { - AttitudeSettings obj = new AttitudeSettings(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public AttitudeSettings GetInstance(UAVObjectManager objMngr, long instID) - { - return (AttitudeSettings)(objMngr.getObject(AttitudeSettings.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0xC307BC4Al; - protected static final String NAME = "AttitudeSettings"; - protected static String DESCRIPTION = "Settings for the @ref Attitude module used on CopterControl"; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 1 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/AttitudeSimulated.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/AttitudeSimulated.java deleted file mode 100644 index 2046d6add..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/AttitudeSimulated.java +++ /dev/null @@ -1,174 +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 simulated Attitude estimation from @ref Sensors. - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -The simulated Attitude estimation from @ref Sensors. - -generated from attitudesimulated.xml - **/ -public class AttitudeSimulated extends UAVDataObject { - - public AttitudeSimulated() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List q1ElemNames = new ArrayList(); - q1ElemNames.add("0"); - fields.add( new UAVObjectField("q1", "", UAVObjectField.FieldType.FLOAT32, q1ElemNames, null) ); - - List q2ElemNames = new ArrayList(); - q2ElemNames.add("0"); - fields.add( new UAVObjectField("q2", "", UAVObjectField.FieldType.FLOAT32, q2ElemNames, null) ); - - List q3ElemNames = new ArrayList(); - q3ElemNames.add("0"); - fields.add( new UAVObjectField("q3", "", UAVObjectField.FieldType.FLOAT32, q3ElemNames, null) ); - - List q4ElemNames = new ArrayList(); - q4ElemNames.add("0"); - fields.add( new UAVObjectField("q4", "", UAVObjectField.FieldType.FLOAT32, q4ElemNames, null) ); - - List RollElemNames = new ArrayList(); - RollElemNames.add("0"); - fields.add( new UAVObjectField("Roll", "degrees", UAVObjectField.FieldType.FLOAT32, RollElemNames, null) ); - - List PitchElemNames = new ArrayList(); - PitchElemNames.add("0"); - fields.add( new UAVObjectField("Pitch", "degrees", UAVObjectField.FieldType.FLOAT32, PitchElemNames, null) ); - - List YawElemNames = new ArrayList(); - YawElemNames.add("0"); - fields.add( new UAVObjectField("Yaw", "degrees", UAVObjectField.FieldType.FLOAT32, YawElemNames, null) ); - - List VelocityElemNames = new ArrayList(); - VelocityElemNames.add("North"); - VelocityElemNames.add("East"); - VelocityElemNames.add("Down"); - fields.add( new UAVObjectField("Velocity", "m/s", UAVObjectField.FieldType.FLOAT32, VelocityElemNames, null) ); - - List PositionElemNames = new ArrayList(); - PositionElemNames.add("North"); - PositionElemNames.add("East"); - PositionElemNames.add("Down"); - fields.add( new UAVObjectField("Position", "m", UAVObjectField.FieldType.FLOAT32, PositionElemNames, null) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 0 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 100; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 0; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - AttitudeSimulated obj = new AttitudeSimulated(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public AttitudeSimulated GetInstance(UAVObjectManager objMngr, long instID) - { - return (AttitudeSimulated)(objMngr.getObject(AttitudeSimulated.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x9266CE74l; - protected static final String NAME = "AttitudeSimulated"; - protected static String DESCRIPTION = "The simulated Attitude estimation from @ref Sensors."; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/BaroAirspeed.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/BaroAirspeed.java deleted file mode 100644 index 3a9e306f4..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/BaroAirspeed.java +++ /dev/null @@ -1,153 +0,0 @@ -/** - ****************************************************************************** - * - * @file uavobjecttemplate.cpp - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * @brief Template for an uavobject in java - * This is a autogenerated file!! Do not modify and expect a result. - * The raw data from the dynamic pressure sensor with pressure, temperature and airspeed. - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -The raw data from the dynamic pressure sensor with pressure, temperature and airspeed. - -generated from baroairspeed.xml - **/ -public class BaroAirspeed extends UAVDataObject { - - public BaroAirspeed() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List AirspeedElemNames = new ArrayList(); - AirspeedElemNames.add("0"); - fields.add( new UAVObjectField("Airspeed", "m/s", UAVObjectField.FieldType.FLOAT32, AirspeedElemNames, null) ); - - List SensorValueElemNames = new ArrayList(); - SensorValueElemNames.add("0"); - fields.add( new UAVObjectField("SensorValue", "raw", UAVObjectField.FieldType.UINT16, SensorValueElemNames, null) ); - - List ZeroPointElemNames = new ArrayList(); - ZeroPointElemNames.add("0"); - fields.add( new UAVObjectField("ZeroPoint", "raw", UAVObjectField.FieldType.UINT16, ZeroPointElemNames, null) ); - - List ConnectedElemNames = new ArrayList(); - ConnectedElemNames.add("0"); - List ConnectedEnumOptions = new ArrayList(); - ConnectedEnumOptions.add("False"); - ConnectedEnumOptions.add("True"); - fields.add( new UAVObjectField("Connected", "", UAVObjectField.FieldType.ENUM, ConnectedElemNames, ConnectedEnumOptions) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 0 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 1000; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 0; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - BaroAirspeed obj = new BaroAirspeed(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public BaroAirspeed GetInstance(UAVObjectManager objMngr, long instID) - { - return (BaroAirspeed)(objMngr.getObject(BaroAirspeed.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x169EA4Al; - protected static final String NAME = "BaroAirspeed"; - protected static String DESCRIPTION = "The raw data from the dynamic pressure sensor with pressure, temperature and airspeed."; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/BaroAltitude.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/BaroAltitude.java deleted file mode 100644 index 505a42c5f..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/BaroAltitude.java +++ /dev/null @@ -1,146 +0,0 @@ -/** - ****************************************************************************** - * - * @file uavobjecttemplate.cpp - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * @brief Template for an uavobject in java - * This is a autogenerated file!! Do not modify and expect a result. - * The raw data from the barometric sensor with pressure, temperature and altitude estimate. - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -The raw data from the barometric sensor with pressure, temperature and altitude estimate. - -generated from baroaltitude.xml - **/ -public class BaroAltitude extends UAVDataObject { - - public BaroAltitude() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List AltitudeElemNames = new ArrayList(); - AltitudeElemNames.add("0"); - fields.add( new UAVObjectField("Altitude", "m", UAVObjectField.FieldType.FLOAT32, AltitudeElemNames, null) ); - - List TemperatureElemNames = new ArrayList(); - TemperatureElemNames.add("0"); - fields.add( new UAVObjectField("Temperature", "C", UAVObjectField.FieldType.FLOAT32, TemperatureElemNames, null) ); - - List PressureElemNames = new ArrayList(); - PressureElemNames.add("0"); - fields.add( new UAVObjectField("Pressure", "kPa", UAVObjectField.FieldType.FLOAT32, PressureElemNames, null) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 0 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 1000; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 0; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - BaroAltitude obj = new BaroAltitude(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public BaroAltitude GetInstance(UAVObjectManager objMngr, long instID) - { - return (BaroAltitude)(objMngr.getObject(BaroAltitude.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x99622E6Al; - protected static final String NAME = "BaroAltitude"; - protected static String DESCRIPTION = "The raw data from the barometric sensor with pressure, temperature and altitude estimate."; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/CameraDesired.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/CameraDesired.java deleted file mode 100644 index caff64a0b..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/CameraDesired.java +++ /dev/null @@ -1,146 +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. - * Desired camera outputs. Comes from @ref CameraStabilization module. - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -Desired camera outputs. Comes from @ref CameraStabilization module. - -generated from cameradesired.xml - **/ -public class CameraDesired extends UAVDataObject { - - public CameraDesired() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List RollElemNames = new ArrayList(); - RollElemNames.add("0"); - fields.add( new UAVObjectField("Roll", "", UAVObjectField.FieldType.FLOAT32, RollElemNames, null) ); - - List PitchElemNames = new ArrayList(); - PitchElemNames.add("0"); - fields.add( new UAVObjectField("Pitch", "", UAVObjectField.FieldType.FLOAT32, PitchElemNames, null) ); - - List YawElemNames = new ArrayList(); - YawElemNames.add("0"); - fields.add( new UAVObjectField("Yaw", "", UAVObjectField.FieldType.FLOAT32, YawElemNames, null) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 0 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 1000; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 0; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - CameraDesired obj = new CameraDesired(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public CameraDesired GetInstance(UAVObjectManager objMngr, long instID) - { - return (CameraDesired)(objMngr.getObject(CameraDesired.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x531F544El; - protected static final String NAME = "CameraDesired"; - protected static String DESCRIPTION = "Desired camera outputs. Comes from @ref CameraStabilization module."; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/CameraStabSettings.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/CameraStabSettings.java deleted file mode 100644 index 9ddb2116d..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/CameraStabSettings.java +++ /dev/null @@ -1,204 +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 CameraStab mmodule - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -Settings for the @ref CameraStab mmodule - -generated from camerastabsettings.xml - **/ -public class CameraStabSettings extends UAVDataObject { - - public CameraStabSettings() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List MaxAxisLockRateElemNames = new ArrayList(); - MaxAxisLockRateElemNames.add("0"); - fields.add( new UAVObjectField("MaxAxisLockRate", "deg/s", UAVObjectField.FieldType.FLOAT32, MaxAxisLockRateElemNames, null) ); - - List ResponseTimeElemNames = new ArrayList(); - ResponseTimeElemNames.add("Roll"); - ResponseTimeElemNames.add("Pitch"); - ResponseTimeElemNames.add("Yaw"); - fields.add( new UAVObjectField("ResponseTime", "ms", UAVObjectField.FieldType.UINT16, ResponseTimeElemNames, null) ); - - List InputElemNames = new ArrayList(); - InputElemNames.add("Roll"); - InputElemNames.add("Pitch"); - InputElemNames.add("Yaw"); - List InputEnumOptions = new ArrayList(); - InputEnumOptions.add("Accessory0"); - InputEnumOptions.add("Accessory1"); - InputEnumOptions.add("Accessory2"); - InputEnumOptions.add("Accessory3"); - InputEnumOptions.add("Accessory4"); - InputEnumOptions.add("Accessory5"); - InputEnumOptions.add("None"); - fields.add( new UAVObjectField("Input", "channel", UAVObjectField.FieldType.ENUM, InputElemNames, InputEnumOptions) ); - - List InputRangeElemNames = new ArrayList(); - InputRangeElemNames.add("Roll"); - InputRangeElemNames.add("Pitch"); - InputRangeElemNames.add("Yaw"); - fields.add( new UAVObjectField("InputRange", "deg", UAVObjectField.FieldType.UINT8, InputRangeElemNames, null) ); - - List InputRateElemNames = new ArrayList(); - InputRateElemNames.add("Roll"); - InputRateElemNames.add("Pitch"); - InputRateElemNames.add("Yaw"); - fields.add( new UAVObjectField("InputRate", "deg/s", UAVObjectField.FieldType.UINT8, InputRateElemNames, null) ); - - List StabilizationModeElemNames = new ArrayList(); - StabilizationModeElemNames.add("Roll"); - StabilizationModeElemNames.add("Pitch"); - StabilizationModeElemNames.add("Yaw"); - List StabilizationModeEnumOptions = new ArrayList(); - StabilizationModeEnumOptions.add("Attitude"); - StabilizationModeEnumOptions.add("AxisLock"); - fields.add( new UAVObjectField("StabilizationMode", "", UAVObjectField.FieldType.ENUM, StabilizationModeElemNames, StabilizationModeEnumOptions) ); - - List OutputRangeElemNames = new ArrayList(); - OutputRangeElemNames.add("Roll"); - OutputRangeElemNames.add("Pitch"); - OutputRangeElemNames.add("Yaw"); - fields.add( new UAVObjectField("OutputRange", "deg", UAVObjectField.FieldType.UINT8, OutputRangeElemNames, null) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 1 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 0; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 0; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - getField("MaxAxisLockRate").setValue(1); - getField("ResponseTime").setValue(150,0); - getField("ResponseTime").setValue(150,1); - getField("ResponseTime").setValue(150,2); - getField("Input").setValue("None",0); - getField("Input").setValue("None",1); - getField("Input").setValue("None",2); - getField("InputRange").setValue(20,0); - getField("InputRange").setValue(20,1); - getField("InputRange").setValue(20,2); - getField("InputRate").setValue(50,0); - getField("InputRate").setValue(50,1); - getField("InputRate").setValue(50,2); - getField("StabilizationMode").setValue("Attitude",0); - getField("StabilizationMode").setValue("Attitude",1); - getField("StabilizationMode").setValue("Attitude",2); - getField("OutputRange").setValue(20,0); - getField("OutputRange").setValue(20,1); - getField("OutputRange").setValue(20,2); - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - CameraStabSettings obj = new CameraStabSettings(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public CameraStabSettings GetInstance(UAVObjectManager objMngr, long instID) - { - return (CameraStabSettings)(objMngr.getObject(CameraStabSettings.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x3B95DDBAl; - protected static final String NAME = "CameraStabSettings"; - protected static String DESCRIPTION = "Settings for the @ref CameraStab mmodule"; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 1 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/FaultSettings.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/FaultSettings.java deleted file mode 100644 index 881a5c225..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/FaultSettings.java +++ /dev/null @@ -1,146 +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. - * Allows testers to simulate various fault scenarios. - * - * @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; - -/** -Allows testers to simulate various fault scenarios. - -generated from faultsettings.xml - **/ -public class FaultSettings extends UAVDataObject { - - public FaultSettings() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List ActivateFaultElemNames = new ArrayList(); - ActivateFaultElemNames.add("0"); - List ActivateFaultEnumOptions = new ArrayList(); - ActivateFaultEnumOptions.add("NoFault"); - ActivateFaultEnumOptions.add("ModuleInitAssert"); - ActivateFaultEnumOptions.add("InitOutOfMemory"); - ActivateFaultEnumOptions.add("InitBusError"); - ActivateFaultEnumOptions.add("RunawayTask"); - ActivateFaultEnumOptions.add("TaskOutOfMemory"); - fields.add( new UAVObjectField("ActivateFault", "fault", UAVObjectField.FieldType.ENUM, ActivateFaultElemNames, ActivateFaultEnumOptions) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 1 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 0; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 0; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - getField("ActivateFault").setValue("NoFault"); - - } - - /** - * 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(long instID) { - // TODO: Need to get specific instance to clone - try { - FaultSettings obj = new FaultSettings(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public FaultSettings GetInstance(UAVObjectManager objMngr, long instID) - { - return (FaultSettings)(objMngr.getObject(FaultSettings.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x2778BA3Cl; - protected static final String NAME = "FaultSettings"; - protected static String DESCRIPTION = "Allows testers to simulate various fault scenarios."; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 1 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/FixedWingPathFollowerSettings.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/FixedWingPathFollowerSettings.java deleted file mode 100644 index 332873fe3..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/FixedWingPathFollowerSettings.java +++ /dev/null @@ -1,239 +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 FixedWingPathFollowerModule - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -Settings for the @ref FixedWingPathFollowerModule - -generated from fixedwingpathfollowersettings.xml - **/ -public class FixedWingPathFollowerSettings extends UAVDataObject { - - public FixedWingPathFollowerSettings() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List AirSpeedMaxElemNames = new ArrayList(); - AirSpeedMaxElemNames.add("0"); - fields.add( new UAVObjectField("AirSpeedMax", "m/s", UAVObjectField.FieldType.FLOAT32, AirSpeedMaxElemNames, null) ); - - List AirSpeedMinElemNames = new ArrayList(); - AirSpeedMinElemNames.add("0"); - fields.add( new UAVObjectField("AirSpeedMin", "m/s", UAVObjectField.FieldType.FLOAT32, AirSpeedMinElemNames, null) ); - - List VerticalVelMaxElemNames = new ArrayList(); - VerticalVelMaxElemNames.add("0"); - fields.add( new UAVObjectField("VerticalVelMax", "m/s", UAVObjectField.FieldType.FLOAT32, VerticalVelMaxElemNames, null) ); - - List HorizontalPosPElemNames = new ArrayList(); - HorizontalPosPElemNames.add("0"); - fields.add( new UAVObjectField("HorizontalPosP", "(m/s)/m", UAVObjectField.FieldType.FLOAT32, HorizontalPosPElemNames, null) ); - - List VerticalPosPElemNames = new ArrayList(); - VerticalPosPElemNames.add("0"); - fields.add( new UAVObjectField("VerticalPosP", "(m/s)/m", UAVObjectField.FieldType.FLOAT32, VerticalPosPElemNames, null) ); - - List CoursePIElemNames = new ArrayList(); - CoursePIElemNames.add("Kp"); - CoursePIElemNames.add("Ki"); - CoursePIElemNames.add("ILimit"); - fields.add( new UAVObjectField("CoursePI", "deg/deg", UAVObjectField.FieldType.FLOAT32, CoursePIElemNames, null) ); - - List SpeedPElemNames = new ArrayList(); - SpeedPElemNames.add("Kp"); - SpeedPElemNames.add("Max"); - fields.add( new UAVObjectField("SpeedP", "(m/s^2) / ((m/s)/(m/s)", UAVObjectField.FieldType.FLOAT32, SpeedPElemNames, null) ); - - List AccelPIElemNames = new ArrayList(); - AccelPIElemNames.add("Kp"); - AccelPIElemNames.add("Ki"); - AccelPIElemNames.add("ILimit"); - fields.add( new UAVObjectField("AccelPI", "deg / (m/s^2)", UAVObjectField.FieldType.FLOAT32, AccelPIElemNames, null) ); - - List VerticalToPitchCrossFeedElemNames = new ArrayList(); - VerticalToPitchCrossFeedElemNames.add("Kp"); - VerticalToPitchCrossFeedElemNames.add("Max"); - fields.add( new UAVObjectField("VerticalToPitchCrossFeed", "deg / ((m/s)/(m/s))", UAVObjectField.FieldType.FLOAT32, VerticalToPitchCrossFeedElemNames, null) ); - - List AirspeedToVerticalCrossFeedElemNames = new ArrayList(); - AirspeedToVerticalCrossFeedElemNames.add("Kp"); - AirspeedToVerticalCrossFeedElemNames.add("Max"); - fields.add( new UAVObjectField("AirspeedToVerticalCrossFeed", "(m/s) / ((m/s)/(m/s))", UAVObjectField.FieldType.FLOAT32, AirspeedToVerticalCrossFeedElemNames, null) ); - - List PowerPIElemNames = new ArrayList(); - PowerPIElemNames.add("Kp"); - PowerPIElemNames.add("Ki"); - PowerPIElemNames.add("ILimit"); - fields.add( new UAVObjectField("PowerPI", "1/(m/s)", UAVObjectField.FieldType.FLOAT32, PowerPIElemNames, null) ); - - List RollLimitElemNames = new ArrayList(); - RollLimitElemNames.add("Min"); - RollLimitElemNames.add("Neutral"); - RollLimitElemNames.add("Max"); - fields.add( new UAVObjectField("RollLimit", "deg", UAVObjectField.FieldType.FLOAT32, RollLimitElemNames, null) ); - - List PitchLimitElemNames = new ArrayList(); - PitchLimitElemNames.add("Min"); - PitchLimitElemNames.add("Neutral"); - PitchLimitElemNames.add("Max"); - fields.add( new UAVObjectField("PitchLimit", "deg", UAVObjectField.FieldType.FLOAT32, PitchLimitElemNames, null) ); - - List ThrottleLimitElemNames = new ArrayList(); - ThrottleLimitElemNames.add("Min"); - ThrottleLimitElemNames.add("Neutral"); - ThrottleLimitElemNames.add("Max"); - fields.add( new UAVObjectField("ThrottleLimit", "", UAVObjectField.FieldType.FLOAT32, ThrottleLimitElemNames, null) ); - - List UpdatePeriodElemNames = new ArrayList(); - UpdatePeriodElemNames.add("0"); - fields.add( new UAVObjectField("UpdatePeriod", "ms", UAVObjectField.FieldType.INT32, UpdatePeriodElemNames, null) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 1 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 0; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 0; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - getField("AirSpeedMax").setValue(15); - getField("AirSpeedMin").setValue(10); - getField("VerticalVelMax").setValue(10); - getField("HorizontalPosP").setValue(0.05); - getField("VerticalPosP").setValue(0.05); - getField("CoursePI").setValue(0.2,0); - getField("CoursePI").setValue(0,1); - getField("CoursePI").setValue(0,2); - getField("SpeedP").setValue(10,0); - getField("SpeedP").setValue(10,1); - getField("AccelPI").setValue(1.5,0); - getField("AccelPI").setValue(1.5,1); - getField("AccelPI").setValue(20,2); - getField("VerticalToPitchCrossFeed").setValue(50,0); - getField("VerticalToPitchCrossFeed").setValue(5,1); - getField("AirspeedToVerticalCrossFeed").setValue(100,0); - getField("AirspeedToVerticalCrossFeed").setValue(100,1); - getField("PowerPI").setValue(0.01,0); - getField("PowerPI").setValue(0.01,1); - getField("PowerPI").setValue(0.8,2); - getField("RollLimit").setValue(-35,0); - getField("RollLimit").setValue(0,1); - getField("RollLimit").setValue(35,2); - getField("PitchLimit").setValue(-10,0); - getField("PitchLimit").setValue(5,1); - getField("PitchLimit").setValue(20,2); - getField("ThrottleLimit").setValue(0.1,0); - getField("ThrottleLimit").setValue(0.5,1); - getField("ThrottleLimit").setValue(0.9,2); - getField("UpdatePeriod").setValue(100); - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - FixedWingPathFollowerSettings obj = new FixedWingPathFollowerSettings(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public FixedWingPathFollowerSettings GetInstance(UAVObjectManager objMngr, long instID) - { - return (FixedWingPathFollowerSettings)(objMngr.getObject(FixedWingPathFollowerSettings.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x8A3F1E02l; - protected static final String NAME = "FixedWingPathFollowerSettings"; - protected static String DESCRIPTION = "Settings for the @ref FixedWingPathFollowerModule"; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 1 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/FixedWingPathFollowerStatus.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/FixedWingPathFollowerStatus.java deleted file mode 100644 index 7aac671a0..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/FixedWingPathFollowerStatus.java +++ /dev/null @@ -1,164 +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. - * Object Storing Debugging Information on PID internals - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -Object Storing Debugging Information on PID internals - -generated from fixedwingpathfollowerstatus.xml - **/ -public class FixedWingPathFollowerStatus extends UAVDataObject { - - public FixedWingPathFollowerStatus() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List EElemNames = new ArrayList(); - EElemNames.add("Course"); - EElemNames.add("Speed"); - EElemNames.add("Accel"); - EElemNames.add("Power"); - fields.add( new UAVObjectField("E", "", UAVObjectField.FieldType.FLOAT32, EElemNames, null) ); - - List AElemNames = new ArrayList(); - AElemNames.add("Course"); - AElemNames.add("Speed"); - AElemNames.add("Accel"); - AElemNames.add("Power"); - fields.add( new UAVObjectField("A", "", UAVObjectField.FieldType.FLOAT32, AElemNames, null) ); - - List CElemNames = new ArrayList(); - CElemNames.add("Course"); - CElemNames.add("Speed"); - CElemNames.add("Accel"); - CElemNames.add("Power"); - fields.add( new UAVObjectField("C", "", UAVObjectField.FieldType.FLOAT32, CElemNames, null) ); - - List ErrorsElemNames = new ArrayList(); - ErrorsElemNames.add("Wind"); - ErrorsElemNames.add("Lowspeed"); - ErrorsElemNames.add("Highspeed"); - ErrorsElemNames.add("Lowpower"); - ErrorsElemNames.add("Highpower"); - ErrorsElemNames.add("Pitchcontrol"); - fields.add( new UAVObjectField("Errors", "", UAVObjectField.FieldType.UINT8, ErrorsElemNames, null) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 0 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 500; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 0; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - FixedWingPathFollowerStatus obj = new FixedWingPathFollowerStatus(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public FixedWingPathFollowerStatus GetInstance(UAVObjectManager objMngr, long instID) - { - return (FixedWingPathFollowerStatus)(objMngr.getObject(FixedWingPathFollowerStatus.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0xA0D6F6D4l; - protected static final String NAME = "FixedWingPathFollowerStatus"; - protected static String DESCRIPTION = "Object Storing Debugging Information on PID internals"; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightBatterySettings.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightBatterySettings.java deleted file mode 100644 index 9938cb78a..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightBatterySettings.java +++ /dev/null @@ -1,179 +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. - * Flight Battery configuration. - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -Flight Battery configuration. - -generated from flightbatterysettings.xml - **/ -public class FlightBatterySettings extends UAVDataObject { - - public FlightBatterySettings() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List CapacityElemNames = new ArrayList(); - CapacityElemNames.add("0"); - fields.add( new UAVObjectField("Capacity", "mAh", UAVObjectField.FieldType.UINT32, CapacityElemNames, null) ); - - List VoltageThresholdsElemNames = new ArrayList(); - VoltageThresholdsElemNames.add("Warning"); - VoltageThresholdsElemNames.add("Alarm"); - fields.add( new UAVObjectField("VoltageThresholds", "V", UAVObjectField.FieldType.FLOAT32, VoltageThresholdsElemNames, null) ); - - List SensorCalibrationsElemNames = new ArrayList(); - SensorCalibrationsElemNames.add("VoltageFactor"); - SensorCalibrationsElemNames.add("CurrentFactor"); - fields.add( new UAVObjectField("SensorCalibrations", "", UAVObjectField.FieldType.FLOAT32, SensorCalibrationsElemNames, null) ); - - List TypeElemNames = new ArrayList(); - TypeElemNames.add("0"); - List TypeEnumOptions = new ArrayList(); - TypeEnumOptions.add("LiPo"); - TypeEnumOptions.add("A123"); - TypeEnumOptions.add("LiCo"); - TypeEnumOptions.add("LiFeSO4"); - TypeEnumOptions.add("None"); - fields.add( new UAVObjectField("Type", "", UAVObjectField.FieldType.ENUM, TypeElemNames, TypeEnumOptions) ); - - List NbCellsElemNames = new ArrayList(); - NbCellsElemNames.add("0"); - fields.add( new UAVObjectField("NbCells", "", UAVObjectField.FieldType.UINT8, NbCellsElemNames, null) ); - - List SensorTypeElemNames = new ArrayList(); - SensorTypeElemNames.add("BatteryCurrent"); - SensorTypeElemNames.add("BatteryVoltage"); - List SensorTypeEnumOptions = new ArrayList(); - SensorTypeEnumOptions.add("Disabled"); - SensorTypeEnumOptions.add("Enabled"); - fields.add( new UAVObjectField("SensorType", "", UAVObjectField.FieldType.ENUM, SensorTypeElemNames, SensorTypeEnumOptions) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 1 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 0; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 0; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - getField("Capacity").setValue(2200); - getField("VoltageThresholds").setValue(9.8,0); - getField("VoltageThresholds").setValue(9.2,1); - getField("SensorCalibrations").setValue(1,0); - getField("SensorCalibrations").setValue(1,1); - getField("Type").setValue("LiPo"); - getField("NbCells").setValue(3); - getField("SensorType").setValue("Enabled",0); - getField("SensorType").setValue("Enabled",1); - - } - - /** - * 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(long instID) { - // TODO: Need to get specific instance to clone - try { - FlightBatterySettings obj = new FlightBatterySettings(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public FlightBatterySettings GetInstance(UAVObjectManager objMngr, long instID) - { - return (FlightBatterySettings)(objMngr.getObject(FlightBatterySettings.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x9D0F3FCEl; - protected static final String NAME = "FlightBatterySettings"; - protected static String DESCRIPTION = "Flight Battery configuration."; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 1 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightBatteryState.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightBatteryState.java deleted file mode 100644 index 796da0c18..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightBatteryState.java +++ /dev/null @@ -1,169 +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. - * Battery status information. - * - * @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; - -/** -Battery status information. - -generated from flightbatterystate.xml - **/ -public class FlightBatteryState extends UAVDataObject { - - public FlightBatteryState() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List VoltageElemNames = new ArrayList(); - VoltageElemNames.add("0"); - fields.add( new UAVObjectField("Voltage", "V", UAVObjectField.FieldType.FLOAT32, VoltageElemNames, null) ); - - List CurrentElemNames = new ArrayList(); - CurrentElemNames.add("0"); - fields.add( new UAVObjectField("Current", "A", UAVObjectField.FieldType.FLOAT32, CurrentElemNames, null) ); - - List BoardSupplyVoltageElemNames = new ArrayList(); - BoardSupplyVoltageElemNames.add("0"); - fields.add( new UAVObjectField("BoardSupplyVoltage", "V", UAVObjectField.FieldType.FLOAT32, BoardSupplyVoltageElemNames, null) ); - - List PeakCurrentElemNames = new ArrayList(); - PeakCurrentElemNames.add("0"); - fields.add( new UAVObjectField("PeakCurrent", "A", UAVObjectField.FieldType.FLOAT32, PeakCurrentElemNames, null) ); - - List AvgCurrentElemNames = new ArrayList(); - AvgCurrentElemNames.add("0"); - fields.add( new UAVObjectField("AvgCurrent", "A", UAVObjectField.FieldType.FLOAT32, AvgCurrentElemNames, null) ); - - List ConsumedEnergyElemNames = new ArrayList(); - ConsumedEnergyElemNames.add("0"); - fields.add( new UAVObjectField("ConsumedEnergy", "mAh", UAVObjectField.FieldType.FLOAT32, ConsumedEnergyElemNames, null) ); - - List EstimatedFlightTimeElemNames = new ArrayList(); - EstimatedFlightTimeElemNames.add("0"); - fields.add( new UAVObjectField("EstimatedFlightTime", "sec", UAVObjectField.FieldType.FLOAT32, EstimatedFlightTimeElemNames, null) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.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; - } - - /** - * 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("Voltage").setValue(0); - getField("Current").setValue(0); - getField("BoardSupplyVoltage").setValue(0); - getField("PeakCurrent").setValue(0); - getField("AvgCurrent").setValue(0); - getField("ConsumedEnergy").setValue(0); - getField("EstimatedFlightTime").setValue(0); - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - FlightBatteryState obj = new FlightBatteryState(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public FlightBatteryState GetInstance(UAVObjectManager objMngr, long instID) - { - return (FlightBatteryState)(objMngr.getObject(FlightBatteryState.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0xD2083596l; - protected static final String NAME = "FlightBatteryState"; - protected static String DESCRIPTION = "Battery status information."; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightPlanControl.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightPlanControl.java deleted file mode 100644 index f7ed37fc2..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightPlanControl.java +++ /dev/null @@ -1,143 +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. - * Control the flight plan script - * - * @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; - -/** -Control the flight plan script - -generated from flightplancontrol.xml - **/ -public class FlightPlanControl extends UAVDataObject { - - public FlightPlanControl() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List CommandElemNames = new ArrayList(); - CommandElemNames.add("0"); - List CommandEnumOptions = new ArrayList(); - CommandEnumOptions.add("Start"); - CommandEnumOptions.add("Stop"); - CommandEnumOptions.add("Kill"); - fields.add( new UAVObjectField("Command", "", UAVObjectField.FieldType.ENUM, CommandElemNames, CommandEnumOptions) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.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; - } - - /** - * 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("Command").setValue("Start"); - - } - - /** - * 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(long instID) { - // TODO: Need to get specific instance to clone - try { - FlightPlanControl obj = new FlightPlanControl(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public FlightPlanControl GetInstance(UAVObjectManager objMngr, long instID) - { - return (FlightPlanControl)(objMngr.getObject(FlightPlanControl.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x53E3F180l; - protected static final String NAME = "FlightPlanControl"; - protected static String DESCRIPTION = "Control the flight plan script"; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightPlanSettings.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightPlanSettings.java deleted file mode 100644 index a1c733686..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightPlanSettings.java +++ /dev/null @@ -1,139 +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 flight plan module, control the execution of the script - * - * @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 flight plan module, control the execution of the script - -generated from flightplansettings.xml - **/ -public class FlightPlanSettings extends UAVDataObject { - - public FlightPlanSettings() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List TestElemNames = new ArrayList(); - TestElemNames.add("0"); - fields.add( new UAVObjectField("Test", "", UAVObjectField.FieldType.FLOAT32, TestElemNames, null) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 1 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 0; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 0; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - getField("Test").setValue(0); - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - FlightPlanSettings obj = new FlightPlanSettings(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public FlightPlanSettings GetInstance(UAVObjectManager objMngr, long instID) - { - return (FlightPlanSettings)(objMngr.getObject(FlightPlanSettings.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x92E9FF76l; - protected static final String NAME = "FlightPlanSettings"; - protected static String DESCRIPTION = "Settings for the flight plan module, control the execution of the script"; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 1 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightPlanStatus.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightPlanStatus.java deleted file mode 100644 index 49ffc7b49..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightPlanStatus.java +++ /dev/null @@ -1,183 +0,0 @@ -/** - ****************************************************************************** - * - * @file uavobjecttemplate.cpp - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * @brief Template for an uavobject in java - * This is a autogenerated file!! Do not modify and expect a result. - * Status of the flight plan script - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -Status of the flight plan script - -generated from flightplanstatus.xml - **/ -public class FlightPlanStatus extends UAVDataObject { - - public FlightPlanStatus() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List ErrorFileIDElemNames = new ArrayList(); - ErrorFileIDElemNames.add("0"); - fields.add( new UAVObjectField("ErrorFileID", "", UAVObjectField.FieldType.UINT32, ErrorFileIDElemNames, null) ); - - List ErrorLineNumElemNames = new ArrayList(); - ErrorLineNumElemNames.add("0"); - fields.add( new UAVObjectField("ErrorLineNum", "", UAVObjectField.FieldType.UINT32, ErrorLineNumElemNames, null) ); - - List DebugElemNames = new ArrayList(); - DebugElemNames.add("0"); - DebugElemNames.add("1"); - fields.add( new UAVObjectField("Debug", "", UAVObjectField.FieldType.FLOAT32, DebugElemNames, null) ); - - List StatusElemNames = new ArrayList(); - StatusElemNames.add("0"); - List StatusEnumOptions = new ArrayList(); - StatusEnumOptions.add("Stopped"); - StatusEnumOptions.add("Running"); - StatusEnumOptions.add("Error"); - fields.add( new UAVObjectField("Status", "", UAVObjectField.FieldType.ENUM, StatusElemNames, StatusEnumOptions) ); - - List ErrorTypeElemNames = new ArrayList(); - ErrorTypeElemNames.add("0"); - List ErrorTypeEnumOptions = new ArrayList(); - ErrorTypeEnumOptions.add("None"); - ErrorTypeEnumOptions.add("VMInitError"); - ErrorTypeEnumOptions.add("Exception"); - ErrorTypeEnumOptions.add("IOError"); - ErrorTypeEnumOptions.add("DivByZero"); - ErrorTypeEnumOptions.add("AssertError"); - ErrorTypeEnumOptions.add("AttributeError"); - ErrorTypeEnumOptions.add("ImportError"); - ErrorTypeEnumOptions.add("IndexError"); - ErrorTypeEnumOptions.add("KeyError"); - ErrorTypeEnumOptions.add("MemoryError"); - ErrorTypeEnumOptions.add("NameError"); - ErrorTypeEnumOptions.add("SyntaxError"); - ErrorTypeEnumOptions.add("SystemError"); - ErrorTypeEnumOptions.add("TypeError"); - ErrorTypeEnumOptions.add("ValueError"); - ErrorTypeEnumOptions.add("StopIteration"); - ErrorTypeEnumOptions.add("Warning"); - ErrorTypeEnumOptions.add("UnknownError"); - fields.add( new UAVObjectField("ErrorType", "", UAVObjectField.FieldType.ENUM, ErrorTypeElemNames, ErrorTypeEnumOptions) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.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; - } - - /** - * 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("Debug").setValue(0,0); - getField("Debug").setValue(0,1); - getField("Status").setValue("Stopped"); - getField("ErrorType").setValue("None"); - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - FlightPlanStatus obj = new FlightPlanStatus(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public FlightPlanStatus GetInstance(UAVObjectManager objMngr, long instID) - { - return (FlightPlanStatus)(objMngr.getObject(FlightPlanStatus.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x2206EE46l; - protected static final String NAME = "FlightPlanStatus"; - protected static String DESCRIPTION = "Status of the flight plan script"; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightStatus.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightStatus.java deleted file mode 100644 index b8dc6c80d..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/FlightStatus.java +++ /dev/null @@ -1,158 +0,0 @@ -/** - ****************************************************************************** - * - * @file uavobjecttemplate.cpp - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * @brief Template for an uavobject in java - * This is a autogenerated file!! Do not modify and expect a result. - * Contains major flight status information for other modules. - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -Contains major flight status information for other modules. - -generated from flightstatus.xml - **/ -public class FlightStatus extends UAVDataObject { - - public FlightStatus() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List ArmedElemNames = new ArrayList(); - ArmedElemNames.add("0"); - List ArmedEnumOptions = new ArrayList(); - ArmedEnumOptions.add("Disarmed"); - ArmedEnumOptions.add("Arming"); - ArmedEnumOptions.add("Armed"); - fields.add( new UAVObjectField("Armed", "", UAVObjectField.FieldType.ENUM, ArmedElemNames, ArmedEnumOptions) ); - - List FlightModeElemNames = new ArrayList(); - FlightModeElemNames.add("0"); - List FlightModeEnumOptions = new ArrayList(); - FlightModeEnumOptions.add("Manual"); - FlightModeEnumOptions.add("Stabilized1"); - FlightModeEnumOptions.add("Stabilized2"); - FlightModeEnumOptions.add("Stabilized3"); - FlightModeEnumOptions.add("Autotune"); - FlightModeEnumOptions.add("AltitudeHold"); - FlightModeEnumOptions.add("VelocityControl"); - FlightModeEnumOptions.add("PositionHold"); - FlightModeEnumOptions.add("PathPlanner"); - FlightModeEnumOptions.add("RTH"); - fields.add( new UAVObjectField("FlightMode", "", UAVObjectField.FieldType.ENUM, FlightModeElemNames, FlightModeEnumOptions) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.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; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - getField("Armed").setValue("Disarmed"); - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - FlightStatus obj = new FlightStatus(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public FlightStatus GetInstance(UAVObjectManager objMngr, long instID) - { - return (FlightStatus)(objMngr.getObject(FlightStatus.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x30079F4El; - protected static final String NAME = "FlightStatus"; - protected static String DESCRIPTION = "Contains major flight status information for other modules."; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/GCSReceiver.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/GCSReceiver.java deleted file mode 100644 index dd4ad9d33..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/GCSReceiver.java +++ /dev/null @@ -1,145 +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. - * A receiver channel group carried over the telemetry link. - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -A receiver channel group carried over the telemetry link. - -generated from gcsreceiver.xml - **/ -public class GCSReceiver extends UAVDataObject { - - public GCSReceiver() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List ChannelElemNames = new ArrayList(); - ChannelElemNames.add("0"); - ChannelElemNames.add("1"); - ChannelElemNames.add("2"); - ChannelElemNames.add("3"); - ChannelElemNames.add("4"); - ChannelElemNames.add("5"); - ChannelElemNames.add("6"); - ChannelElemNames.add("7"); - fields.add( new UAVObjectField("Channel", "us", UAVObjectField.FieldType.UINT16, ChannelElemNames, null) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.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; - } - - /** - * 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(long instID) { - // TODO: Need to get specific instance to clone - try { - GCSReceiver obj = new GCSReceiver(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public GCSReceiver GetInstance(UAVObjectManager objMngr, long instID) - { - return (GCSReceiver)(objMngr.getObject(GCSReceiver.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0xCC7E1470l; - 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 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/GPSPosition.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/GPSPosition.java deleted file mode 100644 index a13d11799..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/GPSPosition.java +++ /dev/null @@ -1,183 +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. - * Raw GPS data from @ref GPSModule. Should only be used by @ref AHRSCommsModule. - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -Raw GPS data from @ref GPSModule. Should only be used by @ref AHRSCommsModule. - -generated from gpsposition.xml - **/ -public class GPSPosition extends UAVDataObject { - - public GPSPosition() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List LatitudeElemNames = new ArrayList(); - LatitudeElemNames.add("0"); - fields.add( new UAVObjectField("Latitude", "degrees x 10^-7", UAVObjectField.FieldType.INT32, LatitudeElemNames, null) ); - - List LongitudeElemNames = new ArrayList(); - LongitudeElemNames.add("0"); - fields.add( new UAVObjectField("Longitude", "degrees x 10^-7", UAVObjectField.FieldType.INT32, LongitudeElemNames, null) ); - - List AltitudeElemNames = new ArrayList(); - AltitudeElemNames.add("0"); - fields.add( new UAVObjectField("Altitude", "meters", UAVObjectField.FieldType.FLOAT32, AltitudeElemNames, null) ); - - List GeoidSeparationElemNames = new ArrayList(); - GeoidSeparationElemNames.add("0"); - fields.add( new UAVObjectField("GeoidSeparation", "meters", UAVObjectField.FieldType.FLOAT32, GeoidSeparationElemNames, null) ); - - List HeadingElemNames = new ArrayList(); - HeadingElemNames.add("0"); - fields.add( new UAVObjectField("Heading", "degrees", UAVObjectField.FieldType.FLOAT32, HeadingElemNames, null) ); - - List GroundspeedElemNames = new ArrayList(); - GroundspeedElemNames.add("0"); - fields.add( new UAVObjectField("Groundspeed", "m/s", UAVObjectField.FieldType.FLOAT32, GroundspeedElemNames, null) ); - - List PDOPElemNames = new ArrayList(); - PDOPElemNames.add("0"); - fields.add( new UAVObjectField("PDOP", "", UAVObjectField.FieldType.FLOAT32, PDOPElemNames, null) ); - - List HDOPElemNames = new ArrayList(); - HDOPElemNames.add("0"); - fields.add( new UAVObjectField("HDOP", "", UAVObjectField.FieldType.FLOAT32, HDOPElemNames, null) ); - - List VDOPElemNames = new ArrayList(); - VDOPElemNames.add("0"); - fields.add( new UAVObjectField("VDOP", "", UAVObjectField.FieldType.FLOAT32, VDOPElemNames, null) ); - - List StatusElemNames = new ArrayList(); - StatusElemNames.add("0"); - List StatusEnumOptions = new ArrayList(); - StatusEnumOptions.add("NoGPS"); - StatusEnumOptions.add("NoFix"); - StatusEnumOptions.add("Fix2D"); - StatusEnumOptions.add("Fix3D"); - fields.add( new UAVObjectField("Status", "", UAVObjectField.FieldType.ENUM, StatusElemNames, StatusEnumOptions) ); - - List SatellitesElemNames = new ArrayList(); - SatellitesElemNames.add("0"); - fields.add( new UAVObjectField("Satellites", "", UAVObjectField.FieldType.INT8, SatellitesElemNames, null) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 0 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 1000; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 1000; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - GPSPosition obj = new GPSPosition(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public GPSPosition GetInstance(UAVObjectManager objMngr, long instID) - { - return (GPSPosition)(objMngr.getObject(GPSPosition.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0xE2A323B6l; - protected static final String NAME = "GPSPosition"; - protected static String DESCRIPTION = "Raw GPS data from @ref GPSModule. Should only be used by @ref AHRSCommsModule."; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/GPSSatellites.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/GPSSatellites.java deleted file mode 100644 index 0463bd4a1..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/GPSSatellites.java +++ /dev/null @@ -1,214 +0,0 @@ -/** - ****************************************************************************** - * - * @file uavobjecttemplate.cpp - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * @brief Template for an uavobject in java - * This is a autogenerated file!! Do not modify and expect a result. - * Contains information about the GPS satellites in view from @ref GPSModule. - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -Contains information about the GPS satellites in view from @ref GPSModule. - -generated from gpssatellites.xml - **/ -public class GPSSatellites extends UAVDataObject { - - public GPSSatellites() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List ElevationElemNames = new ArrayList(); - ElevationElemNames.add("0"); - ElevationElemNames.add("1"); - ElevationElemNames.add("2"); - ElevationElemNames.add("3"); - ElevationElemNames.add("4"); - ElevationElemNames.add("5"); - ElevationElemNames.add("6"); - ElevationElemNames.add("7"); - ElevationElemNames.add("8"); - ElevationElemNames.add("9"); - ElevationElemNames.add("10"); - ElevationElemNames.add("11"); - ElevationElemNames.add("12"); - ElevationElemNames.add("13"); - ElevationElemNames.add("14"); - ElevationElemNames.add("15"); - fields.add( new UAVObjectField("Elevation", "degrees", UAVObjectField.FieldType.FLOAT32, ElevationElemNames, null) ); - - List AzimuthElemNames = new ArrayList(); - AzimuthElemNames.add("0"); - AzimuthElemNames.add("1"); - AzimuthElemNames.add("2"); - AzimuthElemNames.add("3"); - AzimuthElemNames.add("4"); - AzimuthElemNames.add("5"); - AzimuthElemNames.add("6"); - AzimuthElemNames.add("7"); - AzimuthElemNames.add("8"); - AzimuthElemNames.add("9"); - AzimuthElemNames.add("10"); - AzimuthElemNames.add("11"); - AzimuthElemNames.add("12"); - AzimuthElemNames.add("13"); - AzimuthElemNames.add("14"); - AzimuthElemNames.add("15"); - fields.add( new UAVObjectField("Azimuth", "degrees", UAVObjectField.FieldType.FLOAT32, AzimuthElemNames, null) ); - - List SatsInViewElemNames = new ArrayList(); - SatsInViewElemNames.add("0"); - fields.add( new UAVObjectField("SatsInView", "", UAVObjectField.FieldType.INT8, SatsInViewElemNames, null) ); - - List PRNElemNames = new ArrayList(); - PRNElemNames.add("0"); - PRNElemNames.add("1"); - PRNElemNames.add("2"); - PRNElemNames.add("3"); - PRNElemNames.add("4"); - PRNElemNames.add("5"); - PRNElemNames.add("6"); - PRNElemNames.add("7"); - PRNElemNames.add("8"); - PRNElemNames.add("9"); - PRNElemNames.add("10"); - PRNElemNames.add("11"); - PRNElemNames.add("12"); - PRNElemNames.add("13"); - PRNElemNames.add("14"); - PRNElemNames.add("15"); - fields.add( new UAVObjectField("PRN", "", UAVObjectField.FieldType.INT8, PRNElemNames, null) ); - - List SNRElemNames = new ArrayList(); - SNRElemNames.add("0"); - SNRElemNames.add("1"); - SNRElemNames.add("2"); - SNRElemNames.add("3"); - SNRElemNames.add("4"); - SNRElemNames.add("5"); - SNRElemNames.add("6"); - SNRElemNames.add("7"); - SNRElemNames.add("8"); - SNRElemNames.add("9"); - SNRElemNames.add("10"); - SNRElemNames.add("11"); - SNRElemNames.add("12"); - SNRElemNames.add("13"); - SNRElemNames.add("14"); - SNRElemNames.add("15"); - fields.add( new UAVObjectField("SNR", "", UAVObjectField.FieldType.INT8, SNRElemNames, null) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.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; - } - - /** - * 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(long instID) { - // TODO: Need to get specific instance to clone - try { - GPSSatellites obj = new GPSSatellites(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public GPSSatellites GetInstance(UAVObjectManager objMngr, long instID) - { - return (GPSSatellites)(objMngr.getObject(GPSSatellites.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x920D998l; - protected static final String NAME = "GPSSatellites"; - protected static String DESCRIPTION = "Contains information about the GPS satellites in view from @ref GPSModule."; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/GPSSettings.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/GPSSettings.java deleted file mode 100644 index 317d4d249..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/GPSSettings.java +++ /dev/null @@ -1,142 +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 GPS - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -Settings for the GPS - -generated from gpssettings.xml - **/ -public class GPSSettings extends UAVDataObject { - - public GPSSettings() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List DataProtocolElemNames = new ArrayList(); - DataProtocolElemNames.add("0"); - List DataProtocolEnumOptions = new ArrayList(); - DataProtocolEnumOptions.add("NMEA"); - DataProtocolEnumOptions.add("UBX"); - fields.add( new UAVObjectField("DataProtocol", "", UAVObjectField.FieldType.ENUM, DataProtocolElemNames, DataProtocolEnumOptions) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 1 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 0; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 0; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - getField("DataProtocol").setValue("UBX"); - - } - - /** - * 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(long instID) { - // TODO: Need to get specific instance to clone - try { - GPSSettings obj = new GPSSettings(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public GPSSettings GetInstance(UAVObjectManager objMngr, long instID) - { - return (GPSSettings)(objMngr.getObject(GPSSettings.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0xAC5F6370l; - protected static final String NAME = "GPSSettings"; - protected static String DESCRIPTION = "Settings for the GPS"; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 1 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/GPSTime.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/GPSTime.java deleted file mode 100644 index 81fef701e..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/GPSTime.java +++ /dev/null @@ -1,158 +0,0 @@ -/** - ****************************************************************************** - * - * @file uavobjecttemplate.cpp - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * @brief Template for an uavobject in java - * This is a autogenerated file!! Do not modify and expect a result. - * Contains the GPS time from @ref GPSModule. Required to compute the world magnetic model correctly when setting the home location. - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -Contains the GPS time from @ref GPSModule. Required to compute the world magnetic model correctly when setting the home location. - -generated from gpstime.xml - **/ -public class GPSTime extends UAVDataObject { - - public GPSTime() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List YearElemNames = new ArrayList(); - YearElemNames.add("0"); - fields.add( new UAVObjectField("Year", "", UAVObjectField.FieldType.INT16, YearElemNames, null) ); - - List MonthElemNames = new ArrayList(); - MonthElemNames.add("0"); - fields.add( new UAVObjectField("Month", "", UAVObjectField.FieldType.INT8, MonthElemNames, null) ); - - List DayElemNames = new ArrayList(); - DayElemNames.add("0"); - fields.add( new UAVObjectField("Day", "", UAVObjectField.FieldType.INT8, DayElemNames, null) ); - - List HourElemNames = new ArrayList(); - HourElemNames.add("0"); - fields.add( new UAVObjectField("Hour", "", UAVObjectField.FieldType.INT8, HourElemNames, null) ); - - List MinuteElemNames = new ArrayList(); - MinuteElemNames.add("0"); - fields.add( new UAVObjectField("Minute", "", UAVObjectField.FieldType.INT8, MinuteElemNames, null) ); - - List SecondElemNames = new ArrayList(); - SecondElemNames.add("0"); - fields.add( new UAVObjectField("Second", "", UAVObjectField.FieldType.INT8, SecondElemNames, null) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.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; - } - - /** - * 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(long instID) { - // TODO: Need to get specific instance to clone - try { - GPSTime obj = new GPSTime(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public GPSTime GetInstance(UAVObjectManager objMngr, long instID) - { - return (GPSTime)(objMngr.getObject(GPSTime.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0xD4478084l; - protected static final String NAME = "GPSTime"; - protected static String DESCRIPTION = "Contains the GPS time from @ref GPSModule. Required to compute the world magnetic model correctly when setting the home location."; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/GPSVelocity.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/GPSVelocity.java deleted file mode 100644 index 432f039a8..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/GPSVelocity.java +++ /dev/null @@ -1,146 +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. - * Raw GPS data from @ref GPSModule. - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -Raw GPS data from @ref GPSModule. - -generated from gpsvelocity.xml - **/ -public class GPSVelocity extends UAVDataObject { - - public GPSVelocity() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List NorthElemNames = new ArrayList(); - NorthElemNames.add("0"); - fields.add( new UAVObjectField("North", "m/s", UAVObjectField.FieldType.FLOAT32, NorthElemNames, null) ); - - List EastElemNames = new ArrayList(); - EastElemNames.add("0"); - fields.add( new UAVObjectField("East", "m/s", UAVObjectField.FieldType.FLOAT32, EastElemNames, null) ); - - List DownElemNames = new ArrayList(); - DownElemNames.add("0"); - fields.add( new UAVObjectField("Down", "m/s", UAVObjectField.FieldType.FLOAT32, DownElemNames, null) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 0 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 1000; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 1000; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - GPSVelocity obj = new GPSVelocity(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public GPSVelocity GetInstance(UAVObjectManager objMngr, long instID) - { - return (GPSVelocity)(objMngr.getObject(GPSVelocity.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x8245DC80l; - protected static final String NAME = "GPSVelocity"; - protected static String DESCRIPTION = "Raw GPS data from @ref GPSModule."; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/GuidanceSettings.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/GuidanceSettings.java deleted file mode 100644 index 7bf3f5a02..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/GuidanceSettings.java +++ /dev/null @@ -1,210 +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 fields = new ArrayList(); - - - List HorizontalPosPIElemNames = new ArrayList(); - HorizontalPosPIElemNames.add("Kp"); - HorizontalPosPIElemNames.add("Ki"); - HorizontalPosPIElemNames.add("ILimit"); - fields.add( new UAVObjectField("HorizontalPosPI", "(m/s)/m", UAVObjectField.FieldType.FLOAT32, HorizontalPosPIElemNames, null) ); - - List HorizontalVelPIDElemNames = new ArrayList(); - HorizontalVelPIDElemNames.add("Kp"); - HorizontalVelPIDElemNames.add("Ki"); - HorizontalVelPIDElemNames.add("Kd"); - HorizontalVelPIDElemNames.add("ILimit"); - fields.add( new UAVObjectField("HorizontalVelPID", "deg/(m/s)", UAVObjectField.FieldType.FLOAT32, HorizontalVelPIDElemNames, null) ); - - List VerticalPosPIElemNames = new ArrayList(); - VerticalPosPIElemNames.add("Kp"); - VerticalPosPIElemNames.add("Ki"); - VerticalPosPIElemNames.add("ILimit"); - fields.add( new UAVObjectField("VerticalPosPI", "", UAVObjectField.FieldType.FLOAT32, VerticalPosPIElemNames, null) ); - - List VerticalVelPIDElemNames = new ArrayList(); - VerticalVelPIDElemNames.add("Kp"); - VerticalVelPIDElemNames.add("Ki"); - VerticalVelPIDElemNames.add("Kd"); - VerticalVelPIDElemNames.add("ILimit"); - fields.add( new UAVObjectField("VerticalVelPID", "", UAVObjectField.FieldType.FLOAT32, VerticalVelPIDElemNames, null) ); - - List MaxRollPitchElemNames = new ArrayList(); - MaxRollPitchElemNames.add("0"); - fields.add( new UAVObjectField("MaxRollPitch", "deg", UAVObjectField.FieldType.FLOAT32, MaxRollPitchElemNames, null) ); - - List UpdatePeriodElemNames = new ArrayList(); - UpdatePeriodElemNames.add("0"); - fields.add( new UAVObjectField("UpdatePeriod", "", UAVObjectField.FieldType.INT32, UpdatePeriodElemNames, null) ); - - List HorizontalVelMaxElemNames = new ArrayList(); - HorizontalVelMaxElemNames.add("0"); - fields.add( new UAVObjectField("HorizontalVelMax", "m/s", UAVObjectField.FieldType.UINT16, HorizontalVelMaxElemNames, null) ); - - List VerticalVelMaxElemNames = new ArrayList(); - VerticalVelMaxElemNames.add("0"); - fields.add( new UAVObjectField("VerticalVelMax", "m/s", UAVObjectField.FieldType.UINT16, VerticalVelMaxElemNames, null) ); - - List GuidanceModeElemNames = new ArrayList(); - GuidanceModeElemNames.add("0"); - List GuidanceModeEnumOptions = new ArrayList(); - GuidanceModeEnumOptions.add("DUAL_LOOP"); - GuidanceModeEnumOptions.add("VELOCITY_CONTROL"); - fields.add( new UAVObjectField("GuidanceMode", "", UAVObjectField.FieldType.ENUM, GuidanceModeElemNames, GuidanceModeEnumOptions) ); - - List ThrottleControlElemNames = new ArrayList(); - ThrottleControlElemNames.add("0"); - List ThrottleControlEnumOptions = new ArrayList(); - ThrottleControlEnumOptions.add("FALSE"); - ThrottleControlEnumOptions.add("TRUE"); - fields.add( new UAVObjectField("ThrottleControl", "", UAVObjectField.FieldType.ENUM, ThrottleControlElemNames, ThrottleControlEnumOptions) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 1 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 0; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 0; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - getField("HorizontalPosPI").setValue(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(long 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, long instID) - { - return (GuidanceSettings)(objMngr.getObject(GuidanceSettings.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x6EA79FB4l; - protected static final String NAME = "GuidanceSettings"; - protected static String DESCRIPTION = "Settings for the @ref GuidanceModule"; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 1 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/Gyros.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/Gyros.java deleted file mode 100644 index b3de76547..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/Gyros.java +++ /dev/null @@ -1,150 +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 gyro data. - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -The gyro data. - -generated from gyros.xml - **/ -public class Gyros extends UAVDataObject { - - public Gyros() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List xElemNames = new ArrayList(); - xElemNames.add("0"); - fields.add( new UAVObjectField("x", "deg/s", UAVObjectField.FieldType.FLOAT32, xElemNames, null) ); - - List yElemNames = new ArrayList(); - yElemNames.add("0"); - fields.add( new UAVObjectField("y", "deg/s", UAVObjectField.FieldType.FLOAT32, yElemNames, null) ); - - List zElemNames = new ArrayList(); - zElemNames.add("0"); - fields.add( new UAVObjectField("z", "deg/s", UAVObjectField.FieldType.FLOAT32, zElemNames, null) ); - - List temperatureElemNames = new ArrayList(); - temperatureElemNames.add("0"); - fields.add( new UAVObjectField("temperature", "deg C", UAVObjectField.FieldType.FLOAT32, temperatureElemNames, null) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 0 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 1000; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 0; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - Gyros obj = new Gyros(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public Gyros GetInstance(UAVObjectManager objMngr, long instID) - { - return (Gyros)(objMngr.getObject(Gyros.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x4228AF6l; - protected static final String NAME = "Gyros"; - protected static String DESCRIPTION = "The gyro data."; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/GyrosBias.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/GyrosBias.java deleted file mode 100644 index 3a51fcdb3..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/GyrosBias.java +++ /dev/null @@ -1,146 +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 gyro data. - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -The gyro data. - -generated from gyrosbias.xml - **/ -public class GyrosBias extends UAVDataObject { - - public GyrosBias() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List xElemNames = new ArrayList(); - xElemNames.add("0"); - fields.add( new UAVObjectField("x", "deg/s", UAVObjectField.FieldType.FLOAT32, xElemNames, null) ); - - List yElemNames = new ArrayList(); - yElemNames.add("0"); - fields.add( new UAVObjectField("y", "deg/s", UAVObjectField.FieldType.FLOAT32, yElemNames, null) ); - - List zElemNames = new ArrayList(); - zElemNames.add("0"); - fields.add( new UAVObjectField("z", "deg/s", UAVObjectField.FieldType.FLOAT32, zElemNames, null) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 0 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 1000; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 0; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - GyrosBias obj = new GyrosBias(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public GyrosBias GetInstance(UAVObjectManager objMngr, long instID) - { - return (GyrosBias)(objMngr.getObject(GyrosBias.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0xE4B6F980l; - protected static final String NAME = "GyrosBias"; - protected static String DESCRIPTION = "The gyro data."; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/HomeLocation.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/HomeLocation.java deleted file mode 100644 index f4f976fa0..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/HomeLocation.java +++ /dev/null @@ -1,171 +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. - * HomeLocation setting which contains the constants to tranlate from longitutde and latitude to NED reference frame. Automatically set by @ref GPSModule after acquiring a 3D lock. Used by @ref AHRSCommsModule. - * - * @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; - -/** -HomeLocation setting which contains the constants to tranlate from longitutde and latitude to NED reference frame. Automatically set by @ref GPSModule after acquiring a 3D lock. Used by @ref AHRSCommsModule. - -generated from homelocation.xml - **/ -public class HomeLocation extends UAVDataObject { - - public HomeLocation() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List LatitudeElemNames = new ArrayList(); - LatitudeElemNames.add("0"); - fields.add( new UAVObjectField("Latitude", "deg * 10e6", UAVObjectField.FieldType.INT32, LatitudeElemNames, null) ); - - List LongitudeElemNames = new ArrayList(); - LongitudeElemNames.add("0"); - fields.add( new UAVObjectField("Longitude", "deg * 10e6", UAVObjectField.FieldType.INT32, LongitudeElemNames, null) ); - - List AltitudeElemNames = new ArrayList(); - AltitudeElemNames.add("0"); - fields.add( new UAVObjectField("Altitude", "m over geoid", UAVObjectField.FieldType.FLOAT32, AltitudeElemNames, null) ); - - List BeElemNames = new ArrayList(); - BeElemNames.add("0"); - BeElemNames.add("1"); - BeElemNames.add("2"); - fields.add( new UAVObjectField("Be", "", UAVObjectField.FieldType.FLOAT32, BeElemNames, null) ); - - List g_eElemNames = new ArrayList(); - g_eElemNames.add("0"); - fields.add( new UAVObjectField("g_e", "m/s^2", UAVObjectField.FieldType.FLOAT32, g_eElemNames, null) ); - - List SetElemNames = new ArrayList(); - SetElemNames.add("0"); - List SetEnumOptions = new ArrayList(); - SetEnumOptions.add("FALSE"); - SetEnumOptions.add("TRUE"); - fields.add( new UAVObjectField("Set", "", UAVObjectField.FieldType.ENUM, SetElemNames, SetEnumOptions) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 1 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 0; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 0; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - getField("Latitude").setValue(0); - getField("Longitude").setValue(0); - getField("Altitude").setValue(0); - getField("Be").setValue(0,0); - getField("Be").setValue(0,1); - getField("Be").setValue(0,2); - getField("g_e").setValue(9.81); - getField("Set").setValue("FALSE"); - - } - - /** - * 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(long instID) { - // TODO: Need to get specific instance to clone - try { - HomeLocation obj = new HomeLocation(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public HomeLocation GetInstance(UAVObjectManager objMngr, long instID) - { - return (HomeLocation)(objMngr.getObject(HomeLocation.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x6185DC6El; - protected static final String NAME = "HomeLocation"; - protected static String DESCRIPTION = "HomeLocation setting which contains the constants to tranlate from longitutde and latitude to NED reference frame. Automatically set by @ref GPSModule after acquiring a 3D lock. Used by @ref AHRSCommsModule."; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 1 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/HwSettings.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/HwSettings.java deleted file mode 100644 index 5e22fc6df..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/HwSettings.java +++ /dev/null @@ -1,340 +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. - * Selection of optional hardware configurations. - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -Selection of optional hardware configurations. - -generated from hwsettings.xml - **/ -public class HwSettings extends UAVDataObject { - - public HwSettings() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List CC_RcvrPortElemNames = new ArrayList(); - CC_RcvrPortElemNames.add("0"); - List CC_RcvrPortEnumOptions = new ArrayList(); - CC_RcvrPortEnumOptions.add("Disabled"); - CC_RcvrPortEnumOptions.add("PWM"); - CC_RcvrPortEnumOptions.add("PPM"); - CC_RcvrPortEnumOptions.add("PPM+Outputs"); - CC_RcvrPortEnumOptions.add("Outputs"); - fields.add( new UAVObjectField("CC_RcvrPort", "function", UAVObjectField.FieldType.ENUM, CC_RcvrPortElemNames, CC_RcvrPortEnumOptions) ); - - List CC_MainPortElemNames = new ArrayList(); - CC_MainPortElemNames.add("0"); - List CC_MainPortEnumOptions = new ArrayList(); - CC_MainPortEnumOptions.add("Disabled"); - CC_MainPortEnumOptions.add("Telemetry"); - CC_MainPortEnumOptions.add("GPS"); - CC_MainPortEnumOptions.add("S.Bus"); - CC_MainPortEnumOptions.add("DSM2"); - CC_MainPortEnumOptions.add("DSMX (10bit)"); - CC_MainPortEnumOptions.add("DSMX (11bit)"); - CC_MainPortEnumOptions.add("ComAux"); - CC_MainPortEnumOptions.add("ComBridge"); - fields.add( new UAVObjectField("CC_MainPort", "function", UAVObjectField.FieldType.ENUM, CC_MainPortElemNames, CC_MainPortEnumOptions) ); - - List CC_FlexiPortElemNames = new ArrayList(); - CC_FlexiPortElemNames.add("0"); - List CC_FlexiPortEnumOptions = new ArrayList(); - CC_FlexiPortEnumOptions.add("Disabled"); - CC_FlexiPortEnumOptions.add("Telemetry"); - CC_FlexiPortEnumOptions.add("GPS"); - CC_FlexiPortEnumOptions.add("I2C"); - CC_FlexiPortEnumOptions.add("DSM2"); - CC_FlexiPortEnumOptions.add("DSMX (10bit)"); - CC_FlexiPortEnumOptions.add("DSMX (11bit)"); - CC_FlexiPortEnumOptions.add("ComAux"); - CC_FlexiPortEnumOptions.add("ComBridge"); - fields.add( new UAVObjectField("CC_FlexiPort", "function", UAVObjectField.FieldType.ENUM, CC_FlexiPortElemNames, CC_FlexiPortEnumOptions) ); - - List RV_RcvrPortElemNames = new ArrayList(); - RV_RcvrPortElemNames.add("0"); - List RV_RcvrPortEnumOptions = new ArrayList(); - RV_RcvrPortEnumOptions.add("Disabled"); - RV_RcvrPortEnumOptions.add("PWM"); - RV_RcvrPortEnumOptions.add("PPM"); - RV_RcvrPortEnumOptions.add("PPM+Outputs"); - RV_RcvrPortEnumOptions.add("Outputs"); - fields.add( new UAVObjectField("RV_RcvrPort", "function", UAVObjectField.FieldType.ENUM, RV_RcvrPortElemNames, RV_RcvrPortEnumOptions) ); - - List RV_AuxPortElemNames = new ArrayList(); - RV_AuxPortElemNames.add("0"); - List RV_AuxPortEnumOptions = new ArrayList(); - RV_AuxPortEnumOptions.add("Disabled"); - RV_AuxPortEnumOptions.add("Telemetry"); - RV_AuxPortEnumOptions.add("DSM2"); - RV_AuxPortEnumOptions.add("DSMX (10bit)"); - RV_AuxPortEnumOptions.add("DSMX (11bit)"); - RV_AuxPortEnumOptions.add("ComAux"); - RV_AuxPortEnumOptions.add("ComBridge"); - fields.add( new UAVObjectField("RV_AuxPort", "function", UAVObjectField.FieldType.ENUM, RV_AuxPortElemNames, RV_AuxPortEnumOptions) ); - - List RV_AuxSBusPortElemNames = new ArrayList(); - RV_AuxSBusPortElemNames.add("0"); - List RV_AuxSBusPortEnumOptions = new ArrayList(); - RV_AuxSBusPortEnumOptions.add("Disabled"); - RV_AuxSBusPortEnumOptions.add("S.Bus"); - RV_AuxSBusPortEnumOptions.add("DSM2"); - RV_AuxSBusPortEnumOptions.add("DSMX (10bit)"); - RV_AuxSBusPortEnumOptions.add("DSMX (11bit)"); - RV_AuxSBusPortEnumOptions.add("ComAux"); - RV_AuxSBusPortEnumOptions.add("ComBridge"); - fields.add( new UAVObjectField("RV_AuxSBusPort", "function", UAVObjectField.FieldType.ENUM, RV_AuxSBusPortElemNames, RV_AuxSBusPortEnumOptions) ); - - List RV_FlexiPortElemNames = new ArrayList(); - RV_FlexiPortElemNames.add("0"); - List RV_FlexiPortEnumOptions = new ArrayList(); - RV_FlexiPortEnumOptions.add("Disabled"); - RV_FlexiPortEnumOptions.add("I2C"); - RV_FlexiPortEnumOptions.add("DSM2"); - RV_FlexiPortEnumOptions.add("DSMX (10bit)"); - RV_FlexiPortEnumOptions.add("DSMX (11bit)"); - RV_FlexiPortEnumOptions.add("ComAux"); - RV_FlexiPortEnumOptions.add("ComBridge"); - fields.add( new UAVObjectField("RV_FlexiPort", "function", UAVObjectField.FieldType.ENUM, RV_FlexiPortElemNames, RV_FlexiPortEnumOptions) ); - - List RV_TelemetryPortElemNames = new ArrayList(); - RV_TelemetryPortElemNames.add("0"); - List RV_TelemetryPortEnumOptions = new ArrayList(); - RV_TelemetryPortEnumOptions.add("Disabled"); - RV_TelemetryPortEnumOptions.add("Telemetry"); - RV_TelemetryPortEnumOptions.add("ComAux"); - RV_TelemetryPortEnumOptions.add("ComBridge"); - fields.add( new UAVObjectField("RV_TelemetryPort", "function", UAVObjectField.FieldType.ENUM, RV_TelemetryPortElemNames, RV_TelemetryPortEnumOptions) ); - - List RV_GPSPortElemNames = new ArrayList(); - RV_GPSPortElemNames.add("0"); - List RV_GPSPortEnumOptions = new ArrayList(); - RV_GPSPortEnumOptions.add("Disabled"); - RV_GPSPortEnumOptions.add("Telemetry"); - RV_GPSPortEnumOptions.add("GPS"); - RV_GPSPortEnumOptions.add("ComAux"); - RV_GPSPortEnumOptions.add("ComBridge"); - fields.add( new UAVObjectField("RV_GPSPort", "function", UAVObjectField.FieldType.ENUM, RV_GPSPortElemNames, RV_GPSPortEnumOptions) ); - - List TelemetrySpeedElemNames = new ArrayList(); - TelemetrySpeedElemNames.add("0"); - List TelemetrySpeedEnumOptions = new ArrayList(); - TelemetrySpeedEnumOptions.add("2400"); - TelemetrySpeedEnumOptions.add("4800"); - TelemetrySpeedEnumOptions.add("9600"); - TelemetrySpeedEnumOptions.add("19200"); - TelemetrySpeedEnumOptions.add("38400"); - TelemetrySpeedEnumOptions.add("57600"); - TelemetrySpeedEnumOptions.add("115200"); - fields.add( new UAVObjectField("TelemetrySpeed", "bps", UAVObjectField.FieldType.ENUM, TelemetrySpeedElemNames, TelemetrySpeedEnumOptions) ); - - List GPSSpeedElemNames = new ArrayList(); - GPSSpeedElemNames.add("0"); - List GPSSpeedEnumOptions = new ArrayList(); - GPSSpeedEnumOptions.add("2400"); - GPSSpeedEnumOptions.add("4800"); - GPSSpeedEnumOptions.add("9600"); - GPSSpeedEnumOptions.add("19200"); - GPSSpeedEnumOptions.add("38400"); - GPSSpeedEnumOptions.add("57600"); - GPSSpeedEnumOptions.add("115200"); - fields.add( new UAVObjectField("GPSSpeed", "bps", UAVObjectField.FieldType.ENUM, GPSSpeedElemNames, GPSSpeedEnumOptions) ); - - List ComUsbBridgeSpeedElemNames = new ArrayList(); - ComUsbBridgeSpeedElemNames.add("0"); - List ComUsbBridgeSpeedEnumOptions = new ArrayList(); - ComUsbBridgeSpeedEnumOptions.add("2400"); - ComUsbBridgeSpeedEnumOptions.add("4800"); - ComUsbBridgeSpeedEnumOptions.add("9600"); - ComUsbBridgeSpeedEnumOptions.add("19200"); - ComUsbBridgeSpeedEnumOptions.add("38400"); - ComUsbBridgeSpeedEnumOptions.add("57600"); - ComUsbBridgeSpeedEnumOptions.add("115200"); - fields.add( new UAVObjectField("ComUsbBridgeSpeed", "bps", UAVObjectField.FieldType.ENUM, ComUsbBridgeSpeedElemNames, ComUsbBridgeSpeedEnumOptions) ); - - List USB_HIDPortElemNames = new ArrayList(); - USB_HIDPortElemNames.add("0"); - List USB_HIDPortEnumOptions = new ArrayList(); - USB_HIDPortEnumOptions.add("USBTelemetry"); - USB_HIDPortEnumOptions.add("RCTransmitter"); - USB_HIDPortEnumOptions.add("Disabled"); - fields.add( new UAVObjectField("USB_HIDPort", "function", UAVObjectField.FieldType.ENUM, USB_HIDPortElemNames, USB_HIDPortEnumOptions) ); - - List USB_VCPPortElemNames = new ArrayList(); - USB_VCPPortElemNames.add("0"); - List USB_VCPPortEnumOptions = new ArrayList(); - USB_VCPPortEnumOptions.add("USBTelemetry"); - USB_VCPPortEnumOptions.add("ComBridge"); - USB_VCPPortEnumOptions.add("Disabled"); - fields.add( new UAVObjectField("USB_VCPPort", "function", UAVObjectField.FieldType.ENUM, USB_VCPPortElemNames, USB_VCPPortEnumOptions) ); - - List OptionalModulesElemNames = new ArrayList(); - OptionalModulesElemNames.add("CameraStab"); - OptionalModulesElemNames.add("GPS"); - OptionalModulesElemNames.add("ComUsbBridge"); - OptionalModulesElemNames.add("Fault"); - OptionalModulesElemNames.add("Altitude"); - OptionalModulesElemNames.add("Airspeed"); - OptionalModulesElemNames.add("TxPID"); - OptionalModulesElemNames.add("Autotune"); - OptionalModulesElemNames.add("VtolPathFollower"); - OptionalModulesElemNames.add("FixedWingPathFollower"); - OptionalModulesElemNames.add("Battery"); - OptionalModulesElemNames.add("Overo"); - OptionalModulesElemNames.add("Radio"); - List OptionalModulesEnumOptions = new ArrayList(); - OptionalModulesEnumOptions.add("Disabled"); - OptionalModulesEnumOptions.add("Enabled"); - fields.add( new UAVObjectField("OptionalModules", "", UAVObjectField.FieldType.ENUM, OptionalModulesElemNames, OptionalModulesEnumOptions) ); - - List DSMxBindElemNames = new ArrayList(); - DSMxBindElemNames.add("0"); - fields.add( new UAVObjectField("DSMxBind", "", UAVObjectField.FieldType.UINT8, DSMxBindElemNames, null) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 1 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 0; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 0; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - getField("CC_RcvrPort").setValue("PWM"); - getField("CC_MainPort").setValue("Telemetry"); - getField("CC_FlexiPort").setValue("Disabled"); - getField("RV_RcvrPort").setValue("PWM"); - getField("RV_AuxPort").setValue("Disabled"); - getField("RV_AuxSBusPort").setValue("Disabled"); - getField("RV_FlexiPort").setValue("Disabled"); - getField("RV_TelemetryPort").setValue("Disabled"); - getField("RV_GPSPort").setValue("GPS"); - getField("TelemetrySpeed").setValue("57600"); - getField("GPSSpeed").setValue("57600"); - getField("ComUsbBridgeSpeed").setValue("57600"); - getField("USB_HIDPort").setValue("USBTelemetry"); - getField("USB_VCPPort").setValue("Disabled"); - getField("OptionalModules").setValue("Disabled",0); - getField("OptionalModules").setValue("Disabled",1); - getField("OptionalModules").setValue("Disabled",2); - getField("OptionalModules").setValue("Disabled",3); - getField("OptionalModules").setValue("Disabled",4); - getField("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("OptionalModules").setValue("Disabled",11); - getField("OptionalModules").setValue("Disabled",12); - getField("DSMxBind").setValue(0); - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - HwSettings obj = new HwSettings(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public HwSettings GetInstance(UAVObjectManager objMngr, long instID) - { - return (HwSettings)(objMngr.getObject(HwSettings.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x97398142l; - protected static final String NAME = "HwSettings"; - protected static String DESCRIPTION = "Selection of optional hardware configurations."; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 1 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/I2CStats.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/I2CStats.java deleted file mode 100644 index 4bc8701ce..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/I2CStats.java +++ /dev/null @@ -1,237 +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. - * Tracks statistics on the I2C bus. - * - * @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; - -/** -Tracks statistics on the I2C bus. - -generated from i2cstats.xml - **/ -public class I2CStats extends UAVDataObject { - - public I2CStats() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List evirq_logElemNames = new ArrayList(); - evirq_logElemNames.add("0"); - evirq_logElemNames.add("1"); - evirq_logElemNames.add("2"); - evirq_logElemNames.add("3"); - evirq_logElemNames.add("4"); - fields.add( new UAVObjectField("evirq_log", "", UAVObjectField.FieldType.UINT32, evirq_logElemNames, null) ); - - List erirq_logElemNames = new ArrayList(); - erirq_logElemNames.add("0"); - erirq_logElemNames.add("1"); - erirq_logElemNames.add("2"); - erirq_logElemNames.add("3"); - erirq_logElemNames.add("4"); - fields.add( new UAVObjectField("erirq_log", "", UAVObjectField.FieldType.UINT32, erirq_logElemNames, null) ); - - List event_errorsElemNames = new ArrayList(); - event_errorsElemNames.add("0"); - fields.add( new UAVObjectField("event_errors", "", UAVObjectField.FieldType.UINT8, event_errorsElemNames, null) ); - - List fsm_errorsElemNames = new ArrayList(); - fsm_errorsElemNames.add("0"); - fields.add( new UAVObjectField("fsm_errors", "", UAVObjectField.FieldType.UINT8, fsm_errorsElemNames, null) ); - - List irq_errorsElemNames = new ArrayList(); - irq_errorsElemNames.add("0"); - fields.add( new UAVObjectField("irq_errors", "", UAVObjectField.FieldType.UINT8, irq_errorsElemNames, null) ); - - List nacksElemNames = new ArrayList(); - nacksElemNames.add("0"); - fields.add( new UAVObjectField("nacks", "", UAVObjectField.FieldType.UINT8, nacksElemNames, null) ); - - List timeoutsElemNames = new ArrayList(); - timeoutsElemNames.add("0"); - fields.add( new UAVObjectField("timeouts", "", UAVObjectField.FieldType.UINT8, timeoutsElemNames, null) ); - - List last_error_typeElemNames = new ArrayList(); - last_error_typeElemNames.add("0"); - List last_error_typeEnumOptions = new ArrayList(); - last_error_typeEnumOptions.add("EVENT"); - last_error_typeEnumOptions.add("FSM"); - last_error_typeEnumOptions.add("INTERRUPT"); - fields.add( new UAVObjectField("last_error_type", "", UAVObjectField.FieldType.ENUM, last_error_typeElemNames, last_error_typeEnumOptions) ); - - List event_logElemNames = new ArrayList(); - event_logElemNames.add("0"); - event_logElemNames.add("1"); - event_logElemNames.add("2"); - event_logElemNames.add("3"); - event_logElemNames.add("4"); - List event_logEnumOptions = new ArrayList(); - event_logEnumOptions.add("I2C_EVENT_BUS_ERROR"); - event_logEnumOptions.add("I2C_EVENT_START"); - event_logEnumOptions.add("I2C_EVENT_STARTED_MORE_TXN_READ"); - event_logEnumOptions.add("I2C_EVENT_STARTED_MORE_TXN_WRITE"); - event_logEnumOptions.add("I2C_EVENT_STARTED_LAST_TXN_READ"); - event_logEnumOptions.add("I2C_EVENT_STARTED_LAST_TXN_WRITE"); - event_logEnumOptions.add("I2C_EVENT_ADDR_SENT_LEN_EQ_0"); - event_logEnumOptions.add("I2C_EVENT_ADDR_SENT_LEN_EQ_1"); - event_logEnumOptions.add("I2C_EVENT_ADDR_SENT_LEN_EQ_2"); - event_logEnumOptions.add("I2C_EVENT_ADDR_SENT_LEN_GT_2"); - event_logEnumOptions.add("I2C_EVENT_TRANSFER_DONE_LEN_EQ_0"); - event_logEnumOptions.add("I2C_EVENT_TRANSFER_DONE_LEN_EQ_1"); - event_logEnumOptions.add("I2C_EVENT_TRANSFER_DONE_LEN_EQ_2"); - event_logEnumOptions.add("I2C_EVENT_TRANSFER_DONE_LEN_GT_2"); - event_logEnumOptions.add("I2C_EVENT_NACK"); - event_logEnumOptions.add("I2C_EVENT_STOPPED"); - event_logEnumOptions.add("I2C_EVENT_AUTO"); - fields.add( new UAVObjectField("event_log", "", UAVObjectField.FieldType.ENUM, event_logElemNames, event_logEnumOptions) ); - - List state_logElemNames = new ArrayList(); - state_logElemNames.add("0"); - state_logElemNames.add("1"); - state_logElemNames.add("2"); - state_logElemNames.add("3"); - state_logElemNames.add("4"); - List state_logEnumOptions = new ArrayList(); - state_logEnumOptions.add("I2C_STATE_FSM_FAULT"); - state_logEnumOptions.add("I2C_STATE_BUS_ERROR"); - state_logEnumOptions.add("I2C_STATE_STOPPED"); - state_logEnumOptions.add("I2C_STATE_STOPPING"); - state_logEnumOptions.add("I2C_STATE_STARTING"); - state_logEnumOptions.add("I2C_STATE_R_MORE_TXN_ADDR"); - state_logEnumOptions.add("I2C_STATE_R_MORE_TXN_PRE_ONE"); - state_logEnumOptions.add("I2C_STATE_R_MORE_TXN_PRE_FIRST"); - state_logEnumOptions.add("I2C_STATE_R_MORE_TXN_PRE_MIDDLE"); - state_logEnumOptions.add("I2C_STATE_R_MORE_TXN_LAST"); - state_logEnumOptions.add("I2C_STATE_R_MORE_TXN_POST_LAST"); - state_logEnumOptions.add("R_LAST_TXN_ADDR"); - state_logEnumOptions.add("I2C_STATE_R_LAST_TXN_PRE_ONE"); - state_logEnumOptions.add("I2C_STATE_R_LAST_TXN_PRE_FIRST"); - state_logEnumOptions.add("I2C_STATE_R_LAST_TXN_PRE_MIDDLE"); - state_logEnumOptions.add("I2C_STATE_R_LAST_TXN_PRE_LAST"); - state_logEnumOptions.add("I2C_STATE_R_LAST_TXN_POST_LAST"); - state_logEnumOptions.add("I2C_STATE_W_MORE_TXN_ADDR"); - state_logEnumOptions.add("I2C_STATE_W_MORE_TXN_MIDDLE"); - state_logEnumOptions.add("I2C_STATE_W_MORE_TXN_LAST"); - state_logEnumOptions.add("I2C_STATE_W_LAST_TXN_ADDR"); - state_logEnumOptions.add("I2C_STATE_W_LAST_TXN_MIDDLE"); - state_logEnumOptions.add("I2C_STATE_W_LAST_TXN_LAST"); - state_logEnumOptions.add("I2C_STATE_NACK"); - fields.add( new UAVObjectField("state_log", "", UAVObjectField.FieldType.ENUM, state_logElemNames, state_logEnumOptions) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.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; - } - - /** - * 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(long instID) { - // TODO: Need to get specific instance to clone - try { - I2CStats obj = new I2CStats(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public I2CStats GetInstance(UAVObjectManager objMngr, long instID) - { - return (I2CStats)(objMngr.getObject(I2CStats.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0xB714823El; - protected static final String NAME = "I2CStats"; - protected static String DESCRIPTION = "Tracks statistics on the I2C bus."; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/MagBias.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/MagBias.java deleted file mode 100644 index 19a9913d7..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/MagBias.java +++ /dev/null @@ -1,146 +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 gyro data. - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -The gyro data. - -generated from magbias.xml - **/ -public class MagBias extends UAVDataObject { - - public MagBias() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List xElemNames = new ArrayList(); - xElemNames.add("0"); - fields.add( new UAVObjectField("x", "mGau", UAVObjectField.FieldType.FLOAT32, xElemNames, null) ); - - List yElemNames = new ArrayList(); - yElemNames.add("0"); - fields.add( new UAVObjectField("y", "mGau", UAVObjectField.FieldType.FLOAT32, yElemNames, null) ); - - List zElemNames = new ArrayList(); - zElemNames.add("0"); - fields.add( new UAVObjectField("z", "mGau", UAVObjectField.FieldType.FLOAT32, zElemNames, null) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 0 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 1000; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 0; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - MagBias obj = new MagBias(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public MagBias GetInstance(UAVObjectManager objMngr, long instID) - { - return (MagBias)(objMngr.getObject(MagBias.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x5043E510l; - protected static final String NAME = "MagBias"; - protected static String DESCRIPTION = "The gyro data."; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/Magnetometer.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/Magnetometer.java deleted file mode 100644 index da81db3dd..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/Magnetometer.java +++ /dev/null @@ -1,146 +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 mag data. - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -The mag data. - -generated from magnetometer.xml - **/ -public class Magnetometer extends UAVDataObject { - - public Magnetometer() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List xElemNames = new ArrayList(); - xElemNames.add("0"); - fields.add( new UAVObjectField("x", "mGa", UAVObjectField.FieldType.FLOAT32, xElemNames, null) ); - - List yElemNames = new ArrayList(); - yElemNames.add("0"); - fields.add( new UAVObjectField("y", "mGa", UAVObjectField.FieldType.FLOAT32, yElemNames, null) ); - - List zElemNames = new ArrayList(); - zElemNames.add("0"); - fields.add( new UAVObjectField("z", "mGa", UAVObjectField.FieldType.FLOAT32, zElemNames, null) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 0 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 1000; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 0; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - Magnetometer obj = new Magnetometer(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public Magnetometer GetInstance(UAVObjectManager objMngr, long instID) - { - return (Magnetometer)(objMngr.getObject(Magnetometer.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x813B55DEl; - protected static final String NAME = "Magnetometer"; - protected static String DESCRIPTION = "The mag data."; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/ManualControlCommand.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/ManualControlCommand.java deleted file mode 100644 index 63816ed52..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/ManualControlCommand.java +++ /dev/null @@ -1,173 +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 output from the @ref ManualControlModule which descodes the receiver inputs. Overriden by GCS for fly-by-wire control. - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -The output from the @ref ManualControlModule which descodes the receiver inputs. Overriden by GCS for fly-by-wire control. - -generated from manualcontrolcommand.xml - **/ -public class ManualControlCommand extends UAVDataObject { - - public ManualControlCommand() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List ThrottleElemNames = new ArrayList(); - ThrottleElemNames.add("0"); - fields.add( new UAVObjectField("Throttle", "%", UAVObjectField.FieldType.FLOAT32, ThrottleElemNames, null) ); - - List RollElemNames = new ArrayList(); - RollElemNames.add("0"); - fields.add( new UAVObjectField("Roll", "%", UAVObjectField.FieldType.FLOAT32, RollElemNames, null) ); - - List PitchElemNames = new ArrayList(); - PitchElemNames.add("0"); - fields.add( new UAVObjectField("Pitch", "%", UAVObjectField.FieldType.FLOAT32, PitchElemNames, null) ); - - List YawElemNames = new ArrayList(); - YawElemNames.add("0"); - fields.add( new UAVObjectField("Yaw", "%", UAVObjectField.FieldType.FLOAT32, YawElemNames, null) ); - - List CollectiveElemNames = new ArrayList(); - CollectiveElemNames.add("0"); - fields.add( new UAVObjectField("Collective", "%", UAVObjectField.FieldType.FLOAT32, CollectiveElemNames, null) ); - - List ChannelElemNames = new ArrayList(); - ChannelElemNames.add("0"); - ChannelElemNames.add("1"); - ChannelElemNames.add("2"); - ChannelElemNames.add("3"); - ChannelElemNames.add("4"); - ChannelElemNames.add("5"); - ChannelElemNames.add("6"); - ChannelElemNames.add("7"); - ChannelElemNames.add("8"); - fields.add( new UAVObjectField("Channel", "us", UAVObjectField.FieldType.UINT16, ChannelElemNames, null) ); - - List ConnectedElemNames = new ArrayList(); - ConnectedElemNames.add("0"); - List ConnectedEnumOptions = new ArrayList(); - ConnectedEnumOptions.add("False"); - ConnectedEnumOptions.add("True"); - fields.add( new UAVObjectField("Connected", "", UAVObjectField.FieldType.ENUM, ConnectedElemNames, ConnectedEnumOptions) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.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; - } - - /** - * 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(long instID) { - // TODO: Need to get specific instance to clone - try { - ManualControlCommand obj = new ManualControlCommand(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public ManualControlCommand GetInstance(UAVObjectManager objMngr, long instID) - { - return (ManualControlCommand)(objMngr.getObject(ManualControlCommand.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x1E82C2D2l; - protected static final String NAME = "ManualControlCommand"; - protected static String DESCRIPTION = "The output from the @ref ManualControlModule which descodes the receiver inputs. Overriden by GCS for fly-by-wire control."; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/ManualControlSettings.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/ManualControlSettings.java deleted file mode 100644 index b89fec2a8..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/ManualControlSettings.java +++ /dev/null @@ -1,365 +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 to indicate how to decode receiver input by @ref ManualControlModule. - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -Settings to indicate how to decode receiver input by @ref ManualControlModule. - -generated from manualcontrolsettings.xml - **/ -public class ManualControlSettings extends UAVDataObject { - - public ManualControlSettings() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List DeadbandElemNames = new ArrayList(); - DeadbandElemNames.add("0"); - fields.add( new UAVObjectField("Deadband", "%", UAVObjectField.FieldType.FLOAT32, DeadbandElemNames, null) ); - - List ChannelMinElemNames = new ArrayList(); - ChannelMinElemNames.add("Throttle"); - ChannelMinElemNames.add("Roll"); - ChannelMinElemNames.add("Pitch"); - ChannelMinElemNames.add("Yaw"); - ChannelMinElemNames.add("FlightMode"); - ChannelMinElemNames.add("Collective"); - ChannelMinElemNames.add("Accessory0"); - ChannelMinElemNames.add("Accessory1"); - ChannelMinElemNames.add("Accessory2"); - fields.add( new UAVObjectField("ChannelMin", "us", UAVObjectField.FieldType.INT16, ChannelMinElemNames, null) ); - - List ChannelNeutralElemNames = new ArrayList(); - ChannelNeutralElemNames.add("Throttle"); - ChannelNeutralElemNames.add("Roll"); - ChannelNeutralElemNames.add("Pitch"); - ChannelNeutralElemNames.add("Yaw"); - ChannelNeutralElemNames.add("FlightMode"); - ChannelNeutralElemNames.add("Collective"); - ChannelNeutralElemNames.add("Accessory0"); - ChannelNeutralElemNames.add("Accessory1"); - ChannelNeutralElemNames.add("Accessory2"); - fields.add( new UAVObjectField("ChannelNeutral", "us", UAVObjectField.FieldType.INT16, ChannelNeutralElemNames, null) ); - - List ChannelMaxElemNames = new ArrayList(); - ChannelMaxElemNames.add("Throttle"); - ChannelMaxElemNames.add("Roll"); - ChannelMaxElemNames.add("Pitch"); - ChannelMaxElemNames.add("Yaw"); - ChannelMaxElemNames.add("FlightMode"); - ChannelMaxElemNames.add("Collective"); - ChannelMaxElemNames.add("Accessory0"); - ChannelMaxElemNames.add("Accessory1"); - ChannelMaxElemNames.add("Accessory2"); - fields.add( new UAVObjectField("ChannelMax", "us", UAVObjectField.FieldType.INT16, ChannelMaxElemNames, null) ); - - List ArmedTimeoutElemNames = new ArrayList(); - ArmedTimeoutElemNames.add("0"); - fields.add( new UAVObjectField("ArmedTimeout", "ms", UAVObjectField.FieldType.UINT16, ArmedTimeoutElemNames, null) ); - - List ChannelGroupsElemNames = new ArrayList(); - ChannelGroupsElemNames.add("Throttle"); - ChannelGroupsElemNames.add("Roll"); - ChannelGroupsElemNames.add("Pitch"); - ChannelGroupsElemNames.add("Yaw"); - ChannelGroupsElemNames.add("FlightMode"); - ChannelGroupsElemNames.add("Collective"); - ChannelGroupsElemNames.add("Accessory0"); - ChannelGroupsElemNames.add("Accessory1"); - ChannelGroupsElemNames.add("Accessory2"); - List ChannelGroupsEnumOptions = new ArrayList(); - ChannelGroupsEnumOptions.add("PWM"); - ChannelGroupsEnumOptions.add("PPM"); - ChannelGroupsEnumOptions.add("DSM (MainPort)"); - ChannelGroupsEnumOptions.add("DSM (FlexiPort)"); - ChannelGroupsEnumOptions.add("S.Bus"); - ChannelGroupsEnumOptions.add("GCS"); - ChannelGroupsEnumOptions.add("None"); - fields.add( new UAVObjectField("ChannelGroups", "Channel Group", UAVObjectField.FieldType.ENUM, ChannelGroupsElemNames, ChannelGroupsEnumOptions) ); - - List ChannelNumberElemNames = new ArrayList(); - ChannelNumberElemNames.add("Throttle"); - ChannelNumberElemNames.add("Roll"); - ChannelNumberElemNames.add("Pitch"); - ChannelNumberElemNames.add("Yaw"); - ChannelNumberElemNames.add("FlightMode"); - ChannelNumberElemNames.add("Collective"); - ChannelNumberElemNames.add("Accessory0"); - ChannelNumberElemNames.add("Accessory1"); - ChannelNumberElemNames.add("Accessory2"); - fields.add( new UAVObjectField("ChannelNumber", "channel", UAVObjectField.FieldType.UINT8, ChannelNumberElemNames, null) ); - - List ArmingElemNames = new ArrayList(); - ArmingElemNames.add("0"); - List ArmingEnumOptions = new ArrayList(); - ArmingEnumOptions.add("Always Disarmed"); - ArmingEnumOptions.add("Always Armed"); - ArmingEnumOptions.add("Roll Left"); - ArmingEnumOptions.add("Roll Right"); - ArmingEnumOptions.add("Pitch Forward"); - ArmingEnumOptions.add("Pitch Aft"); - ArmingEnumOptions.add("Yaw Left"); - ArmingEnumOptions.add("Yaw Right"); - fields.add( new UAVObjectField("Arming", "", UAVObjectField.FieldType.ENUM, ArmingElemNames, ArmingEnumOptions) ); - - List Stabilization1SettingsElemNames = new ArrayList(); - Stabilization1SettingsElemNames.add("Roll"); - Stabilization1SettingsElemNames.add("Pitch"); - Stabilization1SettingsElemNames.add("Yaw"); - List Stabilization1SettingsEnumOptions = new ArrayList(); - Stabilization1SettingsEnumOptions.add("None"); - Stabilization1SettingsEnumOptions.add("Rate"); - Stabilization1SettingsEnumOptions.add("Attitude"); - Stabilization1SettingsEnumOptions.add("AxisLock"); - Stabilization1SettingsEnumOptions.add("WeakLeveling"); - Stabilization1SettingsEnumOptions.add("VirtualBar"); - Stabilization1SettingsEnumOptions.add("RelayRate"); - Stabilization1SettingsEnumOptions.add("RelayAttitude"); - fields.add( new UAVObjectField("Stabilization1Settings", "", UAVObjectField.FieldType.ENUM, Stabilization1SettingsElemNames, Stabilization1SettingsEnumOptions) ); - - List Stabilization2SettingsElemNames = new ArrayList(); - Stabilization2SettingsElemNames.add("Roll"); - Stabilization2SettingsElemNames.add("Pitch"); - Stabilization2SettingsElemNames.add("Yaw"); - List Stabilization2SettingsEnumOptions = new ArrayList(); - Stabilization2SettingsEnumOptions.add("None"); - Stabilization2SettingsEnumOptions.add("Rate"); - Stabilization2SettingsEnumOptions.add("Attitude"); - Stabilization2SettingsEnumOptions.add("AxisLock"); - Stabilization2SettingsEnumOptions.add("WeakLeveling"); - Stabilization2SettingsEnumOptions.add("VirtualBar"); - Stabilization2SettingsEnumOptions.add("RelayRate"); - Stabilization2SettingsEnumOptions.add("RelayAttitude"); - fields.add( new UAVObjectField("Stabilization2Settings", "", UAVObjectField.FieldType.ENUM, Stabilization2SettingsElemNames, Stabilization2SettingsEnumOptions) ); - - List Stabilization3SettingsElemNames = new ArrayList(); - Stabilization3SettingsElemNames.add("Roll"); - Stabilization3SettingsElemNames.add("Pitch"); - Stabilization3SettingsElemNames.add("Yaw"); - List Stabilization3SettingsEnumOptions = new ArrayList(); - Stabilization3SettingsEnumOptions.add("None"); - Stabilization3SettingsEnumOptions.add("Rate"); - Stabilization3SettingsEnumOptions.add("Attitude"); - Stabilization3SettingsEnumOptions.add("AxisLock"); - Stabilization3SettingsEnumOptions.add("WeakLeveling"); - Stabilization3SettingsEnumOptions.add("VirtualBar"); - Stabilization3SettingsEnumOptions.add("RelayRate"); - Stabilization3SettingsEnumOptions.add("RelayAttitude"); - fields.add( new UAVObjectField("Stabilization3Settings", "", UAVObjectField.FieldType.ENUM, Stabilization3SettingsElemNames, Stabilization3SettingsEnumOptions) ); - - List FlightModeNumberElemNames = new ArrayList(); - FlightModeNumberElemNames.add("0"); - fields.add( new UAVObjectField("FlightModeNumber", "", UAVObjectField.FieldType.UINT8, FlightModeNumberElemNames, null) ); - - List FlightModePositionElemNames = new ArrayList(); - FlightModePositionElemNames.add("0"); - FlightModePositionElemNames.add("1"); - FlightModePositionElemNames.add("2"); - FlightModePositionElemNames.add("3"); - FlightModePositionElemNames.add("4"); - FlightModePositionElemNames.add("5"); - List FlightModePositionEnumOptions = new ArrayList(); - FlightModePositionEnumOptions.add("Manual"); - FlightModePositionEnumOptions.add("Stabilized1"); - FlightModePositionEnumOptions.add("Stabilized2"); - FlightModePositionEnumOptions.add("Stabilized3"); - FlightModePositionEnumOptions.add("Autotune"); - FlightModePositionEnumOptions.add("AltitudeHold"); - 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 FailsafeBehaviorElemNames = new ArrayList(); - FailsafeBehaviorElemNames.add("0"); - List FailsafeBehaviorEnumOptions = new ArrayList(); - 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; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 1 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 0; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 0; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - getField("Deadband").setValue(0); - getField("ChannelMin").setValue(1000,0); - getField("ChannelMin").setValue(1000,1); - getField("ChannelMin").setValue(1000,2); - getField("ChannelMin").setValue(1000,3); - getField("ChannelMin").setValue(1000,4); - getField("ChannelMin").setValue(1000,5); - getField("ChannelMin").setValue(1000,6); - getField("ChannelMin").setValue(1000,7); - getField("ChannelMin").setValue(1000,8); - getField("ChannelNeutral").setValue(1500,0); - getField("ChannelNeutral").setValue(1500,1); - getField("ChannelNeutral").setValue(1500,2); - getField("ChannelNeutral").setValue(1500,3); - getField("ChannelNeutral").setValue(1500,4); - getField("ChannelNeutral").setValue(1500,5); - getField("ChannelNeutral").setValue(1500,6); - getField("ChannelNeutral").setValue(1500,7); - getField("ChannelNeutral").setValue(1500,8); - getField("ChannelMax").setValue(2000,0); - getField("ChannelMax").setValue(2000,1); - getField("ChannelMax").setValue(2000,2); - getField("ChannelMax").setValue(2000,3); - getField("ChannelMax").setValue(2000,4); - getField("ChannelMax").setValue(2000,5); - getField("ChannelMax").setValue(2000,6); - getField("ChannelMax").setValue(2000,7); - getField("ChannelMax").setValue(2000,8); - getField("ArmedTimeout").setValue(30000); - getField("ChannelGroups").setValue("None",0); - getField("ChannelGroups").setValue("None",1); - getField("ChannelGroups").setValue("None",2); - getField("ChannelGroups").setValue("None",3); - getField("ChannelGroups").setValue("None",4); - getField("ChannelGroups").setValue("None",5); - getField("ChannelGroups").setValue("None",6); - getField("ChannelGroups").setValue("None",7); - getField("ChannelGroups").setValue("None",8); - getField("ChannelNumber").setValue(0,0); - getField("ChannelNumber").setValue(0,1); - getField("ChannelNumber").setValue(0,2); - getField("ChannelNumber").setValue(0,3); - getField("ChannelNumber").setValue(0,4); - getField("ChannelNumber").setValue(0,5); - getField("ChannelNumber").setValue(0,6); - getField("ChannelNumber").setValue(0,7); - getField("ChannelNumber").setValue(0,8); - getField("Arming").setValue("Always Disarmed"); - getField("Stabilization1Settings").setValue("Attitude",0); - getField("Stabilization1Settings").setValue("Attitude",1); - getField("Stabilization1Settings").setValue("Rate",2); - getField("Stabilization2Settings").setValue("Attitude",0); - getField("Stabilization2Settings").setValue("Attitude",1); - getField("Stabilization2Settings").setValue("Rate",2); - getField("Stabilization3Settings").setValue("Attitude",0); - getField("Stabilization3Settings").setValue("Attitude",1); - getField("Stabilization3Settings").setValue("Rate",2); - getField("FlightModeNumber").setValue(3); - getField("FlightModePosition").setValue("Manual",0); - getField("FlightModePosition").setValue("Stabilized1",1); - getField("FlightModePosition").setValue("Stabilized2",2); - getField("FlightModePosition").setValue("Stabilized3",3); - getField("FlightModePosition").setValue("Stabilized1",4); - getField("FlightModePosition").setValue("Stabilized2",5); - getField("FailsafeBehavior").setValue("None"); - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - ManualControlSettings obj = new ManualControlSettings(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public ManualControlSettings GetInstance(UAVObjectManager objMngr, long instID) - { - return (ManualControlSettings)(objMngr.getObject(ManualControlSettings.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x4BD7CF5Al; - 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 > 0; - protected static final boolean ISSETTINGS = 1 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/MixerSettings.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/MixerSettings.java deleted file mode 100644 index f51a083b0..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/MixerSettings.java +++ /dev/null @@ -1,507 +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 ActuatorModule that controls the channel assignments for the mixer based on AircraftType - * - * @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 ActuatorModule that controls the channel assignments for the mixer based on AircraftType - -generated from mixersettings.xml - **/ -public class MixerSettings extends UAVDataObject { - - public MixerSettings() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List MaxAccelElemNames = new ArrayList(); - MaxAccelElemNames.add("0"); - fields.add( new UAVObjectField("MaxAccel", "units/sec", UAVObjectField.FieldType.FLOAT32, MaxAccelElemNames, null) ); - - List FeedForwardElemNames = new ArrayList(); - FeedForwardElemNames.add("0"); - fields.add( new UAVObjectField("FeedForward", "", UAVObjectField.FieldType.FLOAT32, FeedForwardElemNames, null) ); - - List AccelTimeElemNames = new ArrayList(); - AccelTimeElemNames.add("0"); - fields.add( new UAVObjectField("AccelTime", "ms", UAVObjectField.FieldType.FLOAT32, AccelTimeElemNames, null) ); - - List DecelTimeElemNames = new ArrayList(); - DecelTimeElemNames.add("0"); - fields.add( new UAVObjectField("DecelTime", "ms", UAVObjectField.FieldType.FLOAT32, DecelTimeElemNames, null) ); - - List ThrottleCurve1ElemNames = new ArrayList(); - ThrottleCurve1ElemNames.add("0"); - ThrottleCurve1ElemNames.add("25"); - ThrottleCurve1ElemNames.add("50"); - ThrottleCurve1ElemNames.add("75"); - ThrottleCurve1ElemNames.add("100"); - fields.add( new UAVObjectField("ThrottleCurve1", "percent", UAVObjectField.FieldType.FLOAT32, ThrottleCurve1ElemNames, null) ); - - List ThrottleCurve2ElemNames = new ArrayList(); - ThrottleCurve2ElemNames.add("0"); - ThrottleCurve2ElemNames.add("25"); - ThrottleCurve2ElemNames.add("50"); - ThrottleCurve2ElemNames.add("75"); - ThrottleCurve2ElemNames.add("100"); - fields.add( new UAVObjectField("ThrottleCurve2", "percent", UAVObjectField.FieldType.FLOAT32, ThrottleCurve2ElemNames, null) ); - - List Curve2SourceElemNames = new ArrayList(); - Curve2SourceElemNames.add("0"); - List Curve2SourceEnumOptions = new ArrayList(); - Curve2SourceEnumOptions.add("Throttle"); - Curve2SourceEnumOptions.add("Roll"); - Curve2SourceEnumOptions.add("Pitch"); - Curve2SourceEnumOptions.add("Yaw"); - Curve2SourceEnumOptions.add("Collective"); - Curve2SourceEnumOptions.add("Accessory0"); - Curve2SourceEnumOptions.add("Accessory1"); - Curve2SourceEnumOptions.add("Accessory2"); - Curve2SourceEnumOptions.add("Accessory3"); - Curve2SourceEnumOptions.add("Accessory4"); - Curve2SourceEnumOptions.add("Accessory5"); - fields.add( new UAVObjectField("Curve2Source", "", UAVObjectField.FieldType.ENUM, Curve2SourceElemNames, Curve2SourceEnumOptions) ); - - List Mixer1TypeElemNames = new ArrayList(); - Mixer1TypeElemNames.add("0"); - List Mixer1TypeEnumOptions = new ArrayList(); - Mixer1TypeEnumOptions.add("Disabled"); - Mixer1TypeEnumOptions.add("Motor"); - Mixer1TypeEnumOptions.add("Servo"); - Mixer1TypeEnumOptions.add("CameraRoll"); - Mixer1TypeEnumOptions.add("CameraPitch"); - Mixer1TypeEnumOptions.add("CameraYaw"); - Mixer1TypeEnumOptions.add("Accessory0"); - Mixer1TypeEnumOptions.add("Accessory1"); - Mixer1TypeEnumOptions.add("Accessory2"); - Mixer1TypeEnumOptions.add("Accessory3"); - Mixer1TypeEnumOptions.add("Accessory4"); - Mixer1TypeEnumOptions.add("Accessory5"); - fields.add( new UAVObjectField("Mixer1Type", "", UAVObjectField.FieldType.ENUM, Mixer1TypeElemNames, Mixer1TypeEnumOptions) ); - - List Mixer1VectorElemNames = new ArrayList(); - Mixer1VectorElemNames.add("ThrottleCurve1"); - Mixer1VectorElemNames.add("ThrottleCurve2"); - Mixer1VectorElemNames.add("Roll"); - Mixer1VectorElemNames.add("Pitch"); - Mixer1VectorElemNames.add("Yaw"); - fields.add( new UAVObjectField("Mixer1Vector", "", UAVObjectField.FieldType.INT8, Mixer1VectorElemNames, null) ); - - List Mixer2TypeElemNames = new ArrayList(); - Mixer2TypeElemNames.add("0"); - List Mixer2TypeEnumOptions = new ArrayList(); - Mixer2TypeEnumOptions.add("Disabled"); - Mixer2TypeEnumOptions.add("Motor"); - Mixer2TypeEnumOptions.add("Servo"); - Mixer2TypeEnumOptions.add("CameraRoll"); - Mixer2TypeEnumOptions.add("CameraPitch"); - Mixer2TypeEnumOptions.add("CameraYaw"); - Mixer2TypeEnumOptions.add("Accessory0"); - Mixer2TypeEnumOptions.add("Accessory1"); - Mixer2TypeEnumOptions.add("Accessory2"); - Mixer2TypeEnumOptions.add("Accessory3"); - Mixer2TypeEnumOptions.add("Accessory4"); - Mixer2TypeEnumOptions.add("Accessory5"); - fields.add( new UAVObjectField("Mixer2Type", "", UAVObjectField.FieldType.ENUM, Mixer2TypeElemNames, Mixer2TypeEnumOptions) ); - - List Mixer2VectorElemNames = new ArrayList(); - Mixer2VectorElemNames.add("ThrottleCurve1"); - Mixer2VectorElemNames.add("ThrottleCurve2"); - Mixer2VectorElemNames.add("Roll"); - Mixer2VectorElemNames.add("Pitch"); - Mixer2VectorElemNames.add("Yaw"); - fields.add( new UAVObjectField("Mixer2Vector", "", UAVObjectField.FieldType.INT8, Mixer2VectorElemNames, null) ); - - List Mixer3TypeElemNames = new ArrayList(); - Mixer3TypeElemNames.add("0"); - List Mixer3TypeEnumOptions = new ArrayList(); - Mixer3TypeEnumOptions.add("Disabled"); - Mixer3TypeEnumOptions.add("Motor"); - Mixer3TypeEnumOptions.add("Servo"); - Mixer3TypeEnumOptions.add("CameraRoll"); - Mixer3TypeEnumOptions.add("CameraPitch"); - Mixer3TypeEnumOptions.add("CameraYaw"); - Mixer3TypeEnumOptions.add("Accessory0"); - Mixer3TypeEnumOptions.add("Accessory1"); - Mixer3TypeEnumOptions.add("Accessory2"); - Mixer3TypeEnumOptions.add("Accessory3"); - Mixer3TypeEnumOptions.add("Accessory4"); - Mixer3TypeEnumOptions.add("Accessory5"); - fields.add( new UAVObjectField("Mixer3Type", "", UAVObjectField.FieldType.ENUM, Mixer3TypeElemNames, Mixer3TypeEnumOptions) ); - - List Mixer3VectorElemNames = new ArrayList(); - Mixer3VectorElemNames.add("ThrottleCurve1"); - Mixer3VectorElemNames.add("ThrottleCurve2"); - Mixer3VectorElemNames.add("Roll"); - Mixer3VectorElemNames.add("Pitch"); - Mixer3VectorElemNames.add("Yaw"); - fields.add( new UAVObjectField("Mixer3Vector", "", UAVObjectField.FieldType.INT8, Mixer3VectorElemNames, null) ); - - List Mixer4TypeElemNames = new ArrayList(); - Mixer4TypeElemNames.add("0"); - List Mixer4TypeEnumOptions = new ArrayList(); - Mixer4TypeEnumOptions.add("Disabled"); - Mixer4TypeEnumOptions.add("Motor"); - Mixer4TypeEnumOptions.add("Servo"); - Mixer4TypeEnumOptions.add("CameraRoll"); - Mixer4TypeEnumOptions.add("CameraPitch"); - Mixer4TypeEnumOptions.add("CameraYaw"); - Mixer4TypeEnumOptions.add("Accessory0"); - Mixer4TypeEnumOptions.add("Accessory1"); - Mixer4TypeEnumOptions.add("Accessory2"); - Mixer4TypeEnumOptions.add("Accessory3"); - Mixer4TypeEnumOptions.add("Accessory4"); - Mixer4TypeEnumOptions.add("Accessory5"); - fields.add( new UAVObjectField("Mixer4Type", "", UAVObjectField.FieldType.ENUM, Mixer4TypeElemNames, Mixer4TypeEnumOptions) ); - - List Mixer4VectorElemNames = new ArrayList(); - Mixer4VectorElemNames.add("ThrottleCurve1"); - Mixer4VectorElemNames.add("ThrottleCurve2"); - Mixer4VectorElemNames.add("Roll"); - Mixer4VectorElemNames.add("Pitch"); - Mixer4VectorElemNames.add("Yaw"); - fields.add( new UAVObjectField("Mixer4Vector", "", UAVObjectField.FieldType.INT8, Mixer4VectorElemNames, null) ); - - List Mixer5TypeElemNames = new ArrayList(); - Mixer5TypeElemNames.add("0"); - List Mixer5TypeEnumOptions = new ArrayList(); - Mixer5TypeEnumOptions.add("Disabled"); - Mixer5TypeEnumOptions.add("Motor"); - Mixer5TypeEnumOptions.add("Servo"); - Mixer5TypeEnumOptions.add("CameraRoll"); - Mixer5TypeEnumOptions.add("CameraPitch"); - Mixer5TypeEnumOptions.add("CameraYaw"); - Mixer5TypeEnumOptions.add("Accessory0"); - Mixer5TypeEnumOptions.add("Accessory1"); - Mixer5TypeEnumOptions.add("Accessory2"); - Mixer5TypeEnumOptions.add("Accessory3"); - Mixer5TypeEnumOptions.add("Accessory4"); - Mixer5TypeEnumOptions.add("Accessory5"); - fields.add( new UAVObjectField("Mixer5Type", "", UAVObjectField.FieldType.ENUM, Mixer5TypeElemNames, Mixer5TypeEnumOptions) ); - - List Mixer5VectorElemNames = new ArrayList(); - Mixer5VectorElemNames.add("ThrottleCurve1"); - Mixer5VectorElemNames.add("ThrottleCurve2"); - Mixer5VectorElemNames.add("Roll"); - Mixer5VectorElemNames.add("Pitch"); - Mixer5VectorElemNames.add("Yaw"); - fields.add( new UAVObjectField("Mixer5Vector", "", UAVObjectField.FieldType.INT8, Mixer5VectorElemNames, null) ); - - List Mixer6TypeElemNames = new ArrayList(); - Mixer6TypeElemNames.add("0"); - List Mixer6TypeEnumOptions = new ArrayList(); - Mixer6TypeEnumOptions.add("Disabled"); - Mixer6TypeEnumOptions.add("Motor"); - Mixer6TypeEnumOptions.add("Servo"); - Mixer6TypeEnumOptions.add("CameraRoll"); - Mixer6TypeEnumOptions.add("CameraPitch"); - Mixer6TypeEnumOptions.add("CameraYaw"); - Mixer6TypeEnumOptions.add("Accessory0"); - Mixer6TypeEnumOptions.add("Accessory1"); - Mixer6TypeEnumOptions.add("Accessory2"); - Mixer6TypeEnumOptions.add("Accessory3"); - Mixer6TypeEnumOptions.add("Accessory4"); - Mixer6TypeEnumOptions.add("Accessory5"); - fields.add( new UAVObjectField("Mixer6Type", "", UAVObjectField.FieldType.ENUM, Mixer6TypeElemNames, Mixer6TypeEnumOptions) ); - - List Mixer6VectorElemNames = new ArrayList(); - Mixer6VectorElemNames.add("ThrottleCurve1"); - Mixer6VectorElemNames.add("ThrottleCurve2"); - Mixer6VectorElemNames.add("Roll"); - Mixer6VectorElemNames.add("Pitch"); - Mixer6VectorElemNames.add("Yaw"); - fields.add( new UAVObjectField("Mixer6Vector", "", UAVObjectField.FieldType.INT8, Mixer6VectorElemNames, null) ); - - List Mixer7TypeElemNames = new ArrayList(); - Mixer7TypeElemNames.add("0"); - List Mixer7TypeEnumOptions = new ArrayList(); - Mixer7TypeEnumOptions.add("Disabled"); - Mixer7TypeEnumOptions.add("Motor"); - Mixer7TypeEnumOptions.add("Servo"); - Mixer7TypeEnumOptions.add("CameraRoll"); - Mixer7TypeEnumOptions.add("CameraPitch"); - Mixer7TypeEnumOptions.add("CameraYaw"); - Mixer7TypeEnumOptions.add("Accessory0"); - Mixer7TypeEnumOptions.add("Accessory1"); - Mixer7TypeEnumOptions.add("Accessory2"); - Mixer7TypeEnumOptions.add("Accessory3"); - Mixer7TypeEnumOptions.add("Accessory4"); - Mixer7TypeEnumOptions.add("Accessory5"); - fields.add( new UAVObjectField("Mixer7Type", "", UAVObjectField.FieldType.ENUM, Mixer7TypeElemNames, Mixer7TypeEnumOptions) ); - - List Mixer7VectorElemNames = new ArrayList(); - Mixer7VectorElemNames.add("ThrottleCurve1"); - Mixer7VectorElemNames.add("ThrottleCurve2"); - Mixer7VectorElemNames.add("Roll"); - Mixer7VectorElemNames.add("Pitch"); - Mixer7VectorElemNames.add("Yaw"); - fields.add( new UAVObjectField("Mixer7Vector", "", UAVObjectField.FieldType.INT8, Mixer7VectorElemNames, null) ); - - List Mixer8TypeElemNames = new ArrayList(); - Mixer8TypeElemNames.add("0"); - List Mixer8TypeEnumOptions = new ArrayList(); - Mixer8TypeEnumOptions.add("Disabled"); - Mixer8TypeEnumOptions.add("Motor"); - Mixer8TypeEnumOptions.add("Servo"); - Mixer8TypeEnumOptions.add("CameraRoll"); - Mixer8TypeEnumOptions.add("CameraPitch"); - Mixer8TypeEnumOptions.add("CameraYaw"); - Mixer8TypeEnumOptions.add("Accessory0"); - Mixer8TypeEnumOptions.add("Accessory1"); - Mixer8TypeEnumOptions.add("Accessory2"); - Mixer8TypeEnumOptions.add("Accessory3"); - Mixer8TypeEnumOptions.add("Accessory4"); - Mixer8TypeEnumOptions.add("Accessory5"); - fields.add( new UAVObjectField("Mixer8Type", "", UAVObjectField.FieldType.ENUM, Mixer8TypeElemNames, Mixer8TypeEnumOptions) ); - - List Mixer8VectorElemNames = new ArrayList(); - Mixer8VectorElemNames.add("ThrottleCurve1"); - Mixer8VectorElemNames.add("ThrottleCurve2"); - Mixer8VectorElemNames.add("Roll"); - Mixer8VectorElemNames.add("Pitch"); - Mixer8VectorElemNames.add("Yaw"); - fields.add( new UAVObjectField("Mixer8Vector", "", UAVObjectField.FieldType.INT8, Mixer8VectorElemNames, null) ); - - List Mixer9TypeElemNames = new ArrayList(); - Mixer9TypeElemNames.add("0"); - List Mixer9TypeEnumOptions = new ArrayList(); - Mixer9TypeEnumOptions.add("Disabled"); - Mixer9TypeEnumOptions.add("Motor"); - Mixer9TypeEnumOptions.add("Servo"); - Mixer9TypeEnumOptions.add("CameraRoll"); - Mixer9TypeEnumOptions.add("CameraPitch"); - Mixer9TypeEnumOptions.add("CameraYaw"); - Mixer9TypeEnumOptions.add("Accessory0"); - Mixer9TypeEnumOptions.add("Accessory1"); - Mixer9TypeEnumOptions.add("Accessory2"); - Mixer9TypeEnumOptions.add("Accessory3"); - Mixer9TypeEnumOptions.add("Accessory4"); - Mixer9TypeEnumOptions.add("Accessory5"); - fields.add( new UAVObjectField("Mixer9Type", "", UAVObjectField.FieldType.ENUM, Mixer9TypeElemNames, Mixer9TypeEnumOptions) ); - - List Mixer9VectorElemNames = new ArrayList(); - Mixer9VectorElemNames.add("ThrottleCurve1"); - Mixer9VectorElemNames.add("ThrottleCurve2"); - Mixer9VectorElemNames.add("Roll"); - Mixer9VectorElemNames.add("Pitch"); - Mixer9VectorElemNames.add("Yaw"); - fields.add( new UAVObjectField("Mixer9Vector", "", UAVObjectField.FieldType.INT8, Mixer9VectorElemNames, null) ); - - List Mixer10TypeElemNames = new ArrayList(); - Mixer10TypeElemNames.add("0"); - List Mixer10TypeEnumOptions = new ArrayList(); - Mixer10TypeEnumOptions.add("Disabled"); - Mixer10TypeEnumOptions.add("Motor"); - Mixer10TypeEnumOptions.add("Servo"); - Mixer10TypeEnumOptions.add("CameraRoll"); - Mixer10TypeEnumOptions.add("CameraPitch"); - Mixer10TypeEnumOptions.add("CameraYaw"); - Mixer10TypeEnumOptions.add("Accessory0"); - Mixer10TypeEnumOptions.add("Accessory1"); - Mixer10TypeEnumOptions.add("Accessory2"); - Mixer10TypeEnumOptions.add("Accessory3"); - Mixer10TypeEnumOptions.add("Accessory4"); - Mixer10TypeEnumOptions.add("Accessory5"); - fields.add( new UAVObjectField("Mixer10Type", "", UAVObjectField.FieldType.ENUM, Mixer10TypeElemNames, Mixer10TypeEnumOptions) ); - - List Mixer10VectorElemNames = new ArrayList(); - Mixer10VectorElemNames.add("ThrottleCurve1"); - Mixer10VectorElemNames.add("ThrottleCurve2"); - Mixer10VectorElemNames.add("Roll"); - Mixer10VectorElemNames.add("Pitch"); - Mixer10VectorElemNames.add("Yaw"); - fields.add( new UAVObjectField("Mixer10Vector", "", UAVObjectField.FieldType.INT8, Mixer10VectorElemNames, null) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 1 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 0; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 0; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - getField("MaxAccel").setValue(1000); - getField("FeedForward").setValue(0); - getField("AccelTime").setValue(0); - getField("DecelTime").setValue(0); - getField("ThrottleCurve1").setValue(0,0); - getField("ThrottleCurve1").setValue(0,1); - getField("ThrottleCurve1").setValue(0,2); - getField("ThrottleCurve1").setValue(0,3); - getField("ThrottleCurve1").setValue(0,4); - getField("ThrottleCurve2").setValue(0,0); - getField("ThrottleCurve2").setValue(0.25,1); - getField("ThrottleCurve2").setValue(0.5,2); - getField("ThrottleCurve2").setValue(0.75,3); - getField("ThrottleCurve2").setValue(1,4); - getField("Curve2Source").setValue("Throttle"); - getField("Mixer1Type").setValue("Disabled"); - getField("Mixer1Vector").setValue(0,0); - getField("Mixer1Vector").setValue(0,1); - getField("Mixer1Vector").setValue(0,2); - getField("Mixer1Vector").setValue(0,3); - getField("Mixer1Vector").setValue(0,4); - getField("Mixer2Type").setValue("Disabled"); - getField("Mixer2Vector").setValue(0,0); - getField("Mixer2Vector").setValue(0,1); - getField("Mixer2Vector").setValue(0,2); - getField("Mixer2Vector").setValue(0,3); - getField("Mixer2Vector").setValue(0,4); - getField("Mixer3Type").setValue("Disabled"); - getField("Mixer3Vector").setValue(0,0); - getField("Mixer3Vector").setValue(0,1); - getField("Mixer3Vector").setValue(0,2); - getField("Mixer3Vector").setValue(0,3); - getField("Mixer3Vector").setValue(0,4); - getField("Mixer4Type").setValue("Disabled"); - getField("Mixer4Vector").setValue(0,0); - getField("Mixer4Vector").setValue(0,1); - getField("Mixer4Vector").setValue(0,2); - getField("Mixer4Vector").setValue(0,3); - getField("Mixer4Vector").setValue(0,4); - getField("Mixer5Type").setValue("Disabled"); - getField("Mixer5Vector").setValue(0,0); - getField("Mixer5Vector").setValue(0,1); - getField("Mixer5Vector").setValue(0,2); - getField("Mixer5Vector").setValue(0,3); - getField("Mixer5Vector").setValue(0,4); - getField("Mixer6Type").setValue("Disabled"); - getField("Mixer6Vector").setValue(0,0); - getField("Mixer6Vector").setValue(0,1); - getField("Mixer6Vector").setValue(0,2); - getField("Mixer6Vector").setValue(0,3); - getField("Mixer6Vector").setValue(0,4); - getField("Mixer7Type").setValue("Disabled"); - getField("Mixer7Vector").setValue(0,0); - getField("Mixer7Vector").setValue(0,1); - getField("Mixer7Vector").setValue(0,2); - getField("Mixer7Vector").setValue(0,3); - getField("Mixer7Vector").setValue(0,4); - getField("Mixer8Type").setValue("Disabled"); - getField("Mixer8Vector").setValue(0,0); - getField("Mixer8Vector").setValue(0,1); - getField("Mixer8Vector").setValue(0,2); - getField("Mixer8Vector").setValue(0,3); - getField("Mixer8Vector").setValue(0,4); - getField("Mixer9Type").setValue("Disabled"); - getField("Mixer9Vector").setValue(0,0); - getField("Mixer9Vector").setValue(0,1); - getField("Mixer9Vector").setValue(0,2); - getField("Mixer9Vector").setValue(0,3); - getField("Mixer9Vector").setValue(0,4); - getField("Mixer10Type").setValue("Disabled"); - getField("Mixer10Vector").setValue(0,0); - getField("Mixer10Vector").setValue(0,1); - getField("Mixer10Vector").setValue(0,2); - getField("Mixer10Vector").setValue(0,3); - getField("Mixer10Vector").setValue(0,4); - - } - - /** - * 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(long instID) { - // TODO: Need to get specific instance to clone - try { - MixerSettings obj = new MixerSettings(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public MixerSettings GetInstance(UAVObjectManager objMngr, long instID) - { - return (MixerSettings)(objMngr.getObject(MixerSettings.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x5D16D6C4l; - protected static final String NAME = "MixerSettings"; - protected static String DESCRIPTION = "Settings for the @ref ActuatorModule that controls the channel assignments for the mixer based on AircraftType"; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 1 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/MixerStatus.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/MixerStatus.java deleted file mode 100644 index 8b7766a94..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/MixerStatus.java +++ /dev/null @@ -1,174 +0,0 @@ -/** - ****************************************************************************** - * - * @file uavobjecttemplate.cpp - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * @brief Template for an uavobject in java - * This is a autogenerated file!! Do not modify and expect a result. - * Status for the matrix mixer showing the output of each mixer after all scaling - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -Status for the matrix mixer showing the output of each mixer after all scaling - -generated from mixerstatus.xml - **/ -public class MixerStatus extends UAVDataObject { - - public MixerStatus() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List Mixer1ElemNames = new ArrayList(); - Mixer1ElemNames.add("0"); - fields.add( new UAVObjectField("Mixer1", "", UAVObjectField.FieldType.FLOAT32, Mixer1ElemNames, null) ); - - List Mixer2ElemNames = new ArrayList(); - Mixer2ElemNames.add("0"); - fields.add( new UAVObjectField("Mixer2", "", UAVObjectField.FieldType.FLOAT32, Mixer2ElemNames, null) ); - - List Mixer3ElemNames = new ArrayList(); - Mixer3ElemNames.add("0"); - fields.add( new UAVObjectField("Mixer3", "", UAVObjectField.FieldType.FLOAT32, Mixer3ElemNames, null) ); - - List Mixer4ElemNames = new ArrayList(); - Mixer4ElemNames.add("0"); - fields.add( new UAVObjectField("Mixer4", "", UAVObjectField.FieldType.FLOAT32, Mixer4ElemNames, null) ); - - List Mixer5ElemNames = new ArrayList(); - Mixer5ElemNames.add("0"); - fields.add( new UAVObjectField("Mixer5", "", UAVObjectField.FieldType.FLOAT32, Mixer5ElemNames, null) ); - - List Mixer6ElemNames = new ArrayList(); - Mixer6ElemNames.add("0"); - fields.add( new UAVObjectField("Mixer6", "", UAVObjectField.FieldType.FLOAT32, Mixer6ElemNames, null) ); - - List Mixer7ElemNames = new ArrayList(); - Mixer7ElemNames.add("0"); - fields.add( new UAVObjectField("Mixer7", "", UAVObjectField.FieldType.FLOAT32, Mixer7ElemNames, null) ); - - List Mixer8ElemNames = new ArrayList(); - Mixer8ElemNames.add("0"); - fields.add( new UAVObjectField("Mixer8", "", UAVObjectField.FieldType.FLOAT32, Mixer8ElemNames, null) ); - - List Mixer9ElemNames = new ArrayList(); - Mixer9ElemNames.add("0"); - fields.add( new UAVObjectField("Mixer9", "", UAVObjectField.FieldType.FLOAT32, Mixer9ElemNames, null) ); - - List Mixer10ElemNames = new ArrayList(); - Mixer10ElemNames.add("0"); - fields.add( new UAVObjectField("Mixer10", "", UAVObjectField.FieldType.FLOAT32, Mixer10ElemNames, null) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 0 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 1000; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 1000; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - MixerStatus obj = new MixerStatus(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public MixerStatus GetInstance(UAVObjectManager objMngr, long instID) - { - return (MixerStatus)(objMngr.getObject(MixerStatus.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x124E28Al; - protected static final String NAME = "MixerStatus"; - protected static String DESCRIPTION = "Status for the matrix mixer showing the output of each mixer after all scaling"; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/NEDPosition.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/NEDPosition.java deleted file mode 100644 index 01bc062ff..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/NEDPosition.java +++ /dev/null @@ -1,146 +0,0 @@ -/** - ****************************************************************************** - * - * @file uavobjecttemplate.cpp - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * @brief Template for an uavobject in java - * This is a autogenerated file!! Do not modify and expect a result. - * Contains the current position relative to @ref HomeLocation - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -Contains the current position relative to @ref HomeLocation - -generated from nedposition.xml - **/ -public class NEDPosition extends UAVDataObject { - - public NEDPosition() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List NorthElemNames = new ArrayList(); - NorthElemNames.add("0"); - fields.add( new UAVObjectField("North", "m", UAVObjectField.FieldType.FLOAT32, NorthElemNames, null) ); - - List EastElemNames = new ArrayList(); - EastElemNames.add("0"); - fields.add( new UAVObjectField("East", "m", UAVObjectField.FieldType.FLOAT32, EastElemNames, null) ); - - List DownElemNames = new ArrayList(); - 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 li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 0 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 1000; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 1000; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - NEDPosition obj = new NEDPosition(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public NEDPosition GetInstance(UAVObjectManager objMngr, long instID) - { - return (NEDPosition)(objMngr.getObject(NEDPosition.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x1FB15A00l; - protected static final String NAME = "NEDPosition"; - protected static String DESCRIPTION = "Contains the current position relative to @ref HomeLocation"; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/NedAccel.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/NedAccel.java deleted file mode 100644 index 9520e65eb..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/NedAccel.java +++ /dev/null @@ -1,146 +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 projection of acceleration in the NED reference frame used by @ref Guidance. - * - * @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 projection of acceleration in the NED reference frame used by @ref Guidance. - -generated from nedaccel.xml - **/ -public class NedAccel extends UAVDataObject { - - public NedAccel() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List NorthElemNames = new ArrayList(); - NorthElemNames.add("0"); - fields.add( new UAVObjectField("North", "m/s^2", UAVObjectField.FieldType.FLOAT32, NorthElemNames, null) ); - - List EastElemNames = new ArrayList(); - EastElemNames.add("0"); - fields.add( new UAVObjectField("East", "m/s^2", UAVObjectField.FieldType.FLOAT32, EastElemNames, null) ); - - List DownElemNames = new ArrayList(); - DownElemNames.add("0"); - fields.add( new UAVObjectField("Down", "m/s^2", UAVObjectField.FieldType.FLOAT32, DownElemNames, null) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.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; - } - - /** - * 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(long instID) { - // TODO: Need to get specific instance to clone - try { - NedAccel obj = new NedAccel(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public NedAccel GetInstance(UAVObjectManager objMngr, long instID) - { - return (NedAccel)(objMngr.getObject(NedAccel.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x7C7F5BC0l; - protected static final String NAME = "NedAccel"; - protected static String DESCRIPTION = "The projection of acceleration in the NED reference frame used by @ref Guidance."; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/ObjectPersistence.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/ObjectPersistence.java deleted file mode 100644 index d856a3396..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/ObjectPersistence.java +++ /dev/null @@ -1,163 +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. - * Someone who knows please enter this - * - * @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; - -/** -Someone who knows please enter this - -generated from objectpersistence.xml - **/ -public class ObjectPersistence extends UAVDataObject { - - public ObjectPersistence() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List ObjectIDElemNames = new ArrayList(); - ObjectIDElemNames.add("0"); - fields.add( new UAVObjectField("ObjectID", "", UAVObjectField.FieldType.UINT32, ObjectIDElemNames, null) ); - - List InstanceIDElemNames = new ArrayList(); - InstanceIDElemNames.add("0"); - fields.add( new UAVObjectField("InstanceID", "", UAVObjectField.FieldType.UINT32, InstanceIDElemNames, null) ); - - List OperationElemNames = new ArrayList(); - OperationElemNames.add("0"); - List OperationEnumOptions = new ArrayList(); - OperationEnumOptions.add("NOP"); - OperationEnumOptions.add("Load"); - OperationEnumOptions.add("Save"); - OperationEnumOptions.add("Delete"); - OperationEnumOptions.add("FullErase"); - OperationEnumOptions.add("Completed"); - OperationEnumOptions.add("Error"); - fields.add( new UAVObjectField("Operation", "", UAVObjectField.FieldType.ENUM, OperationElemNames, OperationEnumOptions) ); - - List SelectionElemNames = new ArrayList(); - SelectionElemNames.add("0"); - List SelectionEnumOptions = new ArrayList(); - SelectionEnumOptions.add("SingleObject"); - SelectionEnumOptions.add("AllSettings"); - SelectionEnumOptions.add("AllMetaObjects"); - SelectionEnumOptions.add("AllObjects"); - fields.add( new UAVObjectField("Selection", "", UAVObjectField.FieldType.ENUM, SelectionElemNames, SelectionEnumOptions) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.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; - } - - /** - * 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(long instID) { - // TODO: Need to get specific instance to clone - try { - ObjectPersistence obj = new ObjectPersistence(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public ObjectPersistence GetInstance(UAVObjectManager objMngr, long instID) - { - return (ObjectPersistence)(objMngr.getObject(ObjectPersistence.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x99C63292l; - protected static final String NAME = "ObjectPersistence"; - protected static String DESCRIPTION = "Someone who knows please enter this"; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/OveroSyncSettings.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/OveroSyncSettings.java deleted file mode 100644 index b312badfc..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/OveroSyncSettings.java +++ /dev/null @@ -1,143 +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 to control the behavior of the overo sync module - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -Settings to control the behavior of the overo sync module - -generated from overosyncsettings.xml - **/ -public class OveroSyncSettings extends UAVDataObject { - - public OveroSyncSettings() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List LogOnElemNames = new ArrayList(); - LogOnElemNames.add("0"); - List LogOnEnumOptions = new ArrayList(); - LogOnEnumOptions.add("Never"); - LogOnEnumOptions.add("Always"); - LogOnEnumOptions.add("Armed"); - fields.add( new UAVObjectField("LogOn", "", UAVObjectField.FieldType.ENUM, LogOnElemNames, LogOnEnumOptions) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 0 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 0; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 1000; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - getField("LogOn").setValue("Armed"); - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - OveroSyncSettings obj = new OveroSyncSettings(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public OveroSyncSettings GetInstance(UAVObjectManager objMngr, long instID) - { - return (OveroSyncSettings)(objMngr.getObject(OveroSyncSettings.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0xA1ABC278l; - protected static final String NAME = "OveroSyncSettings"; - protected static String DESCRIPTION = "Settings to control the behavior of the overo sync module"; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 1 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/OveroSyncStats.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/OveroSyncStats.java deleted file mode 100644 index 0618c247c..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/OveroSyncStats.java +++ /dev/null @@ -1,165 +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. - * Maintains statistics on transfer rate to and from over - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -Maintains statistics on transfer rate to and from over - -generated from overosyncstats.xml - **/ -public class OveroSyncStats extends UAVDataObject { - - public OveroSyncStats() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List SendElemNames = new ArrayList(); - SendElemNames.add("0"); - fields.add( new UAVObjectField("Send", "B/s", UAVObjectField.FieldType.UINT32, SendElemNames, null) ); - - List ReceivedElemNames = new ArrayList(); - ReceivedElemNames.add("0"); - fields.add( new UAVObjectField("Received", "B/s", UAVObjectField.FieldType.UINT32, ReceivedElemNames, null) ); - - List FramesyncErrorsElemNames = new ArrayList(); - FramesyncErrorsElemNames.add("0"); - fields.add( new UAVObjectField("FramesyncErrors", "count", UAVObjectField.FieldType.UINT32, FramesyncErrorsElemNames, null) ); - - List UnderrunErrorsElemNames = new ArrayList(); - UnderrunErrorsElemNames.add("0"); - fields.add( new UAVObjectField("UnderrunErrors", "count", UAVObjectField.FieldType.UINT32, UnderrunErrorsElemNames, null) ); - - List DroppedUpdatesElemNames = new ArrayList(); - DroppedUpdatesElemNames.add("0"); - fields.add( new UAVObjectField("DroppedUpdates", "", UAVObjectField.FieldType.UINT32, DroppedUpdatesElemNames, null) ); - - List PacketsElemNames = new ArrayList(); - PacketsElemNames.add("0"); - fields.add( new UAVObjectField("Packets", "", UAVObjectField.FieldType.UINT32, PacketsElemNames, null) ); - - List ConnectedElemNames = new ArrayList(); - ConnectedElemNames.add("0"); - List ConnectedEnumOptions = new ArrayList(); - ConnectedEnumOptions.add("False"); - ConnectedEnumOptions.add("True"); - fields.add( new UAVObjectField("Connected", "", UAVObjectField.FieldType.ENUM, ConnectedElemNames, ConnectedEnumOptions) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 0 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 1000; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 1000; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - OveroSyncStats obj = new OveroSyncStats(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public OveroSyncStats GetInstance(UAVObjectManager objMngr, long instID) - { - return (OveroSyncStats)(objMngr.getObject(OveroSyncStats.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0xD2085FACl; - protected static final String NAME = "OveroSyncStats"; - protected static String DESCRIPTION = "Maintains statistics on transfer rate to and from over"; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/PathAction.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/PathAction.java deleted file mode 100644 index f21e301c3..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/PathAction.java +++ /dev/null @@ -1,195 +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. - * A waypoint command the pathplanner is to use at a certain waypoint - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -A waypoint command the pathplanner is to use at a certain waypoint - -generated from pathaction.xml - **/ -public class PathAction extends UAVDataObject { - - public PathAction() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List ModeParametersElemNames = new ArrayList(); - ModeParametersElemNames.add("0"); - ModeParametersElemNames.add("1"); - ModeParametersElemNames.add("2"); - ModeParametersElemNames.add("3"); - fields.add( new UAVObjectField("ModeParameters", "", UAVObjectField.FieldType.FLOAT32, ModeParametersElemNames, null) ); - - List ConditionParametersElemNames = new ArrayList(); - ConditionParametersElemNames.add("0"); - ConditionParametersElemNames.add("1"); - ConditionParametersElemNames.add("2"); - ConditionParametersElemNames.add("3"); - fields.add( new UAVObjectField("ConditionParameters", "", UAVObjectField.FieldType.FLOAT32, ConditionParametersElemNames, null) ); - - List ModeElemNames = new ArrayList(); - ModeElemNames.add("0"); - List ModeEnumOptions = new ArrayList(); - ModeEnumOptions.add("FlyEndpoint"); - ModeEnumOptions.add("FlyVector"); - ModeEnumOptions.add("FlyCircleRight"); - ModeEnumOptions.add("FlyCircleLeft"); - ModeEnumOptions.add("DriveEndpoint"); - ModeEnumOptions.add("DriveVector"); - ModeEnumOptions.add("DriveCircleLeft"); - ModeEnumOptions.add("DriveCircleRight"); - ModeEnumOptions.add("FixedAttitude"); - ModeEnumOptions.add("SetAccessory"); - ModeEnumOptions.add("DisarmAlarm"); - fields.add( new UAVObjectField("Mode", "", UAVObjectField.FieldType.ENUM, ModeElemNames, ModeEnumOptions) ); - - List EndConditionElemNames = new ArrayList(); - EndConditionElemNames.add("0"); - List EndConditionEnumOptions = new ArrayList(); - EndConditionEnumOptions.add("None"); - EndConditionEnumOptions.add("TimeOut"); - EndConditionEnumOptions.add("DistanceToTarget"); - EndConditionEnumOptions.add("LegRemaining"); - EndConditionEnumOptions.add("AboveAltitude"); - EndConditionEnumOptions.add("PointingTowardsNext"); - EndConditionEnumOptions.add("PythonScript"); - EndConditionEnumOptions.add("Immediate"); - fields.add( new UAVObjectField("EndCondition", "", UAVObjectField.FieldType.ENUM, EndConditionElemNames, EndConditionEnumOptions) ); - - List CommandElemNames = new ArrayList(); - CommandElemNames.add("0"); - List CommandEnumOptions = new ArrayList(); - CommandEnumOptions.add("OnConditionNextWaypoint"); - CommandEnumOptions.add("OnNotConditionNextWaypoint"); - CommandEnumOptions.add("OnConditionJumpWaypoint"); - CommandEnumOptions.add("OnNotConditionJumpWaypoint"); - CommandEnumOptions.add("IfConditionJumpWaypointElseNextWaypoint"); - fields.add( new UAVObjectField("Command", "", UAVObjectField.FieldType.ENUM, CommandElemNames, CommandEnumOptions) ); - - List JumpDestinationElemNames = new ArrayList(); - JumpDestinationElemNames.add("0"); - fields.add( new UAVObjectField("JumpDestination", "waypoint", UAVObjectField.FieldType.UINT8, JumpDestinationElemNames, null) ); - - List ErrorDestinationElemNames = new ArrayList(); - ErrorDestinationElemNames.add("0"); - fields.add( new UAVObjectField("ErrorDestination", "waypoint", UAVObjectField.FieldType.UINT8, ErrorDestinationElemNames, null) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 0 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 4000; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 1000; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - PathAction obj = new PathAction(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public PathAction GetInstance(UAVObjectManager objMngr, long instID) - { - return (PathAction)(objMngr.getObject(PathAction.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x34595F1Cl; - protected static final String NAME = "PathAction"; - protected static String DESCRIPTION = "A waypoint command the pathplanner is to use at a certain waypoint"; - protected static final boolean ISSINGLEINST = 0 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/PathDesired.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/PathDesired.java deleted file mode 100644 index f7a00a5da..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/PathDesired.java +++ /dev/null @@ -1,162 +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 endpoint or path the craft is trying to achieve. Can come from @ref ManualControl or @ref PathPlanner - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -The endpoint or path the craft is trying to achieve. Can come from @ref ManualControl or @ref PathPlanner - -generated from pathdesired.xml - **/ -public class PathDesired extends UAVDataObject { - - public PathDesired() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List StartElemNames = new ArrayList(); - StartElemNames.add("North"); - StartElemNames.add("East"); - StartElemNames.add("Down"); - fields.add( new UAVObjectField("Start", "m", UAVObjectField.FieldType.FLOAT32, StartElemNames, null) ); - - List EndElemNames = new ArrayList(); - EndElemNames.add("North"); - EndElemNames.add("East"); - EndElemNames.add("Down"); - fields.add( new UAVObjectField("End", "m", UAVObjectField.FieldType.FLOAT32, EndElemNames, null) ); - - List StartingVelocityElemNames = new ArrayList(); - StartingVelocityElemNames.add("0"); - fields.add( new UAVObjectField("StartingVelocity", "m/s", UAVObjectField.FieldType.FLOAT32, StartingVelocityElemNames, null) ); - - List EndingVelocityElemNames = new ArrayList(); - EndingVelocityElemNames.add("0"); - fields.add( new UAVObjectField("EndingVelocity", "m/s", UAVObjectField.FieldType.FLOAT32, EndingVelocityElemNames, null) ); - - List ModeElemNames = new ArrayList(); - ModeElemNames.add("0"); - List ModeEnumOptions = new ArrayList(); - ModeEnumOptions.add("Endpoint"); - ModeEnumOptions.add("Path"); - ModeEnumOptions.add("Land"); - fields.add( new UAVObjectField("Mode", "", UAVObjectField.FieldType.ENUM, ModeElemNames, ModeEnumOptions) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 0 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 1000; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 0; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - PathDesired obj = new PathDesired(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public PathDesired GetInstance(UAVObjectManager objMngr, long instID) - { - return (PathDesired)(objMngr.getObject(PathDesired.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x5A4DC71Al; - protected static final String NAME = "PathDesired"; - protected static String DESCRIPTION = "The endpoint or path the craft is trying to achieve. Can come from @ref ManualControl or @ref PathPlanner "; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/PathPlannerSettings.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/PathPlannerSettings.java deleted file mode 100644 index d309130a7..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/PathPlannerSettings.java +++ /dev/null @@ -1,151 +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 PathPlanner Module - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -Settings for the @ref PathPlanner Module - -generated from pathplannersettings.xml - **/ -public class PathPlannerSettings extends UAVDataObject { - - public PathPlannerSettings() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List PathModeElemNames = new ArrayList(); - PathModeElemNames.add("0"); - List PathModeEnumOptions = new ArrayList(); - PathModeEnumOptions.add("ENDPOINT"); - PathModeEnumOptions.add("PATH"); - fields.add( new UAVObjectField("PathMode", "", UAVObjectField.FieldType.ENUM, PathModeElemNames, PathModeEnumOptions) ); - - List PreprogrammedPathElemNames = new ArrayList(); - PreprogrammedPathElemNames.add("0"); - List PreprogrammedPathEnumOptions = new ArrayList(); - PreprogrammedPathEnumOptions.add("NONE"); - PreprogrammedPathEnumOptions.add("10M_BOX"); - PreprogrammedPathEnumOptions.add("LOGO"); - fields.add( new UAVObjectField("PreprogrammedPath", "", UAVObjectField.FieldType.ENUM, PreprogrammedPathElemNames, PreprogrammedPathEnumOptions) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 1 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 0; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 0; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - getField("PathMode").setValue("PATH"); - getField("PreprogrammedPath").setValue("NONE"); - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - PathPlannerSettings obj = new PathPlannerSettings(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public PathPlannerSettings GetInstance(UAVObjectManager objMngr, long instID) - { - return (PathPlannerSettings)(objMngr.getObject(PathPlannerSettings.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x290E45DAl; - protected static final String NAME = "PathPlannerSettings"; - protected static String DESCRIPTION = "Settings for the @ref PathPlanner Module"; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 1 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/PipXSettings.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/PipXSettings.java deleted file mode 100644 index 70983914e..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/PipXSettings.java +++ /dev/null @@ -1,326 +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. - * PipXtreme configurations options. - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -PipXtreme configurations options. - -generated from pipxsettings.xml - **/ -public class PipXSettings extends UAVDataObject { - - public PipXSettings() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List PairIDElemNames = new ArrayList(); - PairIDElemNames.add("0"); - fields.add( new UAVObjectField("PairID", "", UAVObjectField.FieldType.UINT32, PairIDElemNames, null) ); - - List FrequencyElemNames = new ArrayList(); - FrequencyElemNames.add("0"); - fields.add( new UAVObjectField("Frequency", "", UAVObjectField.FieldType.UINT32, FrequencyElemNames, null) ); - - List SendTimeoutElemNames = new ArrayList(); - SendTimeoutElemNames.add("0"); - fields.add( new UAVObjectField("SendTimeout", "ms", UAVObjectField.FieldType.UINT16, SendTimeoutElemNames, null) ); - - List TelemetryConfigElemNames = new ArrayList(); - TelemetryConfigElemNames.add("0"); - List TelemetryConfigEnumOptions = new ArrayList(); - TelemetryConfigEnumOptions.add("Disabled"); - TelemetryConfigEnumOptions.add("Serial"); - TelemetryConfigEnumOptions.add("UAVTalk"); - TelemetryConfigEnumOptions.add("GCS"); - TelemetryConfigEnumOptions.add("Debug"); - fields.add( new UAVObjectField("TelemetryConfig", "function", UAVObjectField.FieldType.ENUM, TelemetryConfigElemNames, TelemetryConfigEnumOptions) ); - - List TelemetrySpeedElemNames = new ArrayList(); - TelemetrySpeedElemNames.add("0"); - List TelemetrySpeedEnumOptions = new ArrayList(); - TelemetrySpeedEnumOptions.add("2400"); - TelemetrySpeedEnumOptions.add("4800"); - TelemetrySpeedEnumOptions.add("9600"); - TelemetrySpeedEnumOptions.add("19200"); - TelemetrySpeedEnumOptions.add("38400"); - TelemetrySpeedEnumOptions.add("57600"); - TelemetrySpeedEnumOptions.add("115200"); - fields.add( new UAVObjectField("TelemetrySpeed", "bps", UAVObjectField.FieldType.ENUM, TelemetrySpeedElemNames, TelemetrySpeedEnumOptions) ); - - List FlexiConfigElemNames = new ArrayList(); - FlexiConfigElemNames.add("0"); - List FlexiConfigEnumOptions = new ArrayList(); - FlexiConfigEnumOptions.add("Disabled"); - FlexiConfigEnumOptions.add("Serial"); - FlexiConfigEnumOptions.add("UAVTalk"); - FlexiConfigEnumOptions.add("GCS"); - FlexiConfigEnumOptions.add("PPM_In"); - FlexiConfigEnumOptions.add("PPM_Out"); - FlexiConfigEnumOptions.add("RSSI"); - FlexiConfigEnumOptions.add("Debug"); - fields.add( new UAVObjectField("FlexiConfig", "function", UAVObjectField.FieldType.ENUM, FlexiConfigElemNames, FlexiConfigEnumOptions) ); - - List FlexiSpeedElemNames = new ArrayList(); - FlexiSpeedElemNames.add("0"); - List FlexiSpeedEnumOptions = new ArrayList(); - FlexiSpeedEnumOptions.add("2400"); - FlexiSpeedEnumOptions.add("4800"); - FlexiSpeedEnumOptions.add("9600"); - FlexiSpeedEnumOptions.add("19200"); - FlexiSpeedEnumOptions.add("38400"); - FlexiSpeedEnumOptions.add("57600"); - FlexiSpeedEnumOptions.add("115200"); - fields.add( new UAVObjectField("FlexiSpeed", "bps", UAVObjectField.FieldType.ENUM, FlexiSpeedElemNames, FlexiSpeedEnumOptions) ); - - List VCPConfigElemNames = new ArrayList(); - VCPConfigElemNames.add("0"); - List VCPConfigEnumOptions = new ArrayList(); - VCPConfigEnumOptions.add("Disabled"); - VCPConfigEnumOptions.add("Serial"); - VCPConfigEnumOptions.add("Debug"); - fields.add( new UAVObjectField("VCPConfig", "function", UAVObjectField.FieldType.ENUM, VCPConfigElemNames, VCPConfigEnumOptions) ); - - List VCPSpeedElemNames = new ArrayList(); - VCPSpeedElemNames.add("0"); - List VCPSpeedEnumOptions = new ArrayList(); - VCPSpeedEnumOptions.add("2400"); - VCPSpeedEnumOptions.add("4800"); - VCPSpeedEnumOptions.add("9600"); - VCPSpeedEnumOptions.add("19200"); - VCPSpeedEnumOptions.add("38400"); - VCPSpeedEnumOptions.add("57600"); - VCPSpeedEnumOptions.add("115200"); - fields.add( new UAVObjectField("VCPSpeed", "bps", UAVObjectField.FieldType.ENUM, VCPSpeedElemNames, VCPSpeedEnumOptions) ); - - List RFSpeedElemNames = new ArrayList(); - RFSpeedElemNames.add("0"); - List RFSpeedEnumOptions = new ArrayList(); - RFSpeedEnumOptions.add("2400"); - RFSpeedEnumOptions.add("4800"); - RFSpeedEnumOptions.add("9600"); - RFSpeedEnumOptions.add("19200"); - RFSpeedEnumOptions.add("38400"); - RFSpeedEnumOptions.add("57600"); - RFSpeedEnumOptions.add("115200"); - fields.add( new UAVObjectField("RFSpeed", "bps", UAVObjectField.FieldType.ENUM, RFSpeedElemNames, RFSpeedEnumOptions) ); - - List MaxRFPowerElemNames = new ArrayList(); - MaxRFPowerElemNames.add("0"); - List MaxRFPowerEnumOptions = new ArrayList(); - MaxRFPowerEnumOptions.add("1.25"); - MaxRFPowerEnumOptions.add("1.6"); - MaxRFPowerEnumOptions.add("3.16"); - MaxRFPowerEnumOptions.add("6.3"); - MaxRFPowerEnumOptions.add("12.6"); - MaxRFPowerEnumOptions.add("25"); - MaxRFPowerEnumOptions.add("50"); - MaxRFPowerEnumOptions.add("100"); - fields.add( new UAVObjectField("MaxRFPower", "mW", UAVObjectField.FieldType.ENUM, MaxRFPowerElemNames, MaxRFPowerEnumOptions) ); - - List MinPacketSizeElemNames = new ArrayList(); - MinPacketSizeElemNames.add("0"); - fields.add( new UAVObjectField("MinPacketSize", "bytes", UAVObjectField.FieldType.UINT8, MinPacketSizeElemNames, null) ); - - List FrequencyCalibrationElemNames = new ArrayList(); - FrequencyCalibrationElemNames.add("0"); - fields.add( new UAVObjectField("FrequencyCalibration", "", UAVObjectField.FieldType.UINT8, FrequencyCalibrationElemNames, null) ); - - List AESKeyElemNames = new ArrayList(); - AESKeyElemNames.add("0"); - AESKeyElemNames.add("1"); - AESKeyElemNames.add("2"); - AESKeyElemNames.add("3"); - AESKeyElemNames.add("4"); - AESKeyElemNames.add("5"); - AESKeyElemNames.add("6"); - AESKeyElemNames.add("7"); - AESKeyElemNames.add("8"); - AESKeyElemNames.add("9"); - AESKeyElemNames.add("10"); - AESKeyElemNames.add("11"); - AESKeyElemNames.add("12"); - AESKeyElemNames.add("13"); - AESKeyElemNames.add("14"); - AESKeyElemNames.add("15"); - AESKeyElemNames.add("16"); - AESKeyElemNames.add("17"); - AESKeyElemNames.add("18"); - AESKeyElemNames.add("19"); - AESKeyElemNames.add("20"); - AESKeyElemNames.add("21"); - AESKeyElemNames.add("22"); - AESKeyElemNames.add("23"); - AESKeyElemNames.add("24"); - AESKeyElemNames.add("25"); - AESKeyElemNames.add("26"); - AESKeyElemNames.add("27"); - AESKeyElemNames.add("28"); - AESKeyElemNames.add("29"); - AESKeyElemNames.add("30"); - AESKeyElemNames.add("31"); - fields.add( new UAVObjectField("AESKey", "", UAVObjectField.FieldType.UINT8, AESKeyElemNames, null) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 1 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 0; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 0; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - getField("PairID").setValue(0); - getField("Frequency").setValue(434000000); - getField("SendTimeout").setValue(50); - getField("TelemetryConfig").setValue("UAVTalk"); - getField("TelemetrySpeed").setValue("57600"); - getField("FlexiConfig").setValue("Disabled"); - getField("FlexiSpeed").setValue("57600"); - getField("VCPConfig").setValue("Disabled"); - getField("VCPSpeed").setValue("57600"); - getField("RFSpeed").setValue("115200"); - getField("MaxRFPower").setValue("1.25"); - getField("MinPacketSize").setValue(50); - getField("FrequencyCalibration").setValue(127); - getField("AESKey").setValue(0,0); - getField("AESKey").setValue(0,1); - getField("AESKey").setValue(0,2); - getField("AESKey").setValue(0,3); - getField("AESKey").setValue(0,4); - getField("AESKey").setValue(0,5); - getField("AESKey").setValue(0,6); - getField("AESKey").setValue(0,7); - getField("AESKey").setValue(0,8); - getField("AESKey").setValue(0,9); - getField("AESKey").setValue(0,10); - getField("AESKey").setValue(0,11); - getField("AESKey").setValue(0,12); - getField("AESKey").setValue(0,13); - getField("AESKey").setValue(0,14); - getField("AESKey").setValue(0,15); - getField("AESKey").setValue(0,16); - getField("AESKey").setValue(0,17); - getField("AESKey").setValue(0,18); - getField("AESKey").setValue(0,19); - getField("AESKey").setValue(0,20); - getField("AESKey").setValue(0,21); - getField("AESKey").setValue(0,22); - getField("AESKey").setValue(0,23); - getField("AESKey").setValue(0,24); - getField("AESKey").setValue(0,25); - getField("AESKey").setValue(0,26); - getField("AESKey").setValue(0,27); - getField("AESKey").setValue(0,28); - getField("AESKey").setValue(0,29); - getField("AESKey").setValue(0,30); - getField("AESKey").setValue(0,31); - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - PipXSettings obj = new PipXSettings(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public PipXSettings GetInstance(UAVObjectManager objMngr, long instID) - { - return (PipXSettings)(objMngr.getObject(PipXSettings.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0xBA192BCAl; - protected static final String NAME = "PipXSettings"; - protected static String DESCRIPTION = "PipXtreme configurations options."; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 1 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/PipXStatus.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/PipXStatus.java deleted file mode 100644 index 52f143ed6..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/PipXStatus.java +++ /dev/null @@ -1,296 +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. - * PipXtreme device status. - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -PipXtreme device status. - -generated from pipxstatus.xml - **/ -public class PipXStatus extends UAVDataObject { - - public PipXStatus() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List MinFrequencyElemNames = new ArrayList(); - MinFrequencyElemNames.add("0"); - fields.add( new UAVObjectField("MinFrequency", "Hz", UAVObjectField.FieldType.UINT32, MinFrequencyElemNames, null) ); - - List MaxFrequencyElemNames = new ArrayList(); - MaxFrequencyElemNames.add("0"); - fields.add( new UAVObjectField("MaxFrequency", "Hz", UAVObjectField.FieldType.UINT32, MaxFrequencyElemNames, null) ); - - List FrequencyStepSizeElemNames = new ArrayList(); - FrequencyStepSizeElemNames.add("0"); - fields.add( new UAVObjectField("FrequencyStepSize", "", UAVObjectField.FieldType.FLOAT32, FrequencyStepSizeElemNames, null) ); - - List DeviceIDElemNames = new ArrayList(); - DeviceIDElemNames.add("0"); - fields.add( new UAVObjectField("DeviceID", "", UAVObjectField.FieldType.UINT32, DeviceIDElemNames, null) ); - - List PairIDsElemNames = new ArrayList(); - PairIDsElemNames.add("0"); - PairIDsElemNames.add("1"); - PairIDsElemNames.add("2"); - PairIDsElemNames.add("3"); - fields.add( new UAVObjectField("PairIDs", "", UAVObjectField.FieldType.UINT32, PairIDsElemNames, null) ); - - List BoardRevisionElemNames = new ArrayList(); - BoardRevisionElemNames.add("0"); - fields.add( new UAVObjectField("BoardRevision", "", UAVObjectField.FieldType.UINT16, BoardRevisionElemNames, null) ); - - List RetriesElemNames = new ArrayList(); - RetriesElemNames.add("0"); - fields.add( new UAVObjectField("Retries", "", UAVObjectField.FieldType.UINT16, RetriesElemNames, null) ); - - List UAVTalkErrorsElemNames = new ArrayList(); - UAVTalkErrorsElemNames.add("0"); - fields.add( new UAVObjectField("UAVTalkErrors", "", UAVObjectField.FieldType.UINT16, UAVTalkErrorsElemNames, null) ); - - List DroppedElemNames = new ArrayList(); - DroppedElemNames.add("0"); - fields.add( new UAVObjectField("Dropped", "", UAVObjectField.FieldType.UINT16, DroppedElemNames, null) ); - - List ResetsElemNames = new ArrayList(); - ResetsElemNames.add("0"); - fields.add( new UAVObjectField("Resets", "", UAVObjectField.FieldType.UINT16, ResetsElemNames, null) ); - - List TXRateElemNames = new ArrayList(); - TXRateElemNames.add("0"); - fields.add( new UAVObjectField("TXRate", "Bps", UAVObjectField.FieldType.UINT16, TXRateElemNames, null) ); - - List RXRateElemNames = new ArrayList(); - RXRateElemNames.add("0"); - fields.add( new UAVObjectField("RXRate", "Bps", UAVObjectField.FieldType.UINT16, RXRateElemNames, null) ); - - List DescriptionElemNames = new ArrayList(); - DescriptionElemNames.add("0"); - DescriptionElemNames.add("1"); - DescriptionElemNames.add("2"); - DescriptionElemNames.add("3"); - DescriptionElemNames.add("4"); - DescriptionElemNames.add("5"); - DescriptionElemNames.add("6"); - DescriptionElemNames.add("7"); - DescriptionElemNames.add("8"); - DescriptionElemNames.add("9"); - DescriptionElemNames.add("10"); - DescriptionElemNames.add("11"); - DescriptionElemNames.add("12"); - DescriptionElemNames.add("13"); - DescriptionElemNames.add("14"); - DescriptionElemNames.add("15"); - DescriptionElemNames.add("16"); - DescriptionElemNames.add("17"); - DescriptionElemNames.add("18"); - DescriptionElemNames.add("19"); - DescriptionElemNames.add("20"); - DescriptionElemNames.add("21"); - DescriptionElemNames.add("22"); - DescriptionElemNames.add("23"); - DescriptionElemNames.add("24"); - DescriptionElemNames.add("25"); - DescriptionElemNames.add("26"); - DescriptionElemNames.add("27"); - DescriptionElemNames.add("28"); - DescriptionElemNames.add("29"); - DescriptionElemNames.add("30"); - DescriptionElemNames.add("31"); - DescriptionElemNames.add("32"); - DescriptionElemNames.add("33"); - DescriptionElemNames.add("34"); - DescriptionElemNames.add("35"); - DescriptionElemNames.add("36"); - DescriptionElemNames.add("37"); - DescriptionElemNames.add("38"); - DescriptionElemNames.add("39"); - fields.add( new UAVObjectField("Description", "", UAVObjectField.FieldType.UINT8, DescriptionElemNames, null) ); - - List CPUSerialElemNames = new ArrayList(); - CPUSerialElemNames.add("0"); - CPUSerialElemNames.add("1"); - CPUSerialElemNames.add("2"); - CPUSerialElemNames.add("3"); - CPUSerialElemNames.add("4"); - CPUSerialElemNames.add("5"); - CPUSerialElemNames.add("6"); - CPUSerialElemNames.add("7"); - CPUSerialElemNames.add("8"); - CPUSerialElemNames.add("9"); - CPUSerialElemNames.add("10"); - CPUSerialElemNames.add("11"); - fields.add( new UAVObjectField("CPUSerial", "", UAVObjectField.FieldType.UINT8, CPUSerialElemNames, null) ); - - List BoardTypeElemNames = new ArrayList(); - BoardTypeElemNames.add("0"); - fields.add( new UAVObjectField("BoardType", "", UAVObjectField.FieldType.UINT8, BoardTypeElemNames, null) ); - - List FrequencyBandElemNames = new ArrayList(); - FrequencyBandElemNames.add("0"); - fields.add( new UAVObjectField("FrequencyBand", "", UAVObjectField.FieldType.UINT8, FrequencyBandElemNames, null) ); - - List RSSIElemNames = new ArrayList(); - RSSIElemNames.add("0"); - fields.add( new UAVObjectField("RSSI", "dBm", UAVObjectField.FieldType.INT8, RSSIElemNames, null) ); - - List LinkQualityElemNames = new ArrayList(); - LinkQualityElemNames.add("0"); - fields.add( new UAVObjectField("LinkQuality", "", UAVObjectField.FieldType.UINT8, LinkQualityElemNames, null) ); - - List LinkStateElemNames = new ArrayList(); - LinkStateElemNames.add("0"); - List LinkStateEnumOptions = new ArrayList(); - LinkStateEnumOptions.add("Disconnected"); - LinkStateEnumOptions.add("Connecting"); - LinkStateEnumOptions.add("Connected"); - fields.add( new UAVObjectField("LinkState", "function", UAVObjectField.FieldType.ENUM, LinkStateElemNames, LinkStateEnumOptions) ); - - List PairSignalStrengthsElemNames = new ArrayList(); - PairSignalStrengthsElemNames.add("0"); - PairSignalStrengthsElemNames.add("1"); - PairSignalStrengthsElemNames.add("2"); - PairSignalStrengthsElemNames.add("3"); - fields.add( new UAVObjectField("PairSignalStrengths", "dBm", UAVObjectField.FieldType.INT8, PairSignalStrengthsElemNames, null) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READONLY) << UAVOBJ_GCS_ACCESS_SHIFT | - 0 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 1000; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 1000; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - getField("MinFrequency").setValue(0); - getField("MaxFrequency").setValue(0); - getField("FrequencyStepSize").setValue(0); - getField("DeviceID").setValue(0); - getField("PairIDs").setValue(0,0); - getField("PairIDs").setValue(0,1); - getField("PairIDs").setValue(0,2); - getField("PairIDs").setValue(0,3); - getField("Retries").setValue(0); - getField("UAVTalkErrors").setValue(0); - getField("Dropped").setValue(0); - getField("Resets").setValue(0); - getField("TXRate").setValue(0); - getField("RXRate").setValue(0); - getField("FrequencyBand").setValue(0); - getField("RSSI").setValue(0); - getField("LinkQuality").setValue(0); - getField("LinkState").setValue("Disconnected"); - getField("PairSignalStrengths").setValue(-127,0); - getField("PairSignalStrengths").setValue(-127,1); - getField("PairSignalStrengths").setValue(-127,2); - getField("PairSignalStrengths").setValue(-127,3); - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - PipXStatus obj = new PipXStatus(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public PipXStatus GetInstance(UAVObjectManager objMngr, long instID) - { - return (PipXStatus)(objMngr.getObject(PipXStatus.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x85D29F8Al; - protected static final String NAME = "PipXStatus"; - protected static String DESCRIPTION = "PipXtreme device status."; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/PositionActual.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/PositionActual.java deleted file mode 100644 index 5fe8b497f..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/PositionActual.java +++ /dev/null @@ -1,146 +0,0 @@ -/** - ****************************************************************************** - * - * @file uavobjecttemplate.cpp - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * @brief Template for an uavobject in java - * This is a autogenerated file!! Do not modify and expect a result. - * Contains the current position relative to @ref HomeLocation - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -Contains the current position relative to @ref HomeLocation - -generated from positionactual.xml - **/ -public class PositionActual extends UAVDataObject { - - public PositionActual() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List NorthElemNames = new ArrayList(); - NorthElemNames.add("0"); - fields.add( new UAVObjectField("North", "m", UAVObjectField.FieldType.FLOAT32, NorthElemNames, null) ); - - List EastElemNames = new ArrayList(); - EastElemNames.add("0"); - fields.add( new UAVObjectField("East", "m", UAVObjectField.FieldType.FLOAT32, EastElemNames, null) ); - - List DownElemNames = new ArrayList(); - 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 li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 0 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 1000; - metadata.gcsTelemetryUpdatePeriod = 1000; - 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(long instID) { - // TODO: Need to get specific instance to clone - try { - PositionActual obj = new PositionActual(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public PositionActual GetInstance(UAVObjectManager objMngr, long instID) - { - return (PositionActual)(objMngr.getObject(PositionActual.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0xFA9E2D42l; - protected static final String NAME = "PositionActual"; - protected static String DESCRIPTION = "Contains the current position relative to @ref HomeLocation"; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/PositionDesired.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/PositionDesired.java deleted file mode 100644 index 967e298e6..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/PositionDesired.java +++ /dev/null @@ -1,146 +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 fields = new ArrayList(); - - - List NorthElemNames = new ArrayList(); - NorthElemNames.add("0"); - fields.add( new UAVObjectField("North", "m", UAVObjectField.FieldType.FLOAT32, NorthElemNames, null) ); - - List EastElemNames = new ArrayList(); - EastElemNames.add("0"); - fields.add( new UAVObjectField("East", "m", UAVObjectField.FieldType.FLOAT32, EastElemNames, null) ); - - List DownElemNames = new ArrayList(); - 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 li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 0 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 0; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 1000; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long 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, long instID) - { - return (PositionDesired)(objMngr.getObject(PositionDesired.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x778DBE24l; - 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 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/RateDesired.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/RateDesired.java deleted file mode 100644 index b15d368a0..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/RateDesired.java +++ /dev/null @@ -1,146 +0,0 @@ -/** - ****************************************************************************** - * - * @file uavobjecttemplate.cpp - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * @brief Template for an uavobject in java - * This is a autogenerated file!! Do not modify and expect a result. - * Status for the matrix mixer showing the output of each mixer after all scaling - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -Status for the matrix mixer showing the output of each mixer after all scaling - -generated from ratedesired.xml - **/ -public class RateDesired extends UAVDataObject { - - public RateDesired() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List RollElemNames = new ArrayList(); - RollElemNames.add("0"); - fields.add( new UAVObjectField("Roll", "deg/s", UAVObjectField.FieldType.FLOAT32, RollElemNames, null) ); - - List PitchElemNames = new ArrayList(); - PitchElemNames.add("0"); - fields.add( new UAVObjectField("Pitch", "deg/s", UAVObjectField.FieldType.FLOAT32, PitchElemNames, null) ); - - List YawElemNames = new ArrayList(); - YawElemNames.add("0"); - fields.add( new UAVObjectField("Yaw", "deg/s", UAVObjectField.FieldType.FLOAT32, YawElemNames, null) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 0 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 1000; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 1000; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - RateDesired obj = new RateDesired(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public RateDesired GetInstance(UAVObjectManager objMngr, long instID) - { - return (RateDesired)(objMngr.getObject(RateDesired.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0xCE8C826l; - protected static final String NAME = "RateDesired"; - protected static String DESCRIPTION = "Status for the matrix mixer showing the output of each mixer after all scaling"; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/ReceiverActivity.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/ReceiverActivity.java deleted file mode 100644 index 4928d0913..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/ReceiverActivity.java +++ /dev/null @@ -1,152 +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. - * Monitors which receiver channels have been active within the last second. - * - * @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; - -/** -Monitors which receiver channels have been active within the last second. - -generated from receiveractivity.xml - **/ -public class ReceiverActivity extends UAVDataObject { - - public ReceiverActivity() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List ActiveGroupElemNames = new ArrayList(); - ActiveGroupElemNames.add("0"); - List ActiveGroupEnumOptions = new ArrayList(); - ActiveGroupEnumOptions.add("PWM"); - ActiveGroupEnumOptions.add("PPM"); - ActiveGroupEnumOptions.add("DSM (MainPort)"); - ActiveGroupEnumOptions.add("DSM (FlexiPort)"); - ActiveGroupEnumOptions.add("S.Bus"); - ActiveGroupEnumOptions.add("GCS"); - ActiveGroupEnumOptions.add("None"); - fields.add( new UAVObjectField("ActiveGroup", "Channel Group", UAVObjectField.FieldType.ENUM, ActiveGroupElemNames, ActiveGroupEnumOptions) ); - - List ActiveChannelElemNames = new ArrayList(); - ActiveChannelElemNames.add("0"); - fields.add( new UAVObjectField("ActiveChannel", "channel", UAVObjectField.FieldType.UINT8, ActiveChannelElemNames, null) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.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; - } - - /** - * 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("ActiveGroup").setValue("None"); - getField("ActiveChannel").setValue(255); - - } - - /** - * 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(long instID) { - // TODO: Need to get specific instance to clone - try { - ReceiverActivity obj = new ReceiverActivity(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public ReceiverActivity GetInstance(UAVObjectManager objMngr, long instID) - { - return (ReceiverActivity)(objMngr.getObject(ReceiverActivity.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x1E7C53DAl; - protected static final String NAME = "ReceiverActivity"; - protected static String DESCRIPTION = "Monitors which receiver channels have been active within the last second."; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/RelayTuning.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/RelayTuning.java deleted file mode 100644 index 136785bee..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/RelayTuning.java +++ /dev/null @@ -1,146 +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 input to the relay tuning. - * - * @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 input to the relay tuning. - -generated from relaytuning.xml - **/ -public class RelayTuning extends UAVDataObject { - - public RelayTuning() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List PeriodElemNames = new ArrayList(); - PeriodElemNames.add("Roll"); - PeriodElemNames.add("Pitch"); - PeriodElemNames.add("Yaw"); - fields.add( new UAVObjectField("Period", "ms", UAVObjectField.FieldType.FLOAT32, PeriodElemNames, null) ); - - List GainElemNames = new ArrayList(); - GainElemNames.add("Roll"); - GainElemNames.add("Pitch"); - GainElemNames.add("Yaw"); - fields.add( new UAVObjectField("Gain", "(deg/s)/output", UAVObjectField.FieldType.FLOAT32, GainElemNames, null) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.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; - } - - /** - * 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(long instID) { - // TODO: Need to get specific instance to clone - try { - RelayTuning obj = new RelayTuning(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public RelayTuning GetInstance(UAVObjectManager objMngr, long instID) - { - return (RelayTuning)(objMngr.getObject(RelayTuning.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0xF6EE61BEl; - protected static final String NAME = "RelayTuning"; - protected static String DESCRIPTION = "The input to the relay tuning."; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/RelayTuningSettings.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/RelayTuningSettings.java deleted file mode 100644 index 9dfa78654..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/RelayTuningSettings.java +++ /dev/null @@ -1,171 +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. - * Setting to run a relay tuning algorithm - * - * @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; - -/** -Setting to run a relay tuning algorithm - -generated from relaytuningsettings.xml - **/ -public class RelayTuningSettings extends UAVDataObject { - - public RelayTuningSettings() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List RateGainElemNames = new ArrayList(); - RateGainElemNames.add("0"); - fields.add( new UAVObjectField("RateGain", "", UAVObjectField.FieldType.FLOAT32, RateGainElemNames, null) ); - - List AttitudeGainElemNames = new ArrayList(); - AttitudeGainElemNames.add("0"); - fields.add( new UAVObjectField("AttitudeGain", "", UAVObjectField.FieldType.FLOAT32, AttitudeGainElemNames, null) ); - - List AmplitudeElemNames = new ArrayList(); - AmplitudeElemNames.add("0"); - fields.add( new UAVObjectField("Amplitude", "", UAVObjectField.FieldType.FLOAT32, AmplitudeElemNames, null) ); - - List HysteresisThreshElemNames = new ArrayList(); - HysteresisThreshElemNames.add("0"); - fields.add( new UAVObjectField("HysteresisThresh", "deg/s", UAVObjectField.FieldType.UINT8, HysteresisThreshElemNames, null) ); - - List ModeElemNames = new ArrayList(); - ModeElemNames.add("0"); - List ModeEnumOptions = new ArrayList(); - ModeEnumOptions.add("Rate"); - ModeEnumOptions.add("Attitude"); - fields.add( new UAVObjectField("Mode", "", UAVObjectField.FieldType.ENUM, ModeElemNames, ModeEnumOptions) ); - - List BehaviorElemNames = new ArrayList(); - BehaviorElemNames.add("0"); - List BehaviorEnumOptions = new ArrayList(); - BehaviorEnumOptions.add("Measure"); - BehaviorEnumOptions.add("Compute"); - BehaviorEnumOptions.add("Save"); - fields.add( new UAVObjectField("Behavior", "", UAVObjectField.FieldType.ENUM, BehaviorElemNames, BehaviorEnumOptions) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 1 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 0; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 0; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - getField("RateGain").setValue(0.3333); - getField("AttitudeGain").setValue(0.2); - getField("Amplitude").setValue(0.25); - getField("HysteresisThresh").setValue(5); - getField("Mode").setValue("Attitude"); - getField("Behavior").setValue("Compute"); - - } - - /** - * 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(long instID) { - // TODO: Need to get specific instance to clone - try { - RelayTuningSettings obj = new RelayTuningSettings(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public RelayTuningSettings GetInstance(UAVObjectManager objMngr, long instID) - { - return (RelayTuningSettings)(objMngr.getObject(RelayTuningSettings.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0xEA358166l; - protected static final String NAME = "RelayTuningSettings"; - protected static String DESCRIPTION = "Setting to run a relay tuning algorithm"; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 1 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/RevoCalibration.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/RevoCalibration.java deleted file mode 100644 index 9881cfe14..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/RevoCalibration.java +++ /dev/null @@ -1,249 +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 INS to control the algorithm and what is updated - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -Settings for the INS to control the algorithm and what is updated - -generated from revocalibration.xml - **/ -public class RevoCalibration extends UAVDataObject { - - public RevoCalibration() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List accel_biasElemNames = new ArrayList(); - accel_biasElemNames.add("X"); - accel_biasElemNames.add("Y"); - accel_biasElemNames.add("Z"); - fields.add( new UAVObjectField("accel_bias", "m/s", UAVObjectField.FieldType.FLOAT32, accel_biasElemNames, null) ); - - List accel_scaleElemNames = new ArrayList(); - accel_scaleElemNames.add("X"); - accel_scaleElemNames.add("Y"); - accel_scaleElemNames.add("Z"); - fields.add( new UAVObjectField("accel_scale", "gain", UAVObjectField.FieldType.FLOAT32, accel_scaleElemNames, null) ); - - List accel_varElemNames = new ArrayList(); - accel_varElemNames.add("X"); - accel_varElemNames.add("Y"); - accel_varElemNames.add("Z"); - fields.add( new UAVObjectField("accel_var", "(m/s)^2", UAVObjectField.FieldType.FLOAT32, accel_varElemNames, null) ); - - List gyro_biasElemNames = new ArrayList(); - gyro_biasElemNames.add("X"); - gyro_biasElemNames.add("Y"); - gyro_biasElemNames.add("Z"); - fields.add( new UAVObjectField("gyro_bias", "deg/s", UAVObjectField.FieldType.FLOAT32, gyro_biasElemNames, null) ); - - List gyro_scaleElemNames = new ArrayList(); - gyro_scaleElemNames.add("X"); - gyro_scaleElemNames.add("Y"); - gyro_scaleElemNames.add("Z"); - fields.add( new UAVObjectField("gyro_scale", "gain", UAVObjectField.FieldType.FLOAT32, gyro_scaleElemNames, null) ); - - List gyro_varElemNames = new ArrayList(); - gyro_varElemNames.add("X"); - gyro_varElemNames.add("Y"); - gyro_varElemNames.add("Z"); - fields.add( new UAVObjectField("gyro_var", "(deg/s)^2", UAVObjectField.FieldType.FLOAT32, gyro_varElemNames, null) ); - - List gyro_tempcoeffElemNames = new ArrayList(); - gyro_tempcoeffElemNames.add("X"); - gyro_tempcoeffElemNames.add("Y"); - gyro_tempcoeffElemNames.add("Z"); - fields.add( new UAVObjectField("gyro_tempcoeff", "(deg/s)/deg", UAVObjectField.FieldType.FLOAT32, gyro_tempcoeffElemNames, null) ); - - List mag_biasElemNames = new ArrayList(); - mag_biasElemNames.add("X"); - mag_biasElemNames.add("Y"); - mag_biasElemNames.add("Z"); - fields.add( new UAVObjectField("mag_bias", "mGau", UAVObjectField.FieldType.FLOAT32, mag_biasElemNames, null) ); - - List mag_scaleElemNames = new ArrayList(); - mag_scaleElemNames.add("X"); - mag_scaleElemNames.add("Y"); - mag_scaleElemNames.add("Z"); - fields.add( new UAVObjectField("mag_scale", "gain", UAVObjectField.FieldType.FLOAT32, mag_scaleElemNames, null) ); - - List mag_varElemNames = new ArrayList(); - mag_varElemNames.add("X"); - mag_varElemNames.add("Y"); - mag_varElemNames.add("Z"); - fields.add( new UAVObjectField("mag_var", "mGau^2", UAVObjectField.FieldType.FLOAT32, mag_varElemNames, null) ); - - List gps_varElemNames = new ArrayList(); - gps_varElemNames.add("Pos"); - gps_varElemNames.add("Vel"); - fields.add( new UAVObjectField("gps_var", "m^2", UAVObjectField.FieldType.FLOAT32, gps_varElemNames, null) ); - - List baro_varElemNames = new ArrayList(); - baro_varElemNames.add("0"); - fields.add( new UAVObjectField("baro_var", "m^2", UAVObjectField.FieldType.FLOAT32, baro_varElemNames, null) ); - - List MagBiasNullingRateElemNames = new ArrayList(); - MagBiasNullingRateElemNames.add("0"); - fields.add( new UAVObjectField("MagBiasNullingRate", "", UAVObjectField.FieldType.FLOAT32, MagBiasNullingRateElemNames, null) ); - - List BiasCorrectedRawElemNames = new ArrayList(); - BiasCorrectedRawElemNames.add("0"); - List BiasCorrectedRawEnumOptions = new ArrayList(); - BiasCorrectedRawEnumOptions.add("FALSE"); - BiasCorrectedRawEnumOptions.add("TRUE"); - fields.add( new UAVObjectField("BiasCorrectedRaw", "", UAVObjectField.FieldType.ENUM, BiasCorrectedRawElemNames, BiasCorrectedRawEnumOptions) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 1 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 0; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 0; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - getField("accel_bias").setValue(0,0); - getField("accel_bias").setValue(0,1); - getField("accel_bias").setValue(0,2); - getField("accel_scale").setValue(1,0); - getField("accel_scale").setValue(1,1); - getField("accel_scale").setValue(1,2); - getField("accel_var").setValue(0.01,0); - getField("accel_var").setValue(0.01,1); - getField("accel_var").setValue(0.01,2); - getField("gyro_bias").setValue(0,0); - getField("gyro_bias").setValue(0,1); - getField("gyro_bias").setValue(0,2); - getField("gyro_scale").setValue(1,0); - getField("gyro_scale").setValue(1,1); - getField("gyro_scale").setValue(1,2); - getField("gyro_var").setValue(0.01,0); - getField("gyro_var").setValue(0.01,1); - getField("gyro_var").setValue(0.01,2); - getField("gyro_tempcoeff").setValue(1,0); - getField("gyro_tempcoeff").setValue(1,1); - getField("gyro_tempcoeff").setValue(1,2); - getField("mag_bias").setValue(0,0); - getField("mag_bias").setValue(0,1); - getField("mag_bias").setValue(0,2); - getField("mag_scale").setValue(1,0); - getField("mag_scale").setValue(1,1); - getField("mag_scale").setValue(1,2); - getField("mag_var").setValue(0.01,0); - getField("mag_var").setValue(0.01,1); - getField("mag_var").setValue(10,2); - getField("gps_var").setValue(1,0); - getField("gps_var").setValue(1,1); - getField("baro_var").setValue(1); - getField("MagBiasNullingRate").setValue(0); - getField("BiasCorrectedRaw").setValue("TRUE"); - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - RevoCalibration obj = new RevoCalibration(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public RevoCalibration GetInstance(UAVObjectManager objMngr, long instID) - { - return (RevoCalibration)(objMngr.getObject(RevoCalibration.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0xA2A63C7Cl; - protected static final String NAME = "RevoCalibration"; - protected static String DESCRIPTION = "Settings for the INS to control the algorithm and what is updated"; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 1 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/RevoSettings.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/RevoSettings.java deleted file mode 100644 index 0147f72c1..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/RevoSettings.java +++ /dev/null @@ -1,143 +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 revo to control the algorithm and what is updated - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -Settings for the revo to control the algorithm and what is updated - -generated from revosettings.xml - **/ -public class RevoSettings extends UAVDataObject { - - public RevoSettings() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List FusionAlgorithmElemNames = new ArrayList(); - FusionAlgorithmElemNames.add("0"); - List FusionAlgorithmEnumOptions = new ArrayList(); - FusionAlgorithmEnumOptions.add("Complimentary"); - FusionAlgorithmEnumOptions.add("INSIndoor"); - FusionAlgorithmEnumOptions.add("INSOutdoor"); - fields.add( new UAVObjectField("FusionAlgorithm", "", UAVObjectField.FieldType.ENUM, FusionAlgorithmElemNames, FusionAlgorithmEnumOptions) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 1 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 0; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 0; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - getField("FusionAlgorithm").setValue("Complimentary"); - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - RevoSettings obj = new RevoSettings(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public RevoSettings GetInstance(UAVObjectManager objMngr, long instID) - { - return (RevoSettings)(objMngr.getObject(RevoSettings.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0xE2DA70EAl; - protected static final String NAME = "RevoSettings"; - protected static String DESCRIPTION = "Settings for the revo to control the algorithm and what is updated"; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 1 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/SonarAltitude.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/SonarAltitude.java deleted file mode 100644 index 00a711775..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/SonarAltitude.java +++ /dev/null @@ -1,138 +0,0 @@ -/** - ****************************************************************************** - * - * @file uavobjecttemplate.cpp - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * @brief Template for an uavobject in java - * This is a autogenerated file!! Do not modify and expect a result. - * The raw data from the ultrasound sonar sensor with altitude estimate. - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -The raw data from the ultrasound sonar sensor with altitude estimate. - -generated from sonaraltitude.xml - **/ -public class SonarAltitude extends UAVDataObject { - - public SonarAltitude() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List AltitudeElemNames = new ArrayList(); - AltitudeElemNames.add("0"); - fields.add( new UAVObjectField("Altitude", "m", UAVObjectField.FieldType.FLOAT32, AltitudeElemNames, null) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 0 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 1000; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 0; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - SonarAltitude obj = new SonarAltitude(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public SonarAltitude GetInstance(UAVObjectManager objMngr, long instID) - { - return (SonarAltitude)(objMngr.getObject(SonarAltitude.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x6C5A0CBCl; - protected static final String NAME = "SonarAltitude"; - protected static String DESCRIPTION = "The raw data from the ultrasound sonar sensor with altitude estimate."; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/StabilizationDesired.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/StabilizationDesired.java deleted file mode 100644 index 31ca2e901..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/StabilizationDesired.java +++ /dev/null @@ -1,165 +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 desired attitude that @ref StabilizationModule will try and achieve if FlightMode is Stabilized. Comes from @ref ManaulControlModule. - * - * @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 desired attitude that @ref StabilizationModule will try and achieve if FlightMode is Stabilized. Comes from @ref ManaulControlModule. - -generated from stabilizationdesired.xml - **/ -public class StabilizationDesired extends UAVDataObject { - - public StabilizationDesired() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List RollElemNames = new ArrayList(); - RollElemNames.add("0"); - fields.add( new UAVObjectField("Roll", "degrees", UAVObjectField.FieldType.FLOAT32, RollElemNames, null) ); - - List PitchElemNames = new ArrayList(); - PitchElemNames.add("0"); - fields.add( new UAVObjectField("Pitch", "degrees", UAVObjectField.FieldType.FLOAT32, PitchElemNames, null) ); - - List YawElemNames = new ArrayList(); - YawElemNames.add("0"); - fields.add( new UAVObjectField("Yaw", "degrees", UAVObjectField.FieldType.FLOAT32, YawElemNames, null) ); - - List ThrottleElemNames = new ArrayList(); - ThrottleElemNames.add("0"); - fields.add( new UAVObjectField("Throttle", "%", UAVObjectField.FieldType.FLOAT32, ThrottleElemNames, null) ); - - List StabilizationModeElemNames = new ArrayList(); - StabilizationModeElemNames.add("Roll"); - StabilizationModeElemNames.add("Pitch"); - StabilizationModeElemNames.add("Yaw"); - List StabilizationModeEnumOptions = new ArrayList(); - StabilizationModeEnumOptions.add("None"); - StabilizationModeEnumOptions.add("Rate"); - StabilizationModeEnumOptions.add("Attitude"); - StabilizationModeEnumOptions.add("AxisLock"); - StabilizationModeEnumOptions.add("WeakLeveling"); - StabilizationModeEnumOptions.add("VirtualBar"); - StabilizationModeEnumOptions.add("RelayRate"); - StabilizationModeEnumOptions.add("RelayAttitude"); - fields.add( new UAVObjectField("StabilizationMode", "", UAVObjectField.FieldType.ENUM, StabilizationModeElemNames, StabilizationModeEnumOptions) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 0 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 1000; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 0; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - StabilizationDesired obj = new StabilizationDesired(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public StabilizationDesired GetInstance(UAVObjectManager objMngr, long instID) - { - return (StabilizationDesired)(objMngr.getObject(StabilizationDesired.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x4FDBFEEAl; - 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 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/StabilizationSettings.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/StabilizationSettings.java deleted file mode 100644 index 99cfcd830..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/StabilizationSettings.java +++ /dev/null @@ -1,323 +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. - * PID settings used by the Stabilization module to combine the @ref AttitudeActual and @ref AttitudeDesired to compute @ref ActuatorDesired - * - * @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; - -/** -PID settings used by the Stabilization module to combine the @ref AttitudeActual and @ref AttitudeDesired to compute @ref ActuatorDesired - -generated from stabilizationsettings.xml - **/ -public class StabilizationSettings extends UAVDataObject { - - public StabilizationSettings() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List ManualRateElemNames = new ArrayList(); - ManualRateElemNames.add("Roll"); - ManualRateElemNames.add("Pitch"); - ManualRateElemNames.add("Yaw"); - fields.add( new UAVObjectField("ManualRate", "degrees/sec", UAVObjectField.FieldType.FLOAT32, ManualRateElemNames, null) ); - - List MaximumRateElemNames = new ArrayList(); - MaximumRateElemNames.add("Roll"); - MaximumRateElemNames.add("Pitch"); - MaximumRateElemNames.add("Yaw"); - fields.add( new UAVObjectField("MaximumRate", "degrees/sec", UAVObjectField.FieldType.FLOAT32, MaximumRateElemNames, null) ); - - List RollRatePIDElemNames = new ArrayList(); - RollRatePIDElemNames.add("Kp"); - RollRatePIDElemNames.add("Ki"); - RollRatePIDElemNames.add("Kd"); - RollRatePIDElemNames.add("ILimit"); - fields.add( new UAVObjectField("RollRatePID", "", UAVObjectField.FieldType.FLOAT32, RollRatePIDElemNames, null) ); - - List PitchRatePIDElemNames = new ArrayList(); - PitchRatePIDElemNames.add("Kp"); - PitchRatePIDElemNames.add("Ki"); - PitchRatePIDElemNames.add("Kd"); - PitchRatePIDElemNames.add("ILimit"); - fields.add( new UAVObjectField("PitchRatePID", "", UAVObjectField.FieldType.FLOAT32, PitchRatePIDElemNames, null) ); - - List YawRatePIDElemNames = new ArrayList(); - YawRatePIDElemNames.add("Kp"); - YawRatePIDElemNames.add("Ki"); - YawRatePIDElemNames.add("Kd"); - YawRatePIDElemNames.add("ILimit"); - fields.add( new UAVObjectField("YawRatePID", "", UAVObjectField.FieldType.FLOAT32, YawRatePIDElemNames, null) ); - - List RollPIElemNames = new ArrayList(); - RollPIElemNames.add("Kp"); - RollPIElemNames.add("Ki"); - RollPIElemNames.add("ILimit"); - fields.add( new UAVObjectField("RollPI", "", UAVObjectField.FieldType.FLOAT32, RollPIElemNames, null) ); - - List PitchPIElemNames = new ArrayList(); - PitchPIElemNames.add("Kp"); - PitchPIElemNames.add("Ki"); - PitchPIElemNames.add("ILimit"); - fields.add( new UAVObjectField("PitchPI", "", UAVObjectField.FieldType.FLOAT32, PitchPIElemNames, null) ); - - List YawPIElemNames = new ArrayList(); - YawPIElemNames.add("Kp"); - YawPIElemNames.add("Ki"); - YawPIElemNames.add("ILimit"); - fields.add( new UAVObjectField("YawPI", "", UAVObjectField.FieldType.FLOAT32, YawPIElemNames, null) ); - - List VbarSensitivityElemNames = new ArrayList(); - VbarSensitivityElemNames.add("Roll"); - VbarSensitivityElemNames.add("Pitch"); - VbarSensitivityElemNames.add("Yaw"); - fields.add( new UAVObjectField("VbarSensitivity", "frac", UAVObjectField.FieldType.FLOAT32, VbarSensitivityElemNames, null) ); - - List VbarRollPIElemNames = new ArrayList(); - VbarRollPIElemNames.add("Kp"); - VbarRollPIElemNames.add("Ki"); - fields.add( new UAVObjectField("VbarRollPI", "1/(deg/s)", UAVObjectField.FieldType.FLOAT32, VbarRollPIElemNames, null) ); - - List VbarPitchPIElemNames = new ArrayList(); - VbarPitchPIElemNames.add("Kp"); - VbarPitchPIElemNames.add("Ki"); - fields.add( new UAVObjectField("VbarPitchPI", "1/(deg/s)", UAVObjectField.FieldType.FLOAT32, VbarPitchPIElemNames, null) ); - - List VbarYawPIElemNames = new ArrayList(); - VbarYawPIElemNames.add("Kp"); - VbarYawPIElemNames.add("Ki"); - fields.add( new UAVObjectField("VbarYawPI", "1/(deg/s)", UAVObjectField.FieldType.FLOAT32, VbarYawPIElemNames, null) ); - - List VbarTauElemNames = new ArrayList(); - VbarTauElemNames.add("0"); - fields.add( new UAVObjectField("VbarTau", "sec", UAVObjectField.FieldType.FLOAT32, VbarTauElemNames, null) ); - - List GyroTauElemNames = new ArrayList(); - GyroTauElemNames.add("0"); - fields.add( new UAVObjectField("GyroTau", "", UAVObjectField.FieldType.FLOAT32, GyroTauElemNames, null) ); - - List DerivativeGammaElemNames = new ArrayList(); - DerivativeGammaElemNames.add("0"); - fields.add( new UAVObjectField("DerivativeGamma", "", UAVObjectField.FieldType.FLOAT32, DerivativeGammaElemNames, null) ); - - List WeakLevelingKpElemNames = new ArrayList(); - WeakLevelingKpElemNames.add("0"); - fields.add( new UAVObjectField("WeakLevelingKp", "(deg/s)/deg", UAVObjectField.FieldType.FLOAT32, WeakLevelingKpElemNames, null) ); - - List RollMaxElemNames = new ArrayList(); - RollMaxElemNames.add("0"); - fields.add( new UAVObjectField("RollMax", "degrees", UAVObjectField.FieldType.UINT8, RollMaxElemNames, null) ); - - List PitchMaxElemNames = new ArrayList(); - PitchMaxElemNames.add("0"); - fields.add( new UAVObjectField("PitchMax", "degrees", UAVObjectField.FieldType.UINT8, PitchMaxElemNames, null) ); - - List YawMaxElemNames = new ArrayList(); - YawMaxElemNames.add("0"); - fields.add( new UAVObjectField("YawMax", "degrees", UAVObjectField.FieldType.UINT8, YawMaxElemNames, null) ); - - List VbarGyroSuppressElemNames = new ArrayList(); - VbarGyroSuppressElemNames.add("0"); - fields.add( new UAVObjectField("VbarGyroSuppress", "%", UAVObjectField.FieldType.INT8, VbarGyroSuppressElemNames, null) ); - - List VbarPiroCompElemNames = new ArrayList(); - VbarPiroCompElemNames.add("0"); - List VbarPiroCompEnumOptions = new ArrayList(); - VbarPiroCompEnumOptions.add("FALSE"); - VbarPiroCompEnumOptions.add("TRUE"); - fields.add( new UAVObjectField("VbarPiroComp", "", UAVObjectField.FieldType.ENUM, VbarPiroCompElemNames, VbarPiroCompEnumOptions) ); - - List VbarMaxAngleElemNames = new ArrayList(); - VbarMaxAngleElemNames.add("0"); - fields.add( new UAVObjectField("VbarMaxAngle", "deg", UAVObjectField.FieldType.UINT8, VbarMaxAngleElemNames, null) ); - - List DerivativeCutoffElemNames = new ArrayList(); - DerivativeCutoffElemNames.add("0"); - fields.add( new UAVObjectField("DerivativeCutoff", "Hz", UAVObjectField.FieldType.UINT8, DerivativeCutoffElemNames, null) ); - - List MaxAxisLockElemNames = new ArrayList(); - MaxAxisLockElemNames.add("0"); - fields.add( new UAVObjectField("MaxAxisLock", "deg", UAVObjectField.FieldType.UINT8, MaxAxisLockElemNames, null) ); - - List MaxAxisLockRateElemNames = new ArrayList(); - MaxAxisLockRateElemNames.add("0"); - fields.add( new UAVObjectField("MaxAxisLockRate", "deg/s", UAVObjectField.FieldType.UINT8, MaxAxisLockRateElemNames, null) ); - - List MaxWeakLevelingRateElemNames = new ArrayList(); - MaxWeakLevelingRateElemNames.add("0"); - fields.add( new UAVObjectField("MaxWeakLevelingRate", "deg/s", UAVObjectField.FieldType.UINT8, MaxWeakLevelingRateElemNames, null) ); - - List LowThrottleZeroIntegralElemNames = new ArrayList(); - LowThrottleZeroIntegralElemNames.add("0"); - List LowThrottleZeroIntegralEnumOptions = new ArrayList(); - LowThrottleZeroIntegralEnumOptions.add("FALSE"); - LowThrottleZeroIntegralEnumOptions.add("TRUE"); - fields.add( new UAVObjectField("LowThrottleZeroIntegral", "", UAVObjectField.FieldType.ENUM, LowThrottleZeroIntegralElemNames, LowThrottleZeroIntegralEnumOptions) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 1 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 0; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 0; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - getField("ManualRate").setValue(150,0); - getField("ManualRate").setValue(150,1); - getField("ManualRate").setValue(150,2); - getField("MaximumRate").setValue(300,0); - getField("MaximumRate").setValue(300,1); - getField("MaximumRate").setValue(300,2); - getField("RollRatePID").setValue(0.002,0); - getField("RollRatePID").setValue(0,1); - getField("RollRatePID").setValue(0,2); - getField("RollRatePID").setValue(0.3,3); - getField("PitchRatePID").setValue(0.002,0); - getField("PitchRatePID").setValue(0,1); - getField("PitchRatePID").setValue(0,2); - getField("PitchRatePID").setValue(0.3,3); - getField("YawRatePID").setValue(0.0035,0); - getField("YawRatePID").setValue(0.0035,1); - getField("YawRatePID").setValue(0,2); - getField("YawRatePID").setValue(0.3,3); - getField("RollPI").setValue(2,0); - getField("RollPI").setValue(0,1); - getField("RollPI").setValue(50,2); - getField("PitchPI").setValue(2,0); - getField("PitchPI").setValue(0,1); - getField("PitchPI").setValue(50,2); - 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("DerivativeGamma").setValue(1); - 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("DerivativeCutoff").setValue(20); - getField("MaxAxisLock").setValue(15); - getField("MaxAxisLockRate").setValue(2); - getField("MaxWeakLevelingRate").setValue(5); - getField("LowThrottleZeroIntegral").setValue("TRUE"); - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - StabilizationSettings obj = new StabilizationSettings(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public StabilizationSettings GetInstance(UAVObjectManager objMngr, long instID) - { - return (StabilizationSettings)(objMngr.getObject(StabilizationSettings.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x3D03DE86l; - 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 > 0; - protected static final boolean ISSETTINGS = 1 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/SystemAlarms.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/SystemAlarms.java deleted file mode 100644 index 11d4bc4d5..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/SystemAlarms.java +++ /dev/null @@ -1,177 +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. - * Alarms from OpenPilot to indicate failure conditions or warnings. Set by various modules. - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -Alarms from OpenPilot to indicate failure conditions or warnings. Set by various modules. - -generated from systemalarms.xml - **/ -public class SystemAlarms extends UAVDataObject { - - public SystemAlarms() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List AlarmElemNames = new ArrayList(); - AlarmElemNames.add("OutOfMemory"); - AlarmElemNames.add("StackOverflow"); - AlarmElemNames.add("CPUOverload"); - AlarmElemNames.add("EventSystem"); - AlarmElemNames.add("Telemetry"); - AlarmElemNames.add("ManualControl"); - AlarmElemNames.add("Actuator"); - AlarmElemNames.add("Attitude"); - AlarmElemNames.add("Sensors"); - AlarmElemNames.add("Stabilization"); - AlarmElemNames.add("Guidance"); - AlarmElemNames.add("Battery"); - AlarmElemNames.add("FlightTime"); - AlarmElemNames.add("I2C"); - AlarmElemNames.add("GPS"); - AlarmElemNames.add("BootFault"); - AlarmElemNames.add("Power"); - List AlarmEnumOptions = new ArrayList(); - AlarmEnumOptions.add("Uninitialised"); - AlarmEnumOptions.add("OK"); - AlarmEnumOptions.add("Warning"); - AlarmEnumOptions.add("Error"); - AlarmEnumOptions.add("Critical"); - fields.add( new UAVObjectField("Alarm", "", UAVObjectField.FieldType.ENUM, AlarmElemNames, AlarmEnumOptions) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.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; - } - - /** - * 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("Alarm").setValue("Uninitialised",0); - getField("Alarm").setValue("Uninitialised",1); - getField("Alarm").setValue("Uninitialised",2); - getField("Alarm").setValue("Uninitialised",3); - getField("Alarm").setValue("Uninitialised",4); - getField("Alarm").setValue("Uninitialised",5); - getField("Alarm").setValue("Uninitialised",6); - getField("Alarm").setValue("Uninitialised",7); - getField("Alarm").setValue("Uninitialised",8); - getField("Alarm").setValue("Uninitialised",9); - getField("Alarm").setValue("Uninitialised",10); - getField("Alarm").setValue("Uninitialised",11); - getField("Alarm").setValue("Uninitialised",12); - getField("Alarm").setValue("Uninitialised",13); - getField("Alarm").setValue("Uninitialised",14); - getField("Alarm").setValue("Uninitialised",15); - getField("Alarm").setValue("Uninitialised",16); - - } - - /** - * 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(long instID) { - // TODO: Need to get specific instance to clone - try { - SystemAlarms obj = new SystemAlarms(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public SystemAlarms GetInstance(UAVObjectManager objMngr, long instID) - { - return (SystemAlarms)(objMngr.getObject(SystemAlarms.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x737ADCF2l; - 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 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/SystemSettings.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/SystemSettings.java deleted file mode 100644 index aa4fad376..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/SystemSettings.java +++ /dev/null @@ -1,170 +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. - * Select airframe type. Currently used by @ref ActuatorModule to choose mixing from @ref ActuatorDesired to @ref ActuatorCommand - * - * @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; - -/** -Select airframe type. Currently used by @ref ActuatorModule to choose mixing from @ref ActuatorDesired to @ref ActuatorCommand - -generated from systemsettings.xml - **/ -public class SystemSettings extends UAVDataObject { - - public SystemSettings() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List GUIConfigDataElemNames = new ArrayList(); - GUIConfigDataElemNames.add("0"); - GUIConfigDataElemNames.add("1"); - GUIConfigDataElemNames.add("2"); - GUIConfigDataElemNames.add("3"); - fields.add( new UAVObjectField("GUIConfigData", "bits", UAVObjectField.FieldType.UINT32, GUIConfigDataElemNames, null) ); - - List AirframeTypeElemNames = new ArrayList(); - AirframeTypeElemNames.add("0"); - List AirframeTypeEnumOptions = new ArrayList(); - AirframeTypeEnumOptions.add("FixedWing"); - AirframeTypeEnumOptions.add("FixedWingElevon"); - AirframeTypeEnumOptions.add("FixedWingVtail"); - AirframeTypeEnumOptions.add("VTOL"); - AirframeTypeEnumOptions.add("HeliCP"); - AirframeTypeEnumOptions.add("QuadX"); - AirframeTypeEnumOptions.add("QuadP"); - AirframeTypeEnumOptions.add("Hexa"); - AirframeTypeEnumOptions.add("Octo"); - AirframeTypeEnumOptions.add("Custom"); - AirframeTypeEnumOptions.add("HexaX"); - AirframeTypeEnumOptions.add("OctoV"); - AirframeTypeEnumOptions.add("OctoCoaxP"); - 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) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 1 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 0; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 0; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - getField("GUIConfigData").setValue(0,0); - getField("GUIConfigData").setValue(0,1); - getField("GUIConfigData").setValue(0,2); - getField("GUIConfigData").setValue(0,3); - getField("AirframeType").setValue("QuadX"); - - } - - /** - * 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(long instID) { - // TODO: Need to get specific instance to clone - try { - SystemSettings obj = new SystemSettings(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public SystemSettings GetInstance(UAVObjectManager objMngr, long instID) - { - return (SystemSettings)(objMngr.getObject(SystemSettings.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0xC72A326El; - 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 > 0; - protected static final boolean ISSETTINGS = 1 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/SystemStats.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/SystemStats.java deleted file mode 100644 index 113bc8c25..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/SystemStats.java +++ /dev/null @@ -1,166 +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. - * CPU and memory usage from OpenPilot computer. - * - * @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; - -/** -CPU and memory usage from OpenPilot computer. - -generated from systemstats.xml - **/ -public class SystemStats extends UAVDataObject { - - public SystemStats() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List FlightTimeElemNames = new ArrayList(); - FlightTimeElemNames.add("0"); - fields.add( new UAVObjectField("FlightTime", "ms", UAVObjectField.FieldType.UINT32, FlightTimeElemNames, null) ); - - List EventSystemWarningIDElemNames = new ArrayList(); - EventSystemWarningIDElemNames.add("0"); - fields.add( new UAVObjectField("EventSystemWarningID", "uavoid", UAVObjectField.FieldType.UINT32, EventSystemWarningIDElemNames, null) ); - - List ObjectManagerCallbackIDElemNames = new ArrayList(); - ObjectManagerCallbackIDElemNames.add("0"); - fields.add( new UAVObjectField("ObjectManagerCallbackID", "uavoid", UAVObjectField.FieldType.UINT32, ObjectManagerCallbackIDElemNames, null) ); - - List ObjectManagerQueueIDElemNames = new ArrayList(); - ObjectManagerQueueIDElemNames.add("0"); - fields.add( new UAVObjectField("ObjectManagerQueueID", "uavoid", UAVObjectField.FieldType.UINT32, ObjectManagerQueueIDElemNames, null) ); - - List HeapRemainingElemNames = new ArrayList(); - HeapRemainingElemNames.add("0"); - fields.add( new UAVObjectField("HeapRemaining", "bytes", UAVObjectField.FieldType.UINT16, HeapRemainingElemNames, null) ); - - List IRQStackRemainingElemNames = new ArrayList(); - IRQStackRemainingElemNames.add("0"); - fields.add( new UAVObjectField("IRQStackRemaining", "bytes", UAVObjectField.FieldType.UINT16, IRQStackRemainingElemNames, null) ); - - List CPULoadElemNames = new ArrayList(); - CPULoadElemNames.add("0"); - fields.add( new UAVObjectField("CPULoad", "%", UAVObjectField.FieldType.UINT8, CPULoadElemNames, null) ); - - List CPUTempElemNames = new ArrayList(); - CPUTempElemNames.add("0"); - fields.add( new UAVObjectField("CPUTemp", "C", UAVObjectField.FieldType.INT8, CPUTempElemNames, null) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 0 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 1000; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 1000; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - SystemStats obj = new SystemStats(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public SystemStats GetInstance(UAVObjectManager objMngr, long instID) - { - return (SystemStats)(objMngr.getObject(SystemStats.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x364D1406l; - protected static final String NAME = "SystemStats"; - protected static String DESCRIPTION = "CPU and memory usage from OpenPilot computer. "; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/TaskInfo.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/TaskInfo.java deleted file mode 100644 index c101adb77..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/TaskInfo.java +++ /dev/null @@ -1,218 +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. - * Task information - * - * @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; - -/** -Task information - -generated from taskinfo.xml - **/ -public class TaskInfo extends UAVDataObject { - - public TaskInfo() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List StackRemainingElemNames = new ArrayList(); - StackRemainingElemNames.add("System"); - StackRemainingElemNames.add("Actuator"); - StackRemainingElemNames.add("Attitude"); - StackRemainingElemNames.add("Sensors"); - StackRemainingElemNames.add("TelemetryTx"); - StackRemainingElemNames.add("TelemetryTxPri"); - StackRemainingElemNames.add("TelemetryRx"); - StackRemainingElemNames.add("GPS"); - StackRemainingElemNames.add("ManualControl"); - StackRemainingElemNames.add("Altitude"); - StackRemainingElemNames.add("Airspeed"); - StackRemainingElemNames.add("Stabilization"); - StackRemainingElemNames.add("AltitudeHold"); - StackRemainingElemNames.add("PathPlanner"); - StackRemainingElemNames.add("PathFollower"); - StackRemainingElemNames.add("FlightPlan"); - StackRemainingElemNames.add("Com2UsbBridge"); - StackRemainingElemNames.add("Usb2ComBridge"); - StackRemainingElemNames.add("OveroSync"); - StackRemainingElemNames.add("ModemRx"); - StackRemainingElemNames.add("ModemTx"); - StackRemainingElemNames.add("ModemStat"); - StackRemainingElemNames.add("Autotune"); - StackRemainingElemNames.add("EventDispatcher"); - fields.add( new UAVObjectField("StackRemaining", "bytes", UAVObjectField.FieldType.UINT16, StackRemainingElemNames, null) ); - - List RunningElemNames = new ArrayList(); - RunningElemNames.add("System"); - RunningElemNames.add("Actuator"); - RunningElemNames.add("Attitude"); - RunningElemNames.add("Sensors"); - RunningElemNames.add("TelemetryTx"); - RunningElemNames.add("TelemetryTxPri"); - RunningElemNames.add("TelemetryRx"); - RunningElemNames.add("GPS"); - RunningElemNames.add("ManualControl"); - RunningElemNames.add("Altitude"); - RunningElemNames.add("Airspeed"); - RunningElemNames.add("Stabilization"); - RunningElemNames.add("AltitudeHold"); - RunningElemNames.add("PathPlanner"); - RunningElemNames.add("PathFollower"); - RunningElemNames.add("FlightPlan"); - RunningElemNames.add("Com2UsbBridge"); - RunningElemNames.add("Usb2ComBridge"); - RunningElemNames.add("OveroSync"); - RunningElemNames.add("ModemRx"); - RunningElemNames.add("ModemTx"); - RunningElemNames.add("ModemStat"); - RunningElemNames.add("Autotune"); - RunningElemNames.add("EventDispatcher"); - List RunningEnumOptions = new ArrayList(); - RunningEnumOptions.add("False"); - RunningEnumOptions.add("True"); - fields.add( new UAVObjectField("Running", "bool", UAVObjectField.FieldType.ENUM, RunningElemNames, RunningEnumOptions) ); - - List RunningTimeElemNames = new ArrayList(); - RunningTimeElemNames.add("System"); - RunningTimeElemNames.add("Actuator"); - RunningTimeElemNames.add("Attitude"); - RunningTimeElemNames.add("Sensors"); - RunningTimeElemNames.add("TelemetryTx"); - RunningTimeElemNames.add("TelemetryTxPri"); - RunningTimeElemNames.add("TelemetryRx"); - RunningTimeElemNames.add("GPS"); - RunningTimeElemNames.add("ManualControl"); - RunningTimeElemNames.add("Altitude"); - RunningTimeElemNames.add("Airspeed"); - RunningTimeElemNames.add("Stabilization"); - RunningTimeElemNames.add("AltitudeHold"); - RunningTimeElemNames.add("PathPlanner"); - RunningTimeElemNames.add("PathFollower"); - RunningTimeElemNames.add("FlightPlan"); - RunningTimeElemNames.add("Com2UsbBridge"); - RunningTimeElemNames.add("Usb2ComBridge"); - RunningTimeElemNames.add("OveroSync"); - RunningTimeElemNames.add("ModemRx"); - RunningTimeElemNames.add("ModemTx"); - RunningTimeElemNames.add("ModemStat"); - RunningTimeElemNames.add("Autotune"); - RunningTimeElemNames.add("EventDispatcher"); - fields.add( new UAVObjectField("RunningTime", "%", UAVObjectField.FieldType.UINT8, RunningTimeElemNames, null) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.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; - } - - /** - * 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(long instID) { - // TODO: Need to get specific instance to clone - try { - TaskInfo obj = new TaskInfo(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public TaskInfo GetInstance(UAVObjectManager objMngr, long instID) - { - return (TaskInfo)(objMngr.getObject(TaskInfo.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x21BD254Al; - protected static final String NAME = "TaskInfo"; - protected static String DESCRIPTION = "Task information"; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/TelemObjectsInitialize.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/TelemObjectsInitialize.java new file mode 100644 index 000000000..f177cf3ef --- /dev/null +++ b/androidgcs/src/org/openpilot/uavtalk/uavobjects/TelemObjectsInitialize.java @@ -0,0 +1,44 @@ +/** + ****************************************************************************** + * + * + * @file uavobjectsinittemplate.java + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. + * @brief the template for the uavobjects init part + * $(GENERATEDWARNING) + * + * @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 org.openpilot.uavtalk.UAVObjectManager; + +public class TelemObjectsInitialize { + + public static void register(UAVObjectManager objMngr) { + try { + objMngr.registerObject( new FirmwareIAPObj() ); + objMngr.registerObject( new FlightTelemetryStats() ); + objMngr.registerObject( new GCSTelemetryStats() ); + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/TxPIDSettings.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/TxPIDSettings.java deleted file mode 100644 index 3f2264bf5..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/TxPIDSettings.java +++ /dev/null @@ -1,225 +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 used by @ref TxPID optional module to tune PID settings using R/C transmitter - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -Settings used by @ref TxPID optional module to tune PID settings using R/C transmitter - -generated from txpidsettings.xml - **/ -public class TxPIDSettings extends UAVDataObject { - - public TxPIDSettings() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List ThrottleRangeElemNames = new ArrayList(); - ThrottleRangeElemNames.add("Min"); - ThrottleRangeElemNames.add("Max"); - fields.add( new UAVObjectField("ThrottleRange", "%", UAVObjectField.FieldType.FLOAT32, ThrottleRangeElemNames, null) ); - - List MinPIDElemNames = new ArrayList(); - MinPIDElemNames.add("Instance1"); - MinPIDElemNames.add("Instance2"); - MinPIDElemNames.add("Instance3"); - fields.add( new UAVObjectField("MinPID", "", UAVObjectField.FieldType.FLOAT32, MinPIDElemNames, null) ); - - List MaxPIDElemNames = new ArrayList(); - MaxPIDElemNames.add("Instance1"); - MaxPIDElemNames.add("Instance2"); - MaxPIDElemNames.add("Instance3"); - fields.add( new UAVObjectField("MaxPID", "", UAVObjectField.FieldType.FLOAT32, MaxPIDElemNames, null) ); - - List UpdateModeElemNames = new ArrayList(); - UpdateModeElemNames.add("0"); - List UpdateModeEnumOptions = new ArrayList(); - UpdateModeEnumOptions.add("Never"); - UpdateModeEnumOptions.add("When Armed"); - UpdateModeEnumOptions.add("Always"); - fields.add( new UAVObjectField("UpdateMode", "option", UAVObjectField.FieldType.ENUM, UpdateModeElemNames, UpdateModeEnumOptions) ); - - List InputsElemNames = new ArrayList(); - InputsElemNames.add("Instance1"); - InputsElemNames.add("Instance2"); - InputsElemNames.add("Instance3"); - List InputsEnumOptions = new ArrayList(); - InputsEnumOptions.add("Throttle"); - InputsEnumOptions.add("Accessory0"); - InputsEnumOptions.add("Accessory1"); - InputsEnumOptions.add("Accessory2"); - InputsEnumOptions.add("Accessory3"); - InputsEnumOptions.add("Accessory4"); - InputsEnumOptions.add("Accessory5"); - fields.add( new UAVObjectField("Inputs", "channel", UAVObjectField.FieldType.ENUM, InputsElemNames, InputsEnumOptions) ); - - List PIDsElemNames = new ArrayList(); - PIDsElemNames.add("Instance1"); - PIDsElemNames.add("Instance2"); - PIDsElemNames.add("Instance3"); - List PIDsEnumOptions = new ArrayList(); - PIDsEnumOptions.add("Disabled"); - PIDsEnumOptions.add("Roll Rate.Kp"); - PIDsEnumOptions.add("Pitch Rate.Kp"); - PIDsEnumOptions.add("Roll+Pitch Rate.Kp"); - PIDsEnumOptions.add("Yaw Rate.Kp"); - PIDsEnumOptions.add("Roll Rate.Ki"); - PIDsEnumOptions.add("Pitch Rate.Ki"); - PIDsEnumOptions.add("Roll+Pitch Rate.Ki"); - PIDsEnumOptions.add("Yaw Rate.Ki"); - PIDsEnumOptions.add("Roll Rate.Kd"); - PIDsEnumOptions.add("Pitch Rate.Kd"); - PIDsEnumOptions.add("Roll+Pitch Rate.Kd"); - PIDsEnumOptions.add("Yaw Rate.Kd"); - PIDsEnumOptions.add("Roll Rate.ILimit"); - PIDsEnumOptions.add("Pitch Rate.ILimit"); - PIDsEnumOptions.add("Roll+Pitch Rate.ILimit"); - PIDsEnumOptions.add("Yaw Rate.ILimit"); - PIDsEnumOptions.add("Roll Attitude.Kp"); - PIDsEnumOptions.add("Pitch Attitude.Kp"); - PIDsEnumOptions.add("Roll+Pitch Attitude.Kp"); - PIDsEnumOptions.add("Yaw Attitude.Kp"); - PIDsEnumOptions.add("Roll Attitude.Ki"); - PIDsEnumOptions.add("Pitch Attitude.Ki"); - PIDsEnumOptions.add("Roll+Pitch Attitude.Ki"); - PIDsEnumOptions.add("Yaw Attitude.Ki"); - PIDsEnumOptions.add("Roll Attitude.ILimit"); - PIDsEnumOptions.add("Pitch Attitude.ILimit"); - PIDsEnumOptions.add("Roll+Pitch Attitude.ILimit"); - PIDsEnumOptions.add("Yaw Attitude.ILimit"); - PIDsEnumOptions.add("GyroTau"); - fields.add( new UAVObjectField("PIDs", "option", UAVObjectField.FieldType.ENUM, PIDsElemNames, PIDsEnumOptions) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 1 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 0; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 0; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - getField("ThrottleRange").setValue(0.2,0); - getField("ThrottleRange").setValue(0.8,1); - getField("MinPID").setValue(0,0); - getField("MinPID").setValue(0,1); - getField("MinPID").setValue(0,2); - getField("MaxPID").setValue(0,0); - getField("MaxPID").setValue(0,1); - getField("MaxPID").setValue(0,2); - getField("UpdateMode").setValue("When Armed"); - getField("Inputs").setValue("Throttle",0); - getField("Inputs").setValue("Accessory0",1); - getField("Inputs").setValue("Accessory1",2); - getField("PIDs").setValue("Disabled",0); - getField("PIDs").setValue("Disabled",1); - getField("PIDs").setValue("Disabled",2); - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - TxPIDSettings obj = new TxPIDSettings(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public TxPIDSettings GetInstance(UAVObjectManager objMngr, long instID) - { - return (TxPIDSettings)(objMngr.getObject(TxPIDSettings.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x42B2D2AEl; - protected static final String NAME = "TxPIDSettings"; - protected static String DESCRIPTION = "Settings used by @ref TxPID optional module to tune PID settings using R/C transmitter"; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 1 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/UAVObjectsInitialize.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/UAVObjectsInitialize.java deleted file mode 100644 index 55b7ff88f..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/UAVObjectsInitialize.java +++ /dev/null @@ -1,117 +0,0 @@ -/** - ****************************************************************************** - * - * - * @file uavobjectsinittemplate.java - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * @brief the template for the uavobjects init part - * $(GENERATEDWARNING) - * - * @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 org.openpilot.uavtalk.UAVObjectManager; - -public class UAVObjectsInitialize { - - public static void register(UAVObjectManager objMngr) { - try { - objMngr.registerObject( new Accels() ); - objMngr.registerObject( new AccessoryDesired() ); - objMngr.registerObject( new ActuatorCommand() ); - objMngr.registerObject( new ActuatorDesired() ); - objMngr.registerObject( new ActuatorSettings() ); - objMngr.registerObject( new AltHoldSmoothed() ); - objMngr.registerObject( new AltitudeHoldDesired() ); - 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() ); - objMngr.registerObject( new FlightPlanSettings() ); - objMngr.registerObject( new FlightPlanStatus() ); - objMngr.registerObject( new FlightStatus() ); - objMngr.registerObject( new FlightTelemetryStats() ); - objMngr.registerObject( new GCSReceiver() ); - objMngr.registerObject( new GCSTelemetryStats() ); - objMngr.registerObject( new GPSPosition() ); - objMngr.registerObject( new GPSSatellites() ); - objMngr.registerObject( new GPSSettings() ); - objMngr.registerObject( new GPSTime() ); - objMngr.registerObject( new GPSVelocity() ); - objMngr.registerObject( new Gyros() ); - objMngr.registerObject( new GyrosBias() ); - objMngr.registerObject( new HomeLocation() ); - objMngr.registerObject( new HwSettings() ); - objMngr.registerObject( new I2CStats() ); - 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 NedAccel() ); - objMngr.registerObject( new NEDPosition() ); - objMngr.registerObject( new ObjectPersistence() ); - objMngr.registerObject( new OveroSyncSettings() ); - objMngr.registerObject( new OveroSyncStats() ); - objMngr.registerObject( new PathAction() ); - objMngr.registerObject( new PathDesired() ); - objMngr.registerObject( new PathPlannerSettings() ); - objMngr.registerObject( new PipXSettings() ); - objMngr.registerObject( new PipXStatus() ); - objMngr.registerObject( new PositionActual() ); - objMngr.registerObject( new RateDesired() ); - objMngr.registerObject( new ReceiverActivity() ); - objMngr.registerObject( new RelayTuning() ); - objMngr.registerObject( new RelayTuningSettings() ); - 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 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() ); - - } catch (Exception e) { - e.printStackTrace(); - } - } -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/VelocityActual.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/VelocityActual.java deleted file mode 100644 index 96ac3d72d..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/VelocityActual.java +++ /dev/null @@ -1,146 +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. - * Updated by @ref AHRSCommsModule and used within @ref GuidanceModule for velocity control - * - * @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; - -/** -Updated by @ref AHRSCommsModule and used within @ref GuidanceModule for velocity control - -generated from velocityactual.xml - **/ -public class VelocityActual extends UAVDataObject { - - public VelocityActual() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List NorthElemNames = new ArrayList(); - NorthElemNames.add("0"); - fields.add( new UAVObjectField("North", "m/s", UAVObjectField.FieldType.FLOAT32, NorthElemNames, null) ); - - List EastElemNames = new ArrayList(); - EastElemNames.add("0"); - fields.add( new UAVObjectField("East", "m/s", UAVObjectField.FieldType.FLOAT32, EastElemNames, null) ); - - List DownElemNames = new ArrayList(); - DownElemNames.add("0"); - fields.add( new UAVObjectField("Down", "m/s", UAVObjectField.FieldType.FLOAT32, DownElemNames, null) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 0 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 1000; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 1000; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - VelocityActual obj = new VelocityActual(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public VelocityActual GetInstance(UAVObjectManager objMngr, long instID) - { - return (VelocityActual)(objMngr.getObject(VelocityActual.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x5A08F61Al; - protected static final String NAME = "VelocityActual"; - protected static String DESCRIPTION = "Updated by @ref AHRSCommsModule and used within @ref GuidanceModule for velocity control"; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/VelocityDesired.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/VelocityDesired.java deleted file mode 100644 index 1746c978a..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/VelocityDesired.java +++ /dev/null @@ -1,146 +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. - * Used within @ref GuidanceModule to communicate between the task computing the desired velocity and the PID loop to achieve it (running at different rates). - * - * @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; - -/** -Used within @ref GuidanceModule to communicate between the task computing the desired velocity and the PID loop to achieve it (running at different rates). - -generated from velocitydesired.xml - **/ -public class VelocityDesired extends UAVDataObject { - - public VelocityDesired() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List NorthElemNames = new ArrayList(); - NorthElemNames.add("0"); - fields.add( new UAVObjectField("North", "m/s", UAVObjectField.FieldType.FLOAT32, NorthElemNames, null) ); - - List EastElemNames = new ArrayList(); - EastElemNames.add("0"); - fields.add( new UAVObjectField("East", "m/s", UAVObjectField.FieldType.FLOAT32, EastElemNames, null) ); - - List DownElemNames = new ArrayList(); - DownElemNames.add("0"); - fields.add( new UAVObjectField("Down", "m/s", UAVObjectField.FieldType.FLOAT32, DownElemNames, null) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 0 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 1000; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 1000; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - VelocityDesired obj = new VelocityDesired(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public VelocityDesired GetInstance(UAVObjectManager objMngr, long instID) - { - return (VelocityDesired)(objMngr.getObject(VelocityDesired.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x9E946992l; - protected static final String NAME = "VelocityDesired"; - protected static String DESCRIPTION = "Used within @ref GuidanceModule to communicate between the task computing the desired velocity and the PID loop to achieve it (running at different rates)."; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/VtolPathFollowerSettings.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/VtolPathFollowerSettings.java deleted file mode 100644 index fa51e4512..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/VtolPathFollowerSettings.java +++ /dev/null @@ -1,232 +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 VtolPathFollower module - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -Settings for the @ref VtolPathFollower module - -generated from vtolpathfollowersettings.xml - **/ -public class VtolPathFollowerSettings extends UAVDataObject { - - public VtolPathFollowerSettings() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List HorizontalPosPIElemNames = new ArrayList(); - HorizontalPosPIElemNames.add("Kp"); - HorizontalPosPIElemNames.add("Ki"); - HorizontalPosPIElemNames.add("ILimit"); - fields.add( new UAVObjectField("HorizontalPosPI", "(m/s)/m", UAVObjectField.FieldType.FLOAT32, HorizontalPosPIElemNames, null) ); - - List HorizontalVelPIDElemNames = new ArrayList(); - HorizontalVelPIDElemNames.add("Kp"); - HorizontalVelPIDElemNames.add("Ki"); - HorizontalVelPIDElemNames.add("Kd"); - HorizontalVelPIDElemNames.add("ILimit"); - fields.add( new UAVObjectField("HorizontalVelPID", "deg/(m/s)", UAVObjectField.FieldType.FLOAT32, HorizontalVelPIDElemNames, null) ); - - List VerticalPosPIElemNames = new ArrayList(); - VerticalPosPIElemNames.add("Kp"); - VerticalPosPIElemNames.add("Ki"); - VerticalPosPIElemNames.add("ILimit"); - fields.add( new UAVObjectField("VerticalPosPI", "", UAVObjectField.FieldType.FLOAT32, VerticalPosPIElemNames, null) ); - - List VerticalVelPIDElemNames = new ArrayList(); - VerticalVelPIDElemNames.add("Kp"); - VerticalVelPIDElemNames.add("Ki"); - VerticalVelPIDElemNames.add("Kd"); - VerticalVelPIDElemNames.add("ILimit"); - fields.add( new UAVObjectField("VerticalVelPID", "", UAVObjectField.FieldType.FLOAT32, VerticalVelPIDElemNames, null) ); - - List VelocityFeedforwardElemNames = new ArrayList(); - VelocityFeedforwardElemNames.add("0"); - fields.add( new UAVObjectField("VelocityFeedforward", "deg/(m/s)", UAVObjectField.FieldType.FLOAT32, VelocityFeedforwardElemNames, null) ); - - List MaxRollPitchElemNames = new ArrayList(); - MaxRollPitchElemNames.add("0"); - fields.add( new UAVObjectField("MaxRollPitch", "deg", UAVObjectField.FieldType.FLOAT32, MaxRollPitchElemNames, null) ); - - List UpdatePeriodElemNames = new ArrayList(); - UpdatePeriodElemNames.add("0"); - fields.add( new UAVObjectField("UpdatePeriod", "ms", UAVObjectField.FieldType.INT32, UpdatePeriodElemNames, null) ); - - List HorizontalVelMaxElemNames = new ArrayList(); - HorizontalVelMaxElemNames.add("0"); - fields.add( new UAVObjectField("HorizontalVelMax", "m/s", UAVObjectField.FieldType.UINT16, HorizontalVelMaxElemNames, null) ); - - List VerticalVelMaxElemNames = new ArrayList(); - VerticalVelMaxElemNames.add("0"); - fields.add( new UAVObjectField("VerticalVelMax", "m/s", UAVObjectField.FieldType.UINT16, VerticalVelMaxElemNames, null) ); - - List GuidanceModeElemNames = new ArrayList(); - GuidanceModeElemNames.add("0"); - List GuidanceModeEnumOptions = new ArrayList(); - GuidanceModeEnumOptions.add("DUAL_LOOP"); - GuidanceModeEnumOptions.add("VELOCITY_CONTROL"); - fields.add( new UAVObjectField("GuidanceMode", "", UAVObjectField.FieldType.ENUM, GuidanceModeElemNames, GuidanceModeEnumOptions) ); - - List ThrottleControlElemNames = new ArrayList(); - ThrottleControlElemNames.add("0"); - List ThrottleControlEnumOptions = new ArrayList(); - ThrottleControlEnumOptions.add("FALSE"); - ThrottleControlEnumOptions.add("TRUE"); - fields.add( new UAVObjectField("ThrottleControl", "", UAVObjectField.FieldType.ENUM, ThrottleControlElemNames, ThrottleControlEnumOptions) ); - - List VelocitySourceElemNames = new ArrayList(); - VelocitySourceElemNames.add("0"); - List VelocitySourceEnumOptions = new ArrayList(); - VelocitySourceEnumOptions.add("EKF"); - VelocitySourceEnumOptions.add("NEDVEL"); - VelocitySourceEnumOptions.add("GPSPOS"); - fields.add( new UAVObjectField("VelocitySource", "", UAVObjectField.FieldType.ENUM, VelocitySourceElemNames, VelocitySourceEnumOptions) ); - - List PositionSourceElemNames = new ArrayList(); - PositionSourceElemNames.add("0"); - List PositionSourceEnumOptions = new ArrayList(); - PositionSourceEnumOptions.add("EKF"); - PositionSourceEnumOptions.add("GPSPOS"); - fields.add( new UAVObjectField("PositionSource", "", UAVObjectField.FieldType.ENUM, PositionSourceElemNames, PositionSourceEnumOptions) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 1 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 0; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 0; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - getField("HorizontalPosPI").setValue(1,0); - getField("HorizontalPosPI").setValue(0,1); - getField("HorizontalPosPI").setValue(0,2); - getField("HorizontalVelPID").setValue(5,0); - getField("HorizontalVelPID").setValue(0,1); - getField("HorizontalVelPID").setValue(1,2); - getField("HorizontalVelPID").setValue(0,3); - getField("VerticalPosPI").setValue(0.1,0); - getField("VerticalPosPI").setValue(0.001,1); - getField("VerticalPosPI").setValue(200,2); - getField("VerticalVelPID").setValue(0.1,0); - getField("VerticalVelPID").setValue(0,1); - getField("VerticalVelPID").setValue(0,2); - getField("VerticalVelPID").setValue(0,3); - getField("VelocityFeedforward").setValue(0); - getField("MaxRollPitch").setValue(20); - getField("UpdatePeriod").setValue(100); - getField("HorizontalVelMax").setValue(10); - getField("VerticalVelMax").setValue(1); - getField("GuidanceMode").setValue("DUAL_LOOP"); - getField("ThrottleControl").setValue("FALSE"); - getField("VelocitySource").setValue("EKF"); - getField("PositionSource").setValue("EKF"); - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - VtolPathFollowerSettings obj = new VtolPathFollowerSettings(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public VtolPathFollowerSettings GetInstance(UAVObjectManager objMngr, long instID) - { - return (VtolPathFollowerSettings)(objMngr.getObject(VtolPathFollowerSettings.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x973991F6l; - protected static final String NAME = "VtolPathFollowerSettings"; - protected static String DESCRIPTION = "Settings for the @ref VtolPathFollower module"; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 1 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/WatchdogStatus.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/WatchdogStatus.java deleted file mode 100644 index 722006943..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/WatchdogStatus.java +++ /dev/null @@ -1,142 +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. - * For monitoring the flags in the watchdog and especially the bootup flags - * - * @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; - -/** -For monitoring the flags in the watchdog and especially the bootup flags - -generated from watchdogstatus.xml - **/ -public class WatchdogStatus extends UAVDataObject { - - public WatchdogStatus() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List BootupFlagsElemNames = new ArrayList(); - BootupFlagsElemNames.add("0"); - fields.add( new UAVObjectField("BootupFlags", "", UAVObjectField.FieldType.UINT16, BootupFlagsElemNames, null) ); - - List ActiveFlagsElemNames = new ArrayList(); - ActiveFlagsElemNames.add("0"); - fields.add( new UAVObjectField("ActiveFlags", "", UAVObjectField.FieldType.UINT16, ActiveFlagsElemNames, null) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.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; - } - - /** - * 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(long instID) { - // TODO: Need to get specific instance to clone - try { - WatchdogStatus obj = new WatchdogStatus(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public WatchdogStatus GetInstance(UAVObjectManager objMngr, long instID) - { - return (WatchdogStatus)(objMngr.getObject(WatchdogStatus.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0xA207FA7Cl; - protected static final String NAME = "WatchdogStatus"; - protected static String DESCRIPTION = "For monitoring the flags in the watchdog and especially the bootup flags"; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/Waypoint.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/Waypoint.java deleted file mode 100644 index 97dab8a97..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/Waypoint.java +++ /dev/null @@ -1,159 +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. - * A waypoint the aircraft can try and hit. Used by the @ref PathPlanner module - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -A waypoint the aircraft can try and hit. Used by the @ref PathPlanner module - -generated from waypoint.xml - **/ -public class Waypoint extends UAVDataObject { - - public Waypoint() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List PositionElemNames = new ArrayList(); - PositionElemNames.add("North"); - PositionElemNames.add("East"); - PositionElemNames.add("Down"); - fields.add( new UAVObjectField("Position", "m", UAVObjectField.FieldType.FLOAT32, PositionElemNames, null) ); - - List VelocityElemNames = new ArrayList(); - VelocityElemNames.add("North"); - VelocityElemNames.add("East"); - VelocityElemNames.add("Down"); - fields.add( new UAVObjectField("Velocity", "m/s", UAVObjectField.FieldType.FLOAT32, VelocityElemNames, null) ); - - List YawDesiredElemNames = new ArrayList(); - YawDesiredElemNames.add("0"); - fields.add( new UAVObjectField("YawDesired", "deg", UAVObjectField.FieldType.FLOAT32, YawDesiredElemNames, null) ); - - List ActionElemNames = new ArrayList(); - ActionElemNames.add("0"); - List ActionEnumOptions = new ArrayList(); - ActionEnumOptions.add("PathToNext"); - ActionEnumOptions.add("EndpointToNext"); - ActionEnumOptions.add("Land"); - ActionEnumOptions.add("Stop"); - fields.add( new UAVObjectField("Action", "", UAVObjectField.FieldType.ENUM, ActionElemNames, ActionEnumOptions) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 0 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 4000; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 1000; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - Waypoint obj = new Waypoint(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public Waypoint GetInstance(UAVObjectManager objMngr, long instID) - { - return (Waypoint)(objMngr.getObject(Waypoint.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x338C5F90l; - protected static final String NAME = "Waypoint"; - protected static String DESCRIPTION = "A waypoint the aircraft can try and hit. Used by the @ref PathPlanner module"; - protected static final boolean ISSINGLEINST = 0 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/src/org/openpilot/uavtalk/uavobjects/WaypointActive.java b/androidgcs/src/org/openpilot/uavtalk/uavobjects/WaypointActive.java deleted file mode 100644 index cb4717dbc..000000000 --- a/androidgcs/src/org/openpilot/uavtalk/uavobjects/WaypointActive.java +++ /dev/null @@ -1,138 +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. - * Indicates the currently active waypoint - * - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package org.openpilot.uavtalk.uavobjects; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -import org.openpilot.uavtalk.UAVObjectManager; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.UAVDataObject; -import org.openpilot.uavtalk.UAVObjectField; - -/** -Indicates the currently active waypoint - -generated from waypointactive.xml - **/ -public class WaypointActive extends UAVDataObject { - - public WaypointActive() { - super(OBJID, ISSINGLEINST, ISSETTINGS, NAME); - - List fields = new ArrayList(); - - - List IndexElemNames = new ArrayList(); - IndexElemNames.add("0"); - fields.add( new UAVObjectField("Index", "", UAVObjectField.FieldType.UINT8, IndexElemNames, null) ); - - - // Compute the number of bytes for this object - int numBytes = 0; - ListIterator li = fields.listIterator(); - while(li.hasNext()) { - numBytes += li.next().getNumBytes(); - } - NUMBYTES = numBytes; - - // Initialize object - initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES); - // Set the default field values - setDefaultFieldValues(); - // Set the object description - setDescription(DESCRIPTION); - } - - /** - * Create a Metadata object filled with default values for this object - * @return Metadata object with default values - */ - public Metadata getDefaultMetadata() { - UAVObject.Metadata metadata = new UAVObject.Metadata(); - metadata.flags = - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT | - UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT | - 0 << UAVOBJ_TELEMETRY_ACKED_SHIFT | - 0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT | - UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT; - metadata.flightTelemetryUpdatePeriod = 0; - metadata.gcsTelemetryUpdatePeriod = 0; - metadata.loggingUpdatePeriod = 1000; - - return metadata; - } - - /** - * Initialize object fields with the default values. - * If a default value is not specified the object fields - * will be initialized to zero. - */ - public void setDefaultFieldValues() - { - - } - - /** - * Create a clone of this object, a new instance ID must be specified. - * Do not use this function directly to create new instances, the - * UAVObjectManager should be used instead. - */ - public UAVDataObject clone(long instID) { - // TODO: Need to get specific instance to clone - try { - WaypointActive obj = new WaypointActive(); - obj.initialize(instID, this.getMetaObject()); - return obj; - } catch (Exception e) { - return null; - } - } - - /** - * Static function to retrieve an instance of the object. - */ - public WaypointActive GetInstance(UAVObjectManager objMngr, long instID) - { - return (WaypointActive)(objMngr.getObject(WaypointActive.OBJID, instID)); - } - - // Constants - protected static final long OBJID = 0x1EA5B192l; - protected static final String NAME = "WaypointActive"; - protected static String DESCRIPTION = "Indicates the currently active waypoint"; - protected static final boolean ISSINGLEINST = 1 > 0; - protected static final boolean ISSETTINGS = 0 > 0; - protected static int NUMBYTES = 0; - - -} diff --git a/androidgcs/tests/org/openpilot/uavtalk/DataObjectTest.java b/androidgcs/tests/org/openpilot/uavtalk/DataObjectTest.java deleted file mode 100644 index 3efa7d300..000000000 --- a/androidgcs/tests/org/openpilot/uavtalk/DataObjectTest.java +++ /dev/null @@ -1,93 +0,0 @@ -package org.openpilot.uavtalk; - -import static org.junit.Assert.*; - -import java.nio.ByteBuffer; -import java.util.Observer; - -import org.junit.BeforeClass; -import org.junit.Test; -import org.openpilot.uavtalk.uavobjects.ActuatorCommand; -import org.openpilot.uavtalk.uavobjects.UAVObjectsInitialize; - -public class DataObjectTest { - - boolean succeed = false; - - @BeforeClass - public static void setUpBeforeClass() throws Exception { - } - - @Test - public void testUpdatedObserver() { - - succeed = false; - - UAVObject obj = new ActuatorCommand(); - obj.addUpdatedObserver( new Observer() { - - public void update(java.util.Observable observable, Object data) { - System.out.println("Updated: " + data.toString()); - succeed = true; - } - }); - obj.updated(); - - if(!succeed) - fail("No callback"); - - System.out.println("Done"); - - } - - @Test - public void testUpdatedViaObjMngr() { - succeed = false; - - UAVObjectManager objMngr = new UAVObjectManager(); - UAVObjectsInitialize.register(objMngr); - - UAVObject obj = objMngr.getObject("FlightTelemetryStats"); - obj.addUpdatedObserver( new Observer() { - - public void update(java.util.Observable observable, Object data) { - System.out.println("Updated: " + data.toString()); - succeed = true; - } - }); - objMngr.getObject("FlightTelemetryStats").updated(); - - if(!succeed) - fail("No callback"); - System.out.println("Done"); - - } - - @Test - public void testUnpackedViaObjMngr() { - succeed = false; - - UAVObjectManager objMngr = new UAVObjectManager(); - UAVObjectsInitialize.register(objMngr); - - UAVObject obj = objMngr.getObject("FlightTelemetryStats"); - obj.addUnpackedObserver( new Observer() { - - public void update(java.util.Observable observable, Object data) { - System.out.println("Updated: " + data.toString()); - succeed = true; - } - }); - - ByteBuffer bbuf = ByteBuffer.allocate(obj.getNumBytes()); - objMngr.getObject("FlightTelemetryStats").unpack(bbuf); - - if(!succeed) - fail("No callback"); - - System.out.println("Done"); - - } - - -} diff --git a/androidgcs/tests/org/openpilot/uavtalk/FieldTest.java b/androidgcs/tests/org/openpilot/uavtalk/FieldTest.java deleted file mode 100644 index 2d161fc25..000000000 --- a/androidgcs/tests/org/openpilot/uavtalk/FieldTest.java +++ /dev/null @@ -1,121 +0,0 @@ -package org.openpilot.uavtalk; - -import static org.junit.Assert.*; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; - -import org.junit.BeforeClass; -import org.junit.Test; - -import org.openpilot.uavtalk.UAVObjectField; -import org.openpilot.uavtalk.UAVObject; -import org.openpilot.uavtalk.uavobjects.*; - -public class FieldTest { - - @BeforeClass - public static void setUpBeforeClass() throws Exception { - } - - @Test - public void testPackUint16() { - // Need an object initialized to the field to provide metadata - UAVObject obj = null; - try { - obj = new ActuatorCommand(); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - UAVObjectField field = new UAVObjectField("TestField", "No Units", UAVObjectField.FieldType.UINT16, 3, null); - field.initialize(obj); - field.setValue(3,0); - field.setValue(-50,1); - field.setValue(5003585,2); - - ByteBuffer bbuf = ByteBuffer.allocate(field.getNumBytes()); - - try { - field.pack(bbuf); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - fail("Buffer size incorrect"); - } - - // Expect data to come out as little endian - byte[] expected = {3,0,0,0,(byte) 0xff,(byte) 0xff}; - for(int i = 0; i < expected.length && i < bbuf.array().length; i++) { - System.out.println("Expected: " + expected[i] + " (" + i + ")"); - System.out.println("Received: " + bbuf.array()[i] + " (" + i + ")"); - assertEquals(bbuf.array()[i],expected[i]); - } - } - - @Test - public void testUnpackUint16() { - // Need an object initialized to the field to provide metadata - UAVObject obj = null; - obj = new ActuatorCommand(); - UAVObjectField field = new UAVObjectField("TestField", "No Units", UAVObjectField.FieldType.UINT16, 3, null); - field.initialize(obj); - - ByteBuffer bbuf = ByteBuffer.allocate(field.getNumBytes()); - byte[] expected = {3,0,0,0,(byte) 0xff,(byte) 0xff}; - bbuf.put(expected); - bbuf.position(0); - field.unpack(bbuf); - - assertEquals(field.getValue(0), 3); - assertEquals(field.getValue(1), 0); - assertEquals(field.getValue(2), 65535); - } - - @Test - public void testEnumSetGetValue() { - List options = new ArrayList(); - options.add("Opt1"); - options.add("Opt2"); - options.add("Opt3"); - - // Need an object initialized to the field to provide metadata - UAVObject obj = null; - try { - obj = new ActuatorCommand(); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - UAVObjectField field = new UAVObjectField("TestField", "No Units", UAVObjectField.FieldType.ENUM, 3, options); - field.initialize(obj); - field.setValue("Opt1",0); - field.setValue("Opt2",1); - field.setValue("Opt3",2); - assertEquals(field.getValue(0), "Opt1"); - assertEquals(field.getValue(1), "Opt2"); - assertEquals(field.getValue(2), "Opt3"); - } - - @Test - public void testUint16SetGetValue() { - - // Need an object initialized to the field to provide metadata - UAVObject obj = null; - try { - obj = new ActuatorCommand(); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - UAVObjectField field = new UAVObjectField("TestField", "No Units", UAVObjectField.FieldType.UINT16, 3, null); - field.initialize(obj); - field.setValue(3,0); - field.setValue(-50,1); - field.setValue(5003585,2); - assertEquals(field.getValue(0), 3); - assertEquals(field.getValue(1), 0); - assertEquals(field.getValue(2), 65535); - } -} diff --git a/androidgcs/tests/org/openpilot/uavtalk/ObjMngrTest.java b/androidgcs/tests/org/openpilot/uavtalk/ObjMngrTest.java deleted file mode 100644 index 57e641c96..000000000 --- a/androidgcs/tests/org/openpilot/uavtalk/ObjMngrTest.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.openpilot.uavtalk; - -import org.junit.BeforeClass; -import org.junit.Test; -import org.openpilot.uavtalk.uavobjects.UAVObjectsInitialize; - -public class ObjMngrTest { - - @BeforeClass - public static void setUpBeforeClass() throws Exception { - } - - @Test - public void testGetObjects() { - UAVObjectManager objMngr = new UAVObjectManager(); - UAVObjectsInitialize.register(objMngr); -// System.out.println(objMngr.getObject("ActuatorSettings", 0)); - } - -} diff --git a/androidgcs/tests/org/openpilot/uavtalk/SettingsTest.java b/androidgcs/tests/org/openpilot/uavtalk/SettingsTest.java deleted file mode 100644 index 5a805ae88..000000000 --- a/androidgcs/tests/org/openpilot/uavtalk/SettingsTest.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.openpilot.uavtalk; - -import static org.junit.Assert.*; - -import org.junit.BeforeClass; -import org.junit.Test; - -public class SettingsTest { - - @BeforeClass - public static void setUpBeforeClass() throws Exception { - } - - @Test - public void testGetDefaultMetadata() { - fail("Not yet implemented"); - } - - @Test - public void testSetDefaultFieldValues() { - fail("Not yet implemented"); - } - - @Test - public void testIsSettings() { - fail("Not yet implemented"); - } - - @Test - public void testGetField() { - fail("Not yet implemented"); - } - -} diff --git a/androidgcs/tests/org/openpilot/uavtalk/TalkTest.java b/androidgcs/tests/org/openpilot/uavtalk/TalkTest.java deleted file mode 100644 index 5e6186442..000000000 --- a/androidgcs/tests/org/openpilot/uavtalk/TalkTest.java +++ /dev/null @@ -1,133 +0,0 @@ -package org.openpilot.uavtalk; -import static org.junit.Assert.*; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.net.InetAddress; -import java.net.Socket; -import java.util.Observable; -import java.util.Observer; - -import org.junit.BeforeClass; -import org.junit.Test; -import org.openpilot.uavtalk.uavobjects.UAVObjectsInitialize; -import org.openpilot.uavtalk.UAVTalk; - - -public class TalkTest { - - static UAVObjectManager objMngr; - static final String IP_ADDRDESS = new String("127.0.0.1"); - static final int PORT_NUM = 7777; - boolean succeed = false; - - byte[] flightStatsConnected = - {0x3c,0x20,0x1d,0x00, - (byte) 0x5e,(byte) 0x26,(byte) 0x0c,(byte) 0x66, - 0x03,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00, - 0x00,(byte) 0xAE}; - - @BeforeClass - public static void setUpBeforeClass() throws Exception { - objMngr = new UAVObjectManager(); - UAVObjectsInitialize.register(objMngr); - } - - //@Test - public void testGetFlightStatus() { - Socket connection = null; - UAVTalk talk = null; - try{ - InetAddress ip = InetAddress.getByName(IP_ADDRDESS); - connection = new Socket(ip, PORT_NUM); - } catch (Exception e) { - e.printStackTrace(); - fail("Couldn't connect to test platform"); - } - - try { - talk = new UAVTalk(connection.getInputStream(), connection.getOutputStream(), objMngr); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - fail("Couldn't construct UAVTalk object"); - } - - Thread inputStream = talk.getInputProcessThread(); - inputStream.start(); - - succeed = false; - - UAVObject obj = objMngr.getObject("FlightTelemetryStats"); - - obj.addUpdatedObserver( new Observer() { - public void update(Observable observable, Object data) { - // TODO Auto-generated method stub - System.out.println("Updated: " + data.toString()); - succeed = true; - } - }); - - try { - Thread.sleep(1000); - } catch (InterruptedException e1) { - } - - if(!succeed) - fail("Never received a FlightTelemetryStats update"); - - } - - @Test - public void testSendObjectRequest() throws IOException { - ByteArrayInputStream is = new ByteArrayInputStream(new byte[0], 0, 0); - ByteArrayOutputStream os = new ByteArrayOutputStream(100); - - UAVTalk talk = new UAVTalk(is,os,objMngr); - UAVObject obj = objMngr.getObject("FlightTelemetryStats"); - obj.getField("Status").setValue("Connected"); - - talk.sendObject(obj, false, false); - - System.out.println("Size: " + os.size()); - byte [] array = os.toByteArray(); - for(int i = 0; i < array.length; i++) { - System.out.print("0x" + Integer.toHexString((int) array[i] & 0xff)); - System.out.print("/0x" + Integer.toHexString((int) flightStatsConnected[i] & 0xff)); - if(i != array.length-1) - System.out.print("\n"); - } - System.out.print("\n"); - for(int i = 0; i < array.length; i++) - assertEquals(os.toByteArray()[i], flightStatsConnected[i]); - } - - @Test - public void testReceiveObject() throws InterruptedException { - ByteArrayInputStream is = new ByteArrayInputStream(flightStatsConnected, 0, flightStatsConnected.length); - ByteArrayOutputStream os = new ByteArrayOutputStream(100); - - // Make the Status wrong initially - UAVObject obj = objMngr.getObject("FlightTelemetryStats"); - obj.getField("Status").setValue("Disconnected"); - - // Test receiving from that stream - UAVTalk talk = new UAVTalk(is,os,objMngr); - Thread inputStream = talk.getInputProcessThread(); - inputStream.start(); - - Thread.sleep(1000); - - System.out.println("Should be FlightTelemetry Stats:"); - System.out.println(objMngr.getObject("FlightTelemetryStats").toString()); - - assertEquals(obj.getField("Status").getValue(), new String("Connected")); - } - - -} diff --git a/androidgcs/tests/org/openpilot/uavtalk/TelemetryMonitorTest.java b/androidgcs/tests/org/openpilot/uavtalk/TelemetryMonitorTest.java deleted file mode 100644 index 6ddcfe03e..000000000 --- a/androidgcs/tests/org/openpilot/uavtalk/TelemetryMonitorTest.java +++ /dev/null @@ -1,59 +0,0 @@ -package org.openpilot.uavtalk; - -import static org.junit.Assert.fail; - -import java.io.IOException; -import java.net.InetAddress; -import java.net.Socket; - -import org.junit.Test; -import org.openpilot.uavtalk.uavobjects.UAVObjectsInitialize; - -import android.os.Looper; - - -public class TelemetryMonitorTest { - - static UAVObjectManager objMngr; - static UAVTalk talk; - static final String IP_ADDRDESS = new String("127.0.0.1"); - static final int PORT_NUM = 7777; - static Socket connection = null; - boolean succeed = false; - - @Test - public void testTelemetry() throws Exception { - objMngr = new UAVObjectManager(); - UAVObjectsInitialize.register(objMngr); - talk = null; - try{ - InetAddress ip = InetAddress.getByName(IP_ADDRDESS); - connection = new Socket(ip, PORT_NUM); - } catch (Exception e) { - e.printStackTrace(); - fail("Couldn't connect to test platform"); - } - - try { - talk = new UAVTalk(connection.getInputStream(), connection.getOutputStream(), objMngr); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - fail("Couldn't construct UAVTalk object"); - } - - Thread inputStream = talk.getInputProcessThread(); - inputStream.start(); - - Looper.prepare(); - Telemetry tel = new Telemetry(talk, objMngr, Looper.myLooper()); - @SuppressWarnings("unused") - TelemetryMonitor mon = new TelemetryMonitor(objMngr,tel); - - Thread.sleep(10000); - - System.out.println("Done"); - } - - -} diff --git a/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS.xml b/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS.xml index 05421fc80..8d9608d6e 100644 --- a/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS.xml +++ b/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS.xml @@ -8,6 +8,8 @@ true en_AU true + 700 + 800 default false @@ -1683,7 +1685,7 @@ false mapquad.png true - false + true @@ -1703,7 +1705,7 @@ false airplanepip.png true - false + true @@ -1723,7 +1725,7 @@ false mapquad.png true - false + true @@ -2636,7 +2638,7 @@ uavGadget 2 - @Variant(AAAACQAAAAIAAAACAAAClQAAAAIAAAB3) + @Variant(AAAACQAAAAIAAAACAAABhAAAAAIAAAGE) splitter 1 @@ -2669,8 +2671,20 @@ - EmptyGadget - uavGadget + + PfdQmlGadget + + NoTerrain + + uavGadget + + + MagicWaypointGadget + uavGadget + + 1 + @Variant(AAAACQAAAAIAAAACAAAB7wAAAAIAAAGU) + splitter GCSControlGadget @@ -2680,7 +2694,7 @@ uavGadget 1 - @Variant(AAAACQAAAAIAAAACAAAB6AAAAAIAAADC) + @Variant(AAAACQAAAAIAAAACAAADhAAAAAIAAAIX) splitter 2 @@ -2739,7 +2753,7 @@ false - :\core\images\ah.png + :/core/images/ah.png :/core/images/openpilot_logo_64.png :/core/images/config.png :/core/images/cog.png diff --git a/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS_wide.xml b/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS_wide.xml index 960c10355..db715a74b 100644 --- a/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS_wide.xml +++ b/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS_wide.xml @@ -6,7 +6,7 @@ Notify Plugin settings true - 600 + 700 800 false Wide configuration @@ -1679,7 +1679,7 @@ false mapquad.png true - false + true @@ -1698,7 +1698,7 @@ false airplanepip.png true - false + true @@ -1717,7 +1717,7 @@ false mapquad.png true - false + true @@ -2636,7 +2636,7 @@ uavGadget 2 - @Variant(AAAACQAAAAIAAAACAAAClQAAAAIAAAB3) + @Variant(AAAACQAAAAIAAAACAAABhAAAAAIAAAGE) splitter 1 @@ -2669,8 +2669,20 @@ - EmptyGadget - uavGadget + + PfdQmlGadget + + NoTerrain + + uavGadget + + + MagicWaypointGadget + uavGadget + + 1 + @Variant(AAAACQAAAAIAAAACAAAB7wAAAAIAAAGU) + splitter GCSControlGadget @@ -2680,7 +2692,7 @@ uavGadget 1 - @Variant(AAAACQAAAAIAAAACAAAB6AAAAAIAAADC) + @Variant(AAAACQAAAAIAAAACAAADhAAAAAIAAAIX) splitter 2 @@ -2739,7 +2751,7 @@ false - :\core\images\ah.png + :/core/images/ah.png :/core/images/openpilot_logo_64.png :/core/images/config.png :/core/images/cog.png diff --git a/ground/openpilotgcs/src/plugins/coreplugin/images/ah.png b/ground/openpilotgcs/src/plugins/coreplugin/images/ah.png index a0be19bed..646f24ad6 100644 Binary files a/ground/openpilotgcs/src/plugins/coreplugin/images/ah.png and b/ground/openpilotgcs/src/plugins/coreplugin/images/ah.png differ diff --git a/ground/openpilotgcs/src/plugins/coreplugin/images/cog.png b/ground/openpilotgcs/src/plugins/coreplugin/images/cog.png index 67de2c6cc..97b835c58 100644 Binary files a/ground/openpilotgcs/src/plugins/coreplugin/images/cog.png and b/ground/openpilotgcs/src/plugins/coreplugin/images/cog.png differ diff --git a/ground/openpilotgcs/src/plugins/coreplugin/images/config.png b/ground/openpilotgcs/src/plugins/coreplugin/images/config.png index 5c8213fef..650a00365 100644 Binary files a/ground/openpilotgcs/src/plugins/coreplugin/images/config.png and b/ground/openpilotgcs/src/plugins/coreplugin/images/config.png differ diff --git a/ground/openpilotgcs/src/plugins/coreplugin/images/joystick.png b/ground/openpilotgcs/src/plugins/coreplugin/images/joystick.png index 62168f56f..960ba9465 100644 Binary files a/ground/openpilotgcs/src/plugins/coreplugin/images/joystick.png and b/ground/openpilotgcs/src/plugins/coreplugin/images/joystick.png differ diff --git a/ground/openpilotgcs/src/plugins/coreplugin/images/scopes.png b/ground/openpilotgcs/src/plugins/coreplugin/images/scopes.png index 01e933a61..99434575f 100644 Binary files a/ground/openpilotgcs/src/plugins/coreplugin/images/scopes.png and b/ground/openpilotgcs/src/plugins/coreplugin/images/scopes.png differ diff --git a/ground/openpilotgcs/src/plugins/hitlv2/hitlv2optionspage.ui b/ground/openpilotgcs/src/plugins/hitlv2/hitlv2optionspage.ui index 00a2f60aa..f82b350c3 100644 --- a/ground/openpilotgcs/src/plugins/hitlv2/hitlv2optionspage.ui +++ b/ground/openpilotgcs/src/plugins/hitlv2/hitlv2optionspage.ui @@ -6,29 +6,14 @@ 0 0 - 403 - 400 + 615 + 577 Form - - 3 - - - 0 - - - 0 - - - 0 - - - 3 - @@ -144,475 +129,569 @@ + + 6 + + + 6 + - - - Attitude data + + + QFrame::NoFrame - - - 3 - - - 3 - - - 3 - - - 3 - - - 0 - - - - - AttitudeRaw (gyro, accels) - - - true - - - true - - - false - - - - 3 - - - 3 - - - 0 - - - 0 - - - - - Refresh rate - - - - - - - ms - - - 10 - - - 100 - - - 20 - - - - - - - - - - AttitudeActual - - - true - - - true - - - false - - - - 3 - - - 3 - - - 0 - - - 0 - - - - - send raw data to board - - - - - - - - 75 - true - - - - - - - use values from simulator - - - true - - - - - - - - - - calculate from AttitudeRaw - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - - - Other data + + QFrame::Plain - - - 3 + + true + + + + + 0 + 0 + 574 + 391 + - - 3 - - - 3 - - - 3 - - - 0 - - - - - HomeLocation - - - true - - - true - - - false - - - - 3 + + + 0 + + + + + Attitude data - - 3 - - - 0 - - - 0 - - - - - Refresh rate - - - - - - - 0 - update once, or every N seconds - - - sec - - - 10 - - - - - - - - - - GPSPosition - - - true - - - true - - - false - - - - 3 - - - 3 - - - 0 - - - 0 - - - - - Refresh rate - - - - - - - ms - - - 100 - - - 2000 - - - 500 - - - - - - - - - - SonarAltitude - - - true - - - true - - - false - - - - 3 - - - 6 - - - 3 - - - 0 - - - 0 - - - - - - - Range detectioon - - - - - - - m - - - 1 - - - 10 - - - 5 - - - - - - - Refresh rate - - - - - - - ms - - - 20 - - - 2000 - - - 10 - - - 50 - - - - - - - - - - - - Map command from simulator - - - true - - - true - - - false - - - - 3 - - - 3 - - - 0 - - - 0 - - - - - - 75 - true - - - - to GCSReciver - - - true - - - - - - - false - - - to ManualCtrll (not implemented) - - - - - - - - - - 6 - - - - - Maximum output rate + + + 12 - - - - - - ms + + 3 - - 10 + + 18 - - 100 + + 3 - - 5 + + 0 - - 15 + + + + + 0 + 0 + + + + AttitudeRaw (gyro, accels) + + + true + + + true + + + false + + + + 6 + + + 12 + + + 0 + + + 12 + + + + + Refresh rate + + + + + + + ms + + + 10 + + + 100 + + + 20 + + + + + + + + + + + 0 + 0 + + + + AttitudeActual + + + true + + + true + + + false + + + + 6 + + + 12 + + + 0 + + + 12 + + + + + send raw data to board + + + + + + + + 75 + true + + + + + + + use values from simulator + + + true + + + + + + + + + + calculate from AttitudeRaw + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 20 + 40 + + + + + + + + + + + Other data + + + + 12 - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - + + 3 + + + 18 + + + 3 + + + 0 + + + + + + 0 + 0 + + + + HomeLocation + + + true + + + true + + + false + + + + 6 + + + 12 + + + 0 + + + 12 + + + + + + 0 + 0 + + + + Refresh rate + + + + + + + + 0 + 0 + + + + 0 - update once, or every N seconds + + + sec + + + 10 + + + + + + + + + + + 0 + 0 + + + + GPSPosition + + + true + + + true + + + false + + + + 6 + + + 12 + + + 0 + + + 12 + + + + + Refresh rate + + + + + + + ms + + + 100 + + + 2000 + + + 500 + + + + + + + + + + + 0 + 0 + + + + SonarAltitude + + + true + + + true + + + false + + + + 3 + + + 6 + + + 3 + + + 0 + + + 0 + + + + + 6 + + + 6 + + + + + Range detection + + + + + + + m + + + 1 + + + 10 + + + 5 + + + + + + + Refresh rate + + + + + + + ms + + + 20 + + + 2000 + + + 10 + + + 50 + + + + + + + + + + + + + 0 + 0 + + + + Map command from simulator + + + true + + + true + + + false + + + + 3 + + + 12 + + + 0 + + + 12 + + + + + + 75 + true + + + + to GCSReciver + + + true + + + + + + + false + + + to ManualCtrll (not implemented) + + + + + + + + + + 6 + + + + + Maximum output rate + + + + + + + ms + + + 10 + + + 100 + + + 5 + + + 15 + + + + + + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 20 + 40 + + + + + + + + + diff --git a/ground/openpilotgcs/src/plugins/opmap/opmapgadgetwidget.cpp b/ground/openpilotgcs/src/plugins/opmap/opmapgadgetwidget.cpp index cd0e2f32a..c71c78c2a 100644 --- a/ground/openpilotgcs/src/plugins/opmap/opmapgadgetwidget.cpp +++ b/ground/openpilotgcs/src/plugins/opmap/opmapgadgetwidget.cpp @@ -838,9 +838,8 @@ void OPMapGadgetWidget::onTelemetryConnect() setHome(internals::PointLatLng(LLA[0], LLA[1]),LLA[2]); - if (m_map) - m_map->SetCurrentPosition(m_home_position.coord); // set the map position - + if (m_map && m_map->UAV->GetMapFollowType()!=UAVMapFollowType::None) + m_map->SetCurrentPosition(m_home_position.coord); // set the map position // *********************** } @@ -2188,6 +2187,19 @@ void OPMapGadgetWidget::doVisualizationChanged(QList way index++; } connect(wayPointItem, SIGNAL(WPDropped(WayPointItem*)), this, SLOT(onWPDragged(WayPointItem*))); + } +} + +void OPMapGadgetWidget::on_tbFind_clicked() +{ + QPalette pal = m_widget->leFind->palette(); + + int result=m_map->SetCurrentPositionByKeywords(m_widget->leFind->text()); + if(result==core::GeoCoderStatusCode::G_GEO_SUCCESS) + { + pal.setColor( m_widget->leFind->backgroundRole(), Qt::green); + m_widget->leFind->setPalette(pal); + m_map->SetZoom(12); } } @@ -2224,3 +2236,8 @@ void OPMapGadgetWidget::onOverlayOpacityActGroup_triggered(QAction *action) m_map->setOverlayOpacity(action->data().toReal()/100); emit overlayOpacityChanged(action->data().toReal()/100); } + +void OPMapGadgetWidget::on_leFind_returnPressed() +{ + on_tbFind_clicked(); +} diff --git a/ground/openpilotgcs/src/plugins/opmap/opmapgadgetwidget.h b/ground/openpilotgcs/src/plugins/opmap/opmapgadgetwidget.h index c41b08f23..afccc51e4 100644 --- a/ground/openpilotgcs/src/plugins/opmap/opmapgadgetwidget.h +++ b/ground/openpilotgcs/src/plugins/opmap/opmapgadgetwidget.h @@ -224,6 +224,8 @@ private slots: void onChangeDefaultLocalAndZoom(); void onHomeDoubleClick(HomeItem*); void onOverlayOpacityActGroup_triggered(QAction *action); + void on_leFind_returnPressed(); + private: int m_min_zoom; int m_max_zoom; diff --git a/ground/openpilotgcs/src/plugins/uavobjectbrowser/uavobjectbrowseroptionspage.ui b/ground/openpilotgcs/src/plugins/uavobjectbrowser/uavobjectbrowseroptionspage.ui index 350fc440b..3b5cff751 100644 --- a/ground/openpilotgcs/src/plugins/uavobjectbrowser/uavobjectbrowseroptionspage.ui +++ b/ground/openpilotgcs/src/plugins/uavobjectbrowser/uavobjectbrowseroptionspage.ui @@ -118,7 +118,7 @@ - Only hilight nodes when value actually changes + Only highlight nodes when value actually changes diff --git a/ground/openpilotgcs/src/plugins/uploader/images/gcs-board-cc.png b/ground/openpilotgcs/src/plugins/uploader/images/gcs-board-cc.png index c4e77c025..ee096b76e 100644 Binary files a/ground/openpilotgcs/src/plugins/uploader/images/gcs-board-cc.png and b/ground/openpilotgcs/src/plugins/uploader/images/gcs-board-cc.png differ diff --git a/ground/openpilotgcs/src/plugins/uploader/images/gcs-board-cc3d.png b/ground/openpilotgcs/src/plugins/uploader/images/gcs-board-cc3d.png index b9ad6fa4f..69fd4aa8c 100644 Binary files a/ground/openpilotgcs/src/plugins/uploader/images/gcs-board-cc3d.png and b/ground/openpilotgcs/src/plugins/uploader/images/gcs-board-cc3d.png differ diff --git a/ground/openpilotgcs/src/plugins/welcome/welcomemode.cpp b/ground/openpilotgcs/src/plugins/welcome/welcomemode.cpp index 814a04bf4..a109f328a 100644 --- a/ground/openpilotgcs/src/plugins/welcome/welcomemode.cpp +++ b/ground/openpilotgcs/src/plugins/welcome/welcomemode.cpp @@ -92,7 +92,7 @@ QString WelcomeMode::name() const QIcon WelcomeMode::icon() const { - return QIcon(QLatin1String(":/core/images/openpilot_logo_64.png")); + return QIcon(QLatin1String(":/core/images/openpiloticon.png")); } int WelcomeMode::priority() const diff --git a/make/scripts/version-info.py b/make/scripts/version-info.py index 2f742962b..b6d7fd4c0 100644 --- a/make/scripts/version-info.py +++ b/make/scripts/version-info.py @@ -250,7 +250,7 @@ def xtrim(string, suffix, length): assert n > 0, "length of truncated string+suffix exceeds maximum length" return ''.join([string[:n], '+', suffix]) -def GetHashofDirs(directory, verbose=0): +def GetHashofDirs(directory, verbose=0, raw=0): import hashlib, os SHAhash = hashlib.sha1() if not os.path.exists (directory): @@ -298,8 +298,11 @@ def GetHashofDirs(directory, verbose=0): if verbose == 1: print 'Final hash is', SHAhash.hexdigest() - hex_stream = lambda s:",".join(['0x'+hex(ord(c))[2:].zfill(2) for c in s]) - return hex_stream(SHAhash.digest()) + if raw == 1: + return SHAhash.hexdigest() + else: + hex_stream = lambda s:",".join(['0x'+hex(ord(c))[2:].zfill(2) for c in s]) + return hex_stream(SHAhash.digest()) def main(): """This utility uses git repository in the current working directory @@ -380,7 +383,8 @@ dependent targets. BOARD_TYPE = args.type, BOARD_REVISION = args.revision, SHA1 = sha1(args.image), - UAVOSHA1= GetHashofDirs(args.uavodir,0), + UAVOSHA1TXT = GetHashofDirs(args.uavodir,verbose=0,raw=1), + UAVOSHA1 = GetHashofDirs(args.uavodir,verbose=0,raw=0), ) if args.info: