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

Merge remote-tracking branch 'op-public/next' into revo-next

Conflicts:
	ground/openpilotgcs/src/plugins/hitl/plugin.pro
	ground/openpilotgcs/src/plugins/hitlnew/fgsimulator.cpp
	ground/openpilotgcs/src/plugins/hitlnew/hitlconfiguration.cpp
	ground/openpilotgcs/src/plugins/hitlnew/hitloptionspage.cpp
	ground/openpilotgcs/src/plugins/hitlnew/hitloptionspage.ui
	ground/openpilotgcs/src/plugins/hitlnew/il2simulator.cpp
	ground/openpilotgcs/src/plugins/hitlnew/simulator.cpp
	ground/openpilotgcs/src/plugins/hitlnew/simulator.h
	ground/openpilotgcs/src/plugins/hitlnew/xplanesimulator.cpp
	ground/openpilotgcs/src/plugins/uavobjects/uavobjects.pro
This commit is contained in:
Stacey Sheldon 2012-10-20 13:56:18 -04:00
commit 127ca1e7e1
468 changed files with 43048 additions and 26808 deletions

8
.gitignore vendored
View File

@ -75,7 +75,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

View File

@ -1,5 +1,5 @@
This is a credits file of people that are or have been key contributors to the OpenPilot project.
Without the work of the people in this file OpenPilot would not be what it is today.
This is a credits file of people that are or have been key contributors to the OpenPilot code base in this Git repository.
Without the work of the people in this file and many that are not who help the community, OpenPilot would not be what it is today.
It is sorted alphabetically by name and formatted so that it allows for easy grepping and beautification by scripts.
@ -15,7 +15,6 @@ Current maintainer function (M)
N: Connor Abbott
E: connor (at) abbott (dot) cx
D: Win32 OpenPilot port
M: SITL Win32
N: David Ankers
E: david (at) openpilot (dot) org
@ -27,6 +26,11 @@ N: Pedro Assuncao
E: pedro (dot) agda (plus) openpilot (at) gmail (dot) com
D: Initial GCS Settings Gadget work
N: Fredrik Arvidsson
E: fredrik (at) arvidssons (dot) org
W: GCS Setup Wizard
M: GCS Setup Wizard
N: Werner Backes
E: werner (at) bit-1 (dot) de
D: Port of CopterControl to PS3 Move Controller (MoveCopter)
@ -34,30 +38,37 @@ D: Port of CopterControl to PS3 Move Controller (MoveCopter)
N: Jose Barros
E: josembarros (at) hotmail (dot) com
D: Next-Gen OP Map Lib, Y-Modem Library, Uploader Plugin
D: OP Bootloader, AHRS Bootloader, OPUploadTool
M: Bootloader, OP MAP Lib
D: OP Bootloader, AHRS Bootloader, OPUploadTool and much else
M: Bootloader, OP MAP Lib
N: David "Buzz" Carlson
E: chebuzz (plus) openpilot (at) gmail (dot) com
D: 3D ModelView GCS Plugin, sponsor of HITL merge work and XPlane addition
M: 3D Modelview
N: James Cotton
E: peabody124 (plus) openpilot (at) gmail (dot) com
D: Multiplatform HID implementation (firmware & GCS), GCS Joystick control
D: Posix OpenPilot work and Mac implementation
D: Firmware implementation of Professor Schinstock's INS/GPS
M: Architecture co-lead
D: Android GCS and much else
M: Architecture co-lead, Android GCS Lead
N: Steve Doll
E: speakfree07 (at) hotmail (dot) com
D: Much Artwork, Logo rework, Welcome page design
N: Piotr Esden-Tempski
E: esden (at) esden (dot) net
D: Floss-JTAG Rev A, 4-layer initial design
N: Darren Furniss
E: furnibird (plus) openpilot (at) gmail (dot) com
W: GCS Artwork and Android GCS Artwork
N: Frederic Goddeeris
E: fredericgoddeeris (at) hotmail (dot) com
D: I2C work and FreeRTOS work, MK integration
D: EagleTree OSD implementation
M: OSD Module
N: Daniel Godin
E: dgodin (at) dnsct (dot) com
@ -70,6 +81,7 @@ D: GCS Scope plugin
N: Nuno Guedes
E: muralha (plus) openpilot (at) gmail (dot) com
D: 3D artwork, moving surfaces and work on ModelView
D: PFD Artwork
N: Peter Gunnarsson
E: peter (at) pyne (dot) se
@ -82,9 +94,13 @@ D: Creator of http://pythononachip.org
N: Joe Hlebasko
E: joe (dot) hlebasko(plus) openpilot (at) gmail (dot) com
D: Production Main Board & Production OP GPS
D: Early versions of Main Board & Production OP GPS
M: Hardware Architecture Team
N: Andy Honecker
E: andywh (at) yahoo (dot) com
D: Hardware design review and optimisation
N: Mark James
E: mjames (plus) openpilot (at) gmail (dot) com
D: Some of Silk Icon set used in GCS - http://www.famfamfam.com/lab/icons/silk
@ -92,6 +108,7 @@ D: Some of Silk Icon set used in GCS - http://www.famfamfam.com/lab/icons/silk
N: Sami Korhonen
E: samik (dot) korhonen (plus) openpilot (at) gmail (dot) com
D: GPS Module, Spektrum RC Module, OSD work
M: OpenPilot OSD
N: Thorsten Klose
E: thorsten (dot) klose (at) dmx (dot) de
@ -101,11 +118,14 @@ N: Hallvard Kristiansen
E: hal (at) fleshmx (dot) com
D: GCS Artwork, Quad layout diagrams
N: Mike Labranche
E: mdlabranche (plus) openpilot (at) gmail (dot) com
D: Tab bar Telem Monitor
N: Edouard Lafargue
E: edouard (at) lafargue (dot) name
D: GCS Dial Plugins, GCS PFD Plugin, GCS GPS plugin, GCS Config plugin
D: Artwork including standard display dials
M: GCS Core
N: Matt Lipski
E: mattlipski (plus) openpilot (at) gmail (dot) com
@ -113,7 +133,7 @@ D: Deluxe Dials Set artwork, (Artificial Horizon, Compass, Turn Indicator)
N: Les Newell
E: les (dot) newell (at) fastmail (dot) co (dot) uk
D: Advanced mixer matrix, SPI protocol based on UAVObjects
D: Advanced mixer matrix, SPI protocol based on UAVObjects, feedforward
N: Ken Northup
E: helos360 (at) bellsouth (dot) net
@ -126,19 +146,22 @@ D: Artwork and design including work on the Deluxe Dial Set
N: Cathy Moss
E: cmoss296 (at) blueyonder (dot) co (dot) uk
D: Hardware design Lead: Gen 2 Mainboard, PipXtreme, Current Sensor
D: Lead dev PipXtreme, creator OP Map Plugin
M: Hardware Architecture Team / PipX Modem
D: PipXtreme designer, creator OP Map Plugin
N: Angus Peart
E: gussy (at) openpilot (dot) org
D: Co-founder, Principal hardware architect.
D: Hardware design of OpenPilot, AHRS, GPS and other hardware
D: Core developer embedded code
D: Hardware design of early OpenPilot, AHRS, GPS and other hardware
N: Dmytro Poplavskiy
E: dmytro (dot) poplavskiy (plus) openpilot (at) gmail (dot) com
W: QML PFD, QML Welcome page
M: Qml plugins
N: Eric Price
E: corvus (dot) corax (at) cybertrench (dot) com
D: IL2 HITL GCS Plugin, Posix OpenPilot, Advanced stabilisation module
M: SITL Posix
M: SITL Posix, SLAM work
N: Richard Querin
E: rfquerin (plus) openpilot (at) gmail (dot) com
@ -151,7 +174,6 @@ D: See: http://www.glc-lib.net/
N: Julien Rouviere
E: julien (dot) rouviere (plus) openpilot (at) gmail (dot) com
D: GCS Core Developer
D: GCS Framework and Plugins for the GCS
N: Zik Saleeba
@ -163,6 +185,11 @@ E: dales (at) ksu (dot) edu
D: Lead AHRS Developer
D: Creator of the OpenPilot INS / EKF
N: Professor Kenn Sebesta
E: kenn (at) openpilot (dot) org
D: Lead Fixed Wing Developer
M: Fixed Wing support
N: Oleg Semyonov
E: os-openpilot-org (at) os-propo (dot) info
D: Core tester & Project organisation
@ -178,7 +205,6 @@ D: SPI protocol for AHRS, I2C rewrite and much core work
N: Troy Schultz
E: troy (dot) schultz (at) rogers (dot) com
D: INS design review and optimisation
M: Hardware Architecture Team
N: Dr. Erhard Siegl
E: Erhard (dot) Siegl (at) zogazoga (dot) at
@ -202,8 +228,13 @@ N: Vassilis Varveropoulos
E: vassilis (at) openpilot (dot) org
D: Co-founder, Principal embedded software architect.
D: Module architecture and UAVTalk/UAVObjects implementation.
M: Architecture co-lead
N: Alex Vrubel
E: alex (dot) vrubel (plus) openpilot (at) gmail (dot) com
D: Russian translation of the GCS
N: Brian Webb
E: webbbn (plus) openpilot (at) gmail (dot) com
W: Modem lead developer
M: OP Modems

View File

@ -1,4 +1,9 @@
Short summary of changes. For a complete list see the git log.
2012-10-06
Receiver port can now be configured as PPM *and* PWM inputs.
Pin 1 is PPM, other pins are PWM inputs.
2012-07-27
Added the ability to load stylesheets from external file according to operating system:
macos.qss, linux.qss, windows.qss

10
KNOWN_ISSUES.txt Normal file
View File

@ -0,0 +1,10 @@
+ Halt/Reset buttons don't work if board is armed. But no way to use them if "Always armed". Use rescue as workaround.
+ Missing Translations, use English.
+ Radio Wizard confused by a reversed throttle, fix it on your transmitter before starting wizard.
+ [Windows 8] USB Driver is broken.
+ Firmware Update Instructions on Firmware Tab not entirely accurate for all upgrade paths.
+ Radio Wizard Throttle display does not show full range properly.
+ Tricopter's using Vehicle Wizard need to check servo does not need reversed manually.
+ XAircraft ESCs uses non-standard PPM range which may cause issues with Vehicle Wizard.
+ Spectrum Satellite Receivers setup in Radio Wizard may have wrong protocol set.
+ Old Intel 965 have an OpenGL bug that turns the QML PFD black and while.

204
Makefile
View File

@ -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
@ -32,6 +36,7 @@ $(foreach var, $(SANITIZE_DEPRECATED_VARS), $(eval $(call SANITIZE_VAR,$(var),de
QT_SPEC=win32-g++
UAVOBJGENERATOR="$(BUILD_DIR)/ground/uavobjgenerator/debug/uavobjgenerator.exe"
UNAME := $(shell uname)
ARCH := $(shell uname -m)
ifeq ($(UNAME), Linux)
QT_SPEC=linux-g++
UAVOBJGENERATOR="$(BUILD_DIR)/ground/uavobjgenerator/uavobjgenerator"
@ -73,6 +78,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"
@ -163,10 +169,16 @@ $(BUILD_DIR):
QT_SDK_DIR := $(TOOLS_DIR)/qtsdk-v1.2.1
.PHONY: qt_sdk_install
# Choose the appropriate installer based on host architecture
ifneq (,$(filter $(ARCH), x86_64 amd64))
# 64-bit
qt_sdk_install: QT_SDK_FILE := QtSdk-offline-linux-x86_64-v1.2.1.run
qt_sdk_install: QT_SDK_URL := http://www.developer.nokia.com/dp?uri=http://sw.nokia.com/id/14b2039c-0e1f-4774-a4f2-9aa60b6d5313/Qt_SDK_Lin64_offline
else
# 32-bit
qt_sdk_install: QT_SDK_URL := http://www.developer.nokia.com/dp?uri=http://sw.nokia.com/id/8ea74da4-fec1-4277-8b26-c58cc82e204b/Qt_SDK_Lin32_offline
qt_sdk_install: QT_SDK_FILE := QtSdk-offline-linux-x86-v1.2.1.run
#qt_sdk_install: QT_SDK_URL := http://www.developer.nokia.com/dp?uri=http://sw.nokia.com/id/c365bbf5-c2b9-4dda-9c1f-34b2c8d07785/Qt_SDK_Lin32_offline_v1_1_2
#qt_sdk_install: QT_SDK_FILE := Qt_SDK_Lin32_offline_v1_1_2_en.run
endif
# order-only prereq on directory existance:
qt_sdk_install : | $(DL_DIR) $(TOOLS_DIR)
qt_sdk_install: qt_sdk_clean
@ -428,6 +440,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 +493,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 +559,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 $$(call toprel, $$@) -xf $$(call toprel, $$<) || 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
# The sed bit truncates the UAVO hash to 16 hex digits
$$(V1) python $$(ROOT_DIR)/make/scripts/version-info.py \
--path=$$(ROOT_DIR) \
--uavodir=$$(UAVO_COLLECTION_DIR)/$(1)/uavo-xml/shared/uavobjectdefinition \
--format='$$$${UAVOSHA1TXT}' | \
sed -e 's|\(................\).*|\1|' > $$@
$$(V0) @echo " UAVOHASH $(1) ->" $$$$(cat $$(UAVO_COLLECTION_DIR)/$(1)/uavohash)
# Generate the java uavobjects for this UAVO collection
$$(UAVO_COLLECTION_DIR)/$(1)/java-build/java: $$(UAVO_COLLECTION_DIR)/$(1)/uavohash
$$(V0) @echo " UAVOJAVA $(1) " $$$$(cat $$(UAVO_COLLECTION_DIR)/$(1)/uavohash)
$$(V1) mkdir -p $$@
$$(V1) ( \
cd $$(UAVO_COLLECTION_DIR)/$(1)/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)/java-build/uavobjects.jar: | $$(ANDROIDGCS_ASSETS_DIR)/uavos
$$(UAVO_COLLECTION_DIR)/$(1)/java-build/uavobjects.jar: $$(UAVO_COLLECTION_DIR)/$(1)/java-build/java
$$(V0) @echo " UAVOJAR $(1) " $$$$(cat $$(UAVO_COLLECTION_DIR)/$(1)/uavohash)
$$(V1) ( \
HASH=$$$$(cat $$(UAVO_COLLECTION_DIR)/$(1)/uavohash) && \
cd $$(UAVO_COLLECTION_DIR)/$(1)/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)/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
@ -774,6 +969,11 @@ sim_osx_%: uavobjects_flight
# Packaging components
#
##############################
.PHONY: package
package:
$(V1) cd $@ && $(MAKE) --no-print-directory $@
.PHONY: package_resources
package_resources:
$(V1) cd package && $(MAKE) --no-print-directory opfw_resource

View File

@ -2,7 +2,6 @@
<classpath>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="tests"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>

View File

@ -58,4 +58,4 @@
<service android:name="org.openpilot.androidgcs.telemetry.OPTelemetryService"></service>
</application>
</manifest>
</manifest>

1
androidgcs/assets/uavos Symbolic link
View File

@ -0,0 +1 @@
../../build/androidgcs/assets/uavos

View File

@ -2,14 +2,12 @@
<resources>
<string-array name="connectTypeArray">
<item>None</item>
<item>Fake</item>
<item>Bluetooth</item>
<item>Network</item>
<item>HID</item>
</string-array>
<string-array name="connectTypeValues">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>

View File

@ -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);

View File

@ -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;

View File

@ -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,137 @@ 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);
}
}
Intent intent = new Intent();
intent.setAction(INTENT_ACTION_CONNECTED);
sendBroadcast(intent,null);
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);
String[] list;
try {
list = assetManager.list("uavos/");
Log.i(TAG, "Listing found uavos");
for(int i = 0; i < list.length; i++) {
Log.i(TAG, "Found: " + list[i]);
}
//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");
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
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);
/**
* 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);
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;
File jarsDir = getDir(JAR_DIR, MODE_WORLD_READABLE);
if (jarsDir.exists())
deleteDirectoryContents(jarsDir);
@Override
public UAVObjectManager getObjectManager() { return objMngr; };
copyAssets(JAR_DIR, jar);
BTTelemetryThread() {
objMngr = new UAVObjectManager();
UAVObjectsInitialize.register(objMngr);
Log.d(TAG, "Starting dex loader");
File dexDir = getDir(DEX_DIR, Context.MODE_WORLD_READABLE);
// Necessary to get dexOpt to run
if (dexDir.exists())
deleteDirectoryContents(dexDir);
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;
}
}

View File

@ -10,7 +10,7 @@ import org.openpilot.uavtalk.Telemetry;
import org.openpilot.uavtalk.TelemetryMonitor;
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;
@ -103,7 +103,7 @@ 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);
// Create the required telemetry objects attached to this
// data stream

View File

@ -202,7 +202,7 @@ public class Telemetry {
/**
* Register a new object for periodic updates (if enabled)
*/
private synchronized void registerObject(UAVObject obj) {
private void registerObject(UAVObject obj) {
// Setup object for periodic updates
addObject(obj);
@ -213,24 +213,27 @@ public class Telemetry {
/**
* Add an object in the list used for periodic updates
*/
private synchronized void addObject(UAVObject obj) {
// Check if object type is already in the list
ListIterator<ObjectTimeInfo> li = objList.listIterator();
while (li.hasNext()) {
ObjectTimeInfo n = li.next();
if (n.obj.getObjID() == obj.getObjID()) {
// Object type (not instance!) is already in the list, do
// nothing
return;
}
}
private void addObject(UAVObject obj) {
// If this point is reached, then the object type is new, let's add it
ObjectTimeInfo timeInfo = new ObjectTimeInfo();
timeInfo.obj = obj;
timeInfo.timeToNextUpdateMs = 0;
timeInfo.updatePeriodMs = 0;
objList.add(timeInfo);
synchronized (objList) {
// Check if object type is already in the list
ListIterator<ObjectTimeInfo> li = objList.listIterator();
while (li.hasNext()) {
ObjectTimeInfo n = li.next();
if (n.obj.getObjID() == obj.getObjID()) {
// Object type (not instance!) is already in the list, do
// nothing
return;
}
}
// If this point is reached, then the object type is new, let's add it
ObjectTimeInfo timeInfo = new ObjectTimeInfo();
timeInfo.obj = obj;
timeInfo.timeToNextUpdateMs = 0;
timeInfo.updatePeriodMs = 0;
objList.add(timeInfo);
}
}
/**
@ -281,7 +284,7 @@ public class Telemetry {
* Connect to all instances of an object depending on the event mask
* specified
*/
private synchronized void connectToObjectInstances(UAVObject obj,
private void connectToObjectInstances(UAVObject obj,
int eventMask) {
List<UAVObject> objs = objMngr.getObjectInstances(obj.getObjID());
ListIterator<UAVObject> li = objs.listIterator();
@ -312,43 +315,46 @@ public class Telemetry {
* Update an object based on its metadata properties
*/
private void updateObject(UAVObject obj) {
// Get metadata
UAVObject.Metadata metadata = obj.getMetadata();
// Setup object depending on update mode
int eventMask;
if (metadata.GetGcsTelemetryUpdateMode() == UAVObject.UpdateMode.UPDATEMODE_PERIODIC) {
// Set update period
setUpdatePeriod(obj, metadata.gcsTelemetryUpdatePeriod);
// Connect signals for all instances
eventMask = EV_UPDATED_MANUAL | EV_UPDATE_REQ;
if (obj.isMetadata())
eventMask |= EV_UNPACKED; // we also need to act on remote
// updates (unpack events)
synchronized(obj) {
// Get metadata
UAVObject.Metadata metadata = obj.getMetadata();
connectToObjectInstances(obj, eventMask);
} else if (metadata.GetGcsTelemetryUpdateMode() == UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) {
// Set update period
setUpdatePeriod(obj, 0);
// Connect signals for all instances
eventMask = EV_UPDATED | EV_UPDATED_MANUAL | EV_UPDATE_REQ;
if (obj.isMetadata())
eventMask |= EV_UNPACKED; // we also need to act on remote
// updates (unpack events)
// Setup object depending on update mode
int eventMask;
if (metadata.GetGcsTelemetryUpdateMode() == UAVObject.UpdateMode.UPDATEMODE_PERIODIC) {
// Set update period
setUpdatePeriod(obj, metadata.gcsTelemetryUpdatePeriod);
// Connect signals for all instances
eventMask = EV_UPDATED_MANUAL | EV_UPDATE_REQ;
if (obj.isMetadata())
eventMask |= EV_UNPACKED; // we also need to act on remote
// updates (unpack events)
connectToObjectInstances(obj, eventMask);
} else if (metadata.GetGcsTelemetryUpdateMode() == UAVObject.UpdateMode.UPDATEMODE_THROTTLED) {
// TODO
} else if (metadata.GetGcsTelemetryUpdateMode() == UAVObject.UpdateMode.UPDATEMODE_MANUAL) {
// Set update period
setUpdatePeriod(obj, 0);
// Connect signals for all instances
eventMask = EV_UPDATED_MANUAL | EV_UPDATE_REQ;
if (obj.isMetadata())
eventMask |= EV_UNPACKED; // we also need to act on remote
// updates (unpack events)
connectToObjectInstances(obj, eventMask);
} else if (metadata.GetGcsTelemetryUpdateMode() == UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) {
// Set update period
setUpdatePeriod(obj, 0);
// Connect signals for all instances
eventMask = EV_UPDATED | EV_UPDATED_MANUAL | EV_UPDATE_REQ;
if (obj.isMetadata())
eventMask |= EV_UNPACKED; // we also need to act on remote
// updates (unpack events)
connectToObjectInstances(obj, eventMask);
connectToObjectInstances(obj, eventMask);
} else if (metadata.GetGcsTelemetryUpdateMode() == UAVObject.UpdateMode.UPDATEMODE_THROTTLED) {
// TODO
} else if (metadata.GetGcsTelemetryUpdateMode() == UAVObject.UpdateMode.UPDATEMODE_MANUAL) {
// Set update period
setUpdatePeriod(obj, 0);
// Connect signals for all instances
eventMask = EV_UPDATED_MANUAL | EV_UPDATE_REQ;
if (obj.isMetadata())
eventMask |= EV_UNPACKED; // we also need to act on remote
// updates (unpack events)
connectToObjectInstances(obj, eventMask);
}
}
}
@ -448,7 +454,7 @@ public class Telemetry {
registerObject(obj);
}
private synchronized void newInstance(UAVObject obj) {
private void newInstance(UAVObject obj) {
registerObject(obj);
}
@ -632,11 +638,7 @@ public class Telemetry {
return;
}
// Store this as the active transaction
transPending = newTransactionPending;
transInfo = newTrans;
if (DEBUG) Log.d(TAG, "Process Object transaction for " + transInfo.obj.getName());
if (DEBUG) Log.d(TAG, "Process Object transaction for " + newTrans.obj.getName());
// Remove this one from the list of pending transactions
handler.removeActivatedQueue(objInfo);
@ -644,12 +646,12 @@ public class Telemetry {
try {
// 3. Execute transaction by sending the appropriate UAVTalk command
if (transInfo.objRequest) {
if (DEBUG) Log.d(TAG, "Sending object request " + transInfo.obj.getName());
utalk.sendObjectRequest(transInfo.obj, transInfo.allInstances);
if (newTrans.objRequest) {
if (DEBUG) Log.d(TAG, "Sending object request " + newTrans.obj.getName());
utalk.sendObjectRequest(newTrans.obj, newTrans.allInstances);
} else {
if (DEBUG) Log.d(TAG, "Sending object " + transInfo.obj.getName());
utalk.sendObject(transInfo.obj, transInfo.acked, transInfo.allInstances);
if (DEBUG) Log.d(TAG, "Sending object " + newTrans.obj.getName());
utalk.sendObject(newTrans.obj, newTrans.acked, newTrans.allInstances);
}
} catch (IOException e) {
@ -657,9 +659,17 @@ public class Telemetry {
e.printStackTrace();
}
// Post a timeout timer if a response is epxected
if (transPending)
// Store this as the active transaction. However in the case
// of transPending && !newTransactionPending we need ot not
// override the previous pending transaction
if (!transPending && newTransactionPending) {
transPending = newTransactionPending;
transInfo = newTrans;
// Post a timeout timer if a response is epxected
handler.postDelayed(transactionTimeout, REQ_TIMEOUT_MS);
}
}
}
}
@ -744,7 +754,7 @@ public class Telemetry {
//Send signal
obj.transactionCompleted(result);
} else {
if (ERROR) Log.e(TAG, "Error: received a transaction completed when did not expect it.");
if (ERROR) Log.e(TAG, "Error: received a transaction completed when did not expect it. " + obj.getName());
transPending = false;
}
}

View File

@ -54,9 +54,12 @@ public class TelemetryMonitor extends Observable {
private final UAVObjectManager objMngr;
private final Telemetry tel;
private boolean objectsRegistered;
// private UAVObject objPending;
private UAVObject gcsStatsObj;
private UAVObject flightStatsObj;
private final UAVObject firmwareIapObj;
private Timer periodicTask;
private int currentPeriod;
private long lastUpdateTime;
@ -74,7 +77,8 @@ public class TelemetryMonitor extends Observable {
return objects_updated;
};
public TelemetryMonitor(UAVObjectManager objMngr, Telemetry tel, OPTelemetryService s) {
public TelemetryMonitor(UAVObjectManager objMngr, Telemetry tel,
OPTelemetryService s) {
this(objMngr, tel);
telemService = s;
}
@ -85,9 +89,15 @@ public class TelemetryMonitor extends Observable {
// this.objPending = null;
queue = new ArrayList<UAVObject>();
objectsRegistered = false;
// Get stats objects
gcsStatsObj = objMngr.getObject("GCSTelemetryStats");
flightStatsObj = objMngr.getObject("FlightTelemetryStats");
firmwareIapObj = objMngr.getObject("FirmwareIAPObj");
// The first update of the firmwareIapObj will trigger registering the objects
firmwareIapObj.addUpdatedObserver(firmwareIapUpdated);
flightStatsObj.addUpdatedObserver(new Observer() {
@Override
@ -360,8 +370,13 @@ public class TelemetryMonitor extends Observable {
setPeriod(STATS_UPDATE_PERIOD_MS);
connected = true;
objects_updated = false;
startRetrievingObjects();
if (HANDSHAKE_IS_CONNECTED) setChanged(); // Enabling this line makes the opConnected signal occur whenever we get a handshake
if (objectsRegistered)
startRetrievingObjects();
else
firmwareIapObj.updateRequested();
if (HANDSHAKE_IS_CONNECTED)
setChanged(); // Enabling this line makes the opConnected signal
// occur whenever we get a handshake
}
if (gcsDisconnected && gcsStatusChanged) {
if (DEBUG)
@ -405,4 +420,37 @@ public class TelemetryMonitor extends Observable {
periodicTask = null;
}
private final Observer firmwareIapUpdated = new Observer() {
@Override
public void update(Observable observable, Object data) {
if (DEBUG) Log.d(TAG, "Received firmware IAP Updated message");
UAVObjectField description = firmwareIapObj.getField("Description");
if (description == null || description.getNumElements() < 100) {
telemService.toastMessage("Failed to determine UAVO set");
} else {
final int HASH_SIZE_USED = 8;
String jarName = new String();
for (int i = 0; i < HASH_SIZE_USED; i++) {
jarName += String.format("%02x", (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");
objectsRegistered = true;
try {
startRetrievingObjects();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} else
telemService.toastMessage("Failed to load UAVO set: " + jarName);
}
firmwareIapObj.removeUpdatedObserver(this);
}
};
}

View File

@ -70,7 +70,6 @@ public class UAVObjectManager {
*/
public synchronized boolean registerObject(UAVDataObject obj) throws Exception
{
// QMutexLocker locker(mutex);
ListIterator<List<UAVObject>> objIt = objects.listIterator(0);

View File

@ -269,16 +269,18 @@ public class UAVTalk {
* it wants to give up on one (after a timeout) then it can cancel it
* @return True if that object was pending, False otherwise
*/
public synchronized boolean cancelPendingTransaction(UAVObject obj) {
if(respObj != null && respObj.getObjID() == obj.getObjID()) {
if(transactionListener != null) {
Log.d(TAG,"Canceling transaction: " + respObj.getName());
transactionListener.TransactionFailed(respObj);
}
respObj = null;
return true;
} else
return false;
public boolean cancelPendingTransaction(UAVObject obj) {
synchronized (respObj) {
if(respObj != null && respObj.getObjID() == obj.getObjID()) {
if(transactionListener != null) {
Log.d(TAG,"Canceling transaction: " + respObj.getName());
transactionListener.TransactionFailed(respObj);
}
respObj = null;
return true;
} else
return false;
}
}
/**
@ -296,15 +298,16 @@ public class UAVTalk {
/**
* This is the code that sets up a new UAVTalk packet that expects a response.
*/
private synchronized void setupTransaction(UAVObject obj, boolean allInstances, int type) {
private void setupTransaction(UAVObject obj, boolean allInstances, int type) {
synchronized (this) {
// Only cancel if it is for a different object
if(respObj != null && respObj.getObjID() != obj.getObjID())
cancelPendingTransaction(obj);
// Only cancel if it is for a different object
if(respObj != null && respObj.getObjID() != obj.getObjID())
cancelPendingTransaction(obj);
respObj = obj;
respAllInstances = allInstances;
respType = type;
respObj = obj;
respAllInstances = allInstances;
respType = type;
}
}
/**
@ -315,7 +318,7 @@ public class UAVTalk {
* Success (true), Failure (false)
* @throws IOException
*/
private synchronized boolean objectTransaction(UAVObject obj, int type, boolean allInstances) throws IOException {
private boolean objectTransaction(UAVObject obj, int type, boolean allInstances) throws IOException {
if (type == TYPE_OBJ_ACK || type == TYPE_OBJ_REQ || type == TYPE_OBJ) {
return transmitObject(obj, type, allInstances);
} else {
@ -415,7 +418,7 @@ public class UAVTalk {
{
UAVObject rxObj = objMngr.getObject(rxObjId);
if (rxObj == null) {
if (DEBUG) Log.d(TAG, "Unknown ID: " + rxObjId);
if (WARN) Log.w(TAG, "Unknown ID: " + rxObjId);
stats.rxErrors++;
rxState = RxStateType.STATE_SYNC;
break;
@ -429,17 +432,7 @@ public class UAVTalk {
// Check length and determine next state
if (rxLength >= MAX_PAYLOAD_LENGTH) {
stats.rxErrors++;
rxState = RxStateType.STATE_SYNC;
break;
}
// Check the lengths match
if ((rxPacketLength + rxLength) != packetSize) { // packet error
// -
// mismatched
// packet
// size
if (WARN) Log.w(TAG, "Greater than max payload length");
stats.rxErrors++;
rxState = RxStateType.STATE_SYNC;
break;
@ -503,7 +496,7 @@ public class UAVTalk {
rxCSPacket = rxbyte;
if (rxCS != rxCSPacket) { // packet error - faulty CRC
if (DEBUG) Log.d(TAG,"Bad crc");
if (WARN) Log.w(TAG,"Bad crc");
stats.rxErrors++;
rxState = RxStateType.STATE_SYNC;
break;
@ -512,7 +505,7 @@ public class UAVTalk {
if (rxPacketLength != (packetSize + 1)) { // packet error -
// mismatched packet
// size
if (DEBUG) Log.d(TAG,"Bad size");
if (WARN) Log.w(TAG,"Bad size");
stats.rxErrors++;
rxState = RxStateType.STATE_SYNC;
break;
@ -529,6 +522,7 @@ public class UAVTalk {
break;
default:
if (WARN) Log.w(TAG, "Bad state");
rxState = RxStateType.STATE_SYNC;
stats.rxErrors++;
}
@ -701,21 +695,30 @@ public class UAVTalk {
* Called when an object is received to check if this completes
* a UAVTalk transaction
*/
private synchronized void updateObjReq(UAVObject obj) {
private void updateObjReq(UAVObject obj) {
// Check if this is not a possible candidate
Assert.assertNotNull(obj);
if(respObj != null && respType == TYPE_OBJ_REQ && respObj.getObjID() == obj.getObjID() &&
((respObj.getInstID() == obj.getInstID() || !respAllInstances))) {
boolean succeeded = false;
// Indicate complete
respObj = null;
// The lock on UAVTalk must be release before the transaction succeeded signal is sent
// because otherwise if a transaction timeout occurs at the same time we can get a
// deadlock:
// 1. processInputStream -> updateObjReq (locks uavtalk) -> tranactionCompleted (locks transInfo)
// 2. transactionTimeout (locks transInfo) -> sendObjectRequest -> É -> setupTransaction (locks uavtalk)
synchronized(this) {
if(respObj != null && respType == TYPE_OBJ_REQ && respObj.getObjID() == obj.getObjID() &&
((respObj.getInstID() == obj.getInstID() || !respAllInstances))) {
// Notify listener
if (transactionListener != null)
transactionListener.TransactionSucceeded(obj);
// Indicate complete
respObj = null;
succeeded = true;
}
}
// Notify listener
if (succeeded && transactionListener != null)
transactionListener.TransactionSucceeded(obj);
}
/**

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> xElemNames = new ArrayList<String>();
xElemNames.add("0");
fields.add( new UAVObjectField("x", "m/s^2", UAVObjectField.FieldType.FLOAT32, xElemNames, null) );
List<String> yElemNames = new ArrayList<String>();
yElemNames.add("0");
fields.add( new UAVObjectField("y", "m/s^2", UAVObjectField.FieldType.FLOAT32, yElemNames, null) );
List<String> zElemNames = new ArrayList<String>();
zElemNames.add("0");
fields.add( new UAVObjectField("z", "m/s^2", UAVObjectField.FieldType.FLOAT32, zElemNames, null) );
List<String> temperatureElemNames = new ArrayList<String>();
temperatureElemNames.add("0");
fields.add( new UAVObjectField("temperature", "deg C", UAVObjectField.FieldType.FLOAT32, temperatureElemNames, null) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
}
/**
* Create a clone of this object, a new instance ID must be specified.
* Do not use this function directly to create new instances, the
* UAVObjectManager should be used instead.
*/
public UAVDataObject clone(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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> AccessoryValElemNames = new ArrayList<String>();
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<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
}
/**
* Create a clone of this object, a new instance ID must be specified.
* Do not use this function directly to create new instances, the
* UAVObjectManager should be used instead.
*/
public UAVDataObject clone(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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> ChannelElemNames = new ArrayList<String>();
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<String> MaxUpdateTimeElemNames = new ArrayList<String>();
MaxUpdateTimeElemNames.add("0");
fields.add( new UAVObjectField("MaxUpdateTime", "ms", UAVObjectField.FieldType.UINT16, MaxUpdateTimeElemNames, null) );
List<String> UpdateTimeElemNames = new ArrayList<String>();
UpdateTimeElemNames.add("0");
fields.add( new UAVObjectField("UpdateTime", "ms", UAVObjectField.FieldType.UINT8, UpdateTimeElemNames, null) );
List<String> NumFailedUpdatesElemNames = new ArrayList<String>();
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<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
}
/**
* Create a clone of this object, a new instance ID must be specified.
* Do not use this function directly to create new instances, the
* UAVObjectManager should be used instead.
*/
public UAVDataObject clone(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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> RollElemNames = new ArrayList<String>();
RollElemNames.add("0");
fields.add( new UAVObjectField("Roll", "%", UAVObjectField.FieldType.FLOAT32, RollElemNames, null) );
List<String> PitchElemNames = new ArrayList<String>();
PitchElemNames.add("0");
fields.add( new UAVObjectField("Pitch", "%", UAVObjectField.FieldType.FLOAT32, PitchElemNames, null) );
List<String> YawElemNames = new ArrayList<String>();
YawElemNames.add("0");
fields.add( new UAVObjectField("Yaw", "%", UAVObjectField.FieldType.FLOAT32, YawElemNames, null) );
List<String> ThrottleElemNames = new ArrayList<String>();
ThrottleElemNames.add("0");
fields.add( new UAVObjectField("Throttle", "%", UAVObjectField.FieldType.FLOAT32, ThrottleElemNames, null) );
List<String> UpdateTimeElemNames = new ArrayList<String>();
UpdateTimeElemNames.add("0");
fields.add( new UAVObjectField("UpdateTime", "ms", UAVObjectField.FieldType.FLOAT32, UpdateTimeElemNames, null) );
List<String> NumLongUpdatesElemNames = new ArrayList<String>();
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<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
}
/**
* Create a clone of this object, a new instance ID must be specified.
* Do not use this function directly to create new instances, the
* UAVObjectManager should be used instead.
*/
public UAVDataObject clone(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;
}

View File

@ -1,273 +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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> ChannelUpdateFreqElemNames = new ArrayList<String>();
ChannelUpdateFreqElemNames.add("0");
ChannelUpdateFreqElemNames.add("1");
ChannelUpdateFreqElemNames.add("2");
ChannelUpdateFreqElemNames.add("3");
fields.add( new UAVObjectField("ChannelUpdateFreq", "Hz", UAVObjectField.FieldType.UINT16, ChannelUpdateFreqElemNames, null) );
List<String> ChannelMaxElemNames = new ArrayList<String>();
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<String> ChannelNeutralElemNames = new ArrayList<String>();
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<String> ChannelMinElemNames = new ArrayList<String>();
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<String> ChannelTypeElemNames = new ArrayList<String>();
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<String> ChannelTypeEnumOptions = new ArrayList<String>();
ChannelTypeEnumOptions.add("PWM");
ChannelTypeEnumOptions.add("MK");
ChannelTypeEnumOptions.add("ASTEC4");
ChannelTypeEnumOptions.add("PWM Alarm Buzzer");
fields.add( new UAVObjectField("ChannelType", "", UAVObjectField.FieldType.ENUM, ChannelTypeElemNames, ChannelTypeEnumOptions) );
List<String> ChannelAddrElemNames = new ArrayList<String>();
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<String> MotorsSpinWhileArmedElemNames = new ArrayList<String>();
MotorsSpinWhileArmedElemNames.add("0");
List<String> MotorsSpinWhileArmedEnumOptions = new ArrayList<String>();
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<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
getField("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 = 0x7D555646l;
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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> AltitudeElemNames = new ArrayList<String>();
AltitudeElemNames.add("0");
fields.add( new UAVObjectField("Altitude", "m", UAVObjectField.FieldType.FLOAT32, AltitudeElemNames, null) );
List<String> VelocityElemNames = new ArrayList<String>();
VelocityElemNames.add("0");
fields.add( new UAVObjectField("Velocity", "m/s", UAVObjectField.FieldType.FLOAT32, VelocityElemNames, null) );
List<String> AccelElemNames = new ArrayList<String>();
AccelElemNames.add("0");
fields.add( new UAVObjectField("Accel", "m/s^2", UAVObjectField.FieldType.FLOAT32, AccelElemNames, null) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
}
/**
* Create a clone of this object, a new instance ID must be specified.
* Do not use this function directly to create new instances, the
* UAVObjectManager should be used instead.
*/
public UAVDataObject clone(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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> AltitudeElemNames = new ArrayList<String>();
AltitudeElemNames.add("0");
fields.add( new UAVObjectField("Altitude", "m", UAVObjectField.FieldType.FLOAT32, AltitudeElemNames, null) );
List<String> RollElemNames = new ArrayList<String>();
RollElemNames.add("0");
fields.add( new UAVObjectField("Roll", "deg", UAVObjectField.FieldType.FLOAT32, RollElemNames, null) );
List<String> PitchElemNames = new ArrayList<String>();
PitchElemNames.add("0");
fields.add( new UAVObjectField("Pitch", "deg", UAVObjectField.FieldType.FLOAT32, PitchElemNames, null) );
List<String> YawElemNames = new ArrayList<String>();
YawElemNames.add("0");
fields.add( new UAVObjectField("Yaw", "deg/s", UAVObjectField.FieldType.FLOAT32, YawElemNames, null) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 1000;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
}
/**
* Create a clone of this object, a new instance ID must be specified.
* Do not use this function directly to create new instances, the
* UAVObjectManager should be used instead.
*/
public UAVDataObject clone(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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> KpElemNames = new ArrayList<String>();
KpElemNames.add("0");
fields.add( new UAVObjectField("Kp", "throttle/m", UAVObjectField.FieldType.FLOAT32, KpElemNames, null) );
List<String> KiElemNames = new ArrayList<String>();
KiElemNames.add("0");
fields.add( new UAVObjectField("Ki", "throttle/m", UAVObjectField.FieldType.FLOAT32, KiElemNames, null) );
List<String> KdElemNames = new ArrayList<String>();
KdElemNames.add("0");
fields.add( new UAVObjectField("Kd", "throttle/m", UAVObjectField.FieldType.FLOAT32, KdElemNames, null) );
List<String> KaElemNames = new ArrayList<String>();
KaElemNames.add("0");
fields.add( new UAVObjectField("Ka", "throttle/(m/s^2)", UAVObjectField.FieldType.FLOAT32, KaElemNames, null) );
List<String> PressureNoiseElemNames = new ArrayList<String>();
PressureNoiseElemNames.add("0");
fields.add( new UAVObjectField("PressureNoise", "m", UAVObjectField.FieldType.FLOAT32, PressureNoiseElemNames, null) );
List<String> AccelNoiseElemNames = new ArrayList<String>();
AccelNoiseElemNames.add("0");
fields.add( new UAVObjectField("AccelNoise", "m/s^2", UAVObjectField.FieldType.FLOAT32, AccelNoiseElemNames, null) );
List<String> AccelDriftElemNames = new ArrayList<String>();
AccelDriftElemNames.add("0");
fields.add( new UAVObjectField("AccelDrift", "m/s^2", UAVObjectField.FieldType.FLOAT32, AccelDriftElemNames, null) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
getField("Kp").setValue(0.025);
getField("Ki").setValue(0.025);
getField("Kd").setValue(0.25);
getField("Ka").setValue(0);
getField("PressureNoise").setValue(0.01);
getField("AccelNoise").setValue(10);
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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> q1ElemNames = new ArrayList<String>();
q1ElemNames.add("0");
fields.add( new UAVObjectField("q1", "", UAVObjectField.FieldType.FLOAT32, q1ElemNames, null) );
List<String> q2ElemNames = new ArrayList<String>();
q2ElemNames.add("0");
fields.add( new UAVObjectField("q2", "", UAVObjectField.FieldType.FLOAT32, q2ElemNames, null) );
List<String> q3ElemNames = new ArrayList<String>();
q3ElemNames.add("0");
fields.add( new UAVObjectField("q3", "", UAVObjectField.FieldType.FLOAT32, q3ElemNames, null) );
List<String> q4ElemNames = new ArrayList<String>();
q4ElemNames.add("0");
fields.add( new UAVObjectField("q4", "", UAVObjectField.FieldType.FLOAT32, q4ElemNames, null) );
List<String> RollElemNames = new ArrayList<String>();
RollElemNames.add("0");
fields.add( new UAVObjectField("Roll", "degrees", UAVObjectField.FieldType.FLOAT32, RollElemNames, null) );
List<String> PitchElemNames = new ArrayList<String>();
PitchElemNames.add("0");
fields.add( new UAVObjectField("Pitch", "degrees", UAVObjectField.FieldType.FLOAT32, PitchElemNames, null) );
List<String> YawElemNames = new ArrayList<String>();
YawElemNames.add("0");
fields.add( new UAVObjectField("Yaw", "degrees", UAVObjectField.FieldType.FLOAT32, YawElemNames, null) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 100;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
}
/**
* Create a clone of this object, a new instance ID must be specified.
* Do not use this function directly to create new instances, the
* UAVObjectManager should be used instead.
*/
public UAVDataObject clone(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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> GyroGainElemNames = new ArrayList<String>();
GyroGainElemNames.add("0");
fields.add( new UAVObjectField("GyroGain", "(rad/s)/lsb", UAVObjectField.FieldType.FLOAT32, GyroGainElemNames, null) );
List<String> AccelKpElemNames = new ArrayList<String>();
AccelKpElemNames.add("0");
fields.add( new UAVObjectField("AccelKp", "channel", UAVObjectField.FieldType.FLOAT32, AccelKpElemNames, null) );
List<String> AccelKiElemNames = new ArrayList<String>();
AccelKiElemNames.add("0");
fields.add( new UAVObjectField("AccelKi", "channel", UAVObjectField.FieldType.FLOAT32, AccelKiElemNames, null) );
List<String> YawBiasRateElemNames = new ArrayList<String>();
YawBiasRateElemNames.add("0");
fields.add( new UAVObjectField("YawBiasRate", "channel", UAVObjectField.FieldType.FLOAT32, YawBiasRateElemNames, null) );
List<String> AccelBiasElemNames = new ArrayList<String>();
AccelBiasElemNames.add("X");
AccelBiasElemNames.add("Y");
AccelBiasElemNames.add("Z");
fields.add( new UAVObjectField("AccelBias", "lsb", UAVObjectField.FieldType.INT16, AccelBiasElemNames, null) );
List<String> GyroBiasElemNames = new ArrayList<String>();
GyroBiasElemNames.add("X");
GyroBiasElemNames.add("Y");
GyroBiasElemNames.add("Z");
fields.add( new UAVObjectField("GyroBias", "deg/s * 100", UAVObjectField.FieldType.INT16, GyroBiasElemNames, null) );
List<String> BoardRotationElemNames = new ArrayList<String>();
BoardRotationElemNames.add("Roll");
BoardRotationElemNames.add("Pitch");
BoardRotationElemNames.add("Yaw");
fields.add( new UAVObjectField("BoardRotation", "deg", UAVObjectField.FieldType.INT16, BoardRotationElemNames, null) );
List<String> ZeroDuringArmingElemNames = new ArrayList<String>();
ZeroDuringArmingElemNames.add("0");
List<String> ZeroDuringArmingEnumOptions = new ArrayList<String>();
ZeroDuringArmingEnumOptions.add("FALSE");
ZeroDuringArmingEnumOptions.add("TRUE");
fields.add( new UAVObjectField("ZeroDuringArming", "channel", UAVObjectField.FieldType.ENUM, ZeroDuringArmingElemNames, ZeroDuringArmingEnumOptions) );
List<String> BiasCorrectGyroElemNames = new ArrayList<String>();
BiasCorrectGyroElemNames.add("0");
List<String> BiasCorrectGyroEnumOptions = new ArrayList<String>();
BiasCorrectGyroEnumOptions.add("FALSE");
BiasCorrectGyroEnumOptions.add("TRUE");
fields.add( new UAVObjectField("BiasCorrectGyro", "channel", UAVObjectField.FieldType.ENUM, BiasCorrectGyroElemNames, BiasCorrectGyroEnumOptions) );
List<String> TrimFlightElemNames = new ArrayList<String>();
TrimFlightElemNames.add("0");
List<String> TrimFlightEnumOptions = new ArrayList<String>();
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<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
getField("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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> q1ElemNames = new ArrayList<String>();
q1ElemNames.add("0");
fields.add( new UAVObjectField("q1", "", UAVObjectField.FieldType.FLOAT32, q1ElemNames, null) );
List<String> q2ElemNames = new ArrayList<String>();
q2ElemNames.add("0");
fields.add( new UAVObjectField("q2", "", UAVObjectField.FieldType.FLOAT32, q2ElemNames, null) );
List<String> q3ElemNames = new ArrayList<String>();
q3ElemNames.add("0");
fields.add( new UAVObjectField("q3", "", UAVObjectField.FieldType.FLOAT32, q3ElemNames, null) );
List<String> q4ElemNames = new ArrayList<String>();
q4ElemNames.add("0");
fields.add( new UAVObjectField("q4", "", UAVObjectField.FieldType.FLOAT32, q4ElemNames, null) );
List<String> RollElemNames = new ArrayList<String>();
RollElemNames.add("0");
fields.add( new UAVObjectField("Roll", "degrees", UAVObjectField.FieldType.FLOAT32, RollElemNames, null) );
List<String> PitchElemNames = new ArrayList<String>();
PitchElemNames.add("0");
fields.add( new UAVObjectField("Pitch", "degrees", UAVObjectField.FieldType.FLOAT32, PitchElemNames, null) );
List<String> YawElemNames = new ArrayList<String>();
YawElemNames.add("0");
fields.add( new UAVObjectField("Yaw", "degrees", UAVObjectField.FieldType.FLOAT32, YawElemNames, null) );
List<String> VelocityElemNames = new ArrayList<String>();
VelocityElemNames.add("North");
VelocityElemNames.add("East");
VelocityElemNames.add("Down");
fields.add( new UAVObjectField("Velocity", "m/s", UAVObjectField.FieldType.FLOAT32, VelocityElemNames, null) );
List<String> PositionElemNames = new ArrayList<String>();
PositionElemNames.add("North");
PositionElemNames.add("East");
PositionElemNames.add("Down");
fields.add( new UAVObjectField("Position", "m", UAVObjectField.FieldType.FLOAT32, PositionElemNames, null) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 100;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
}
/**
* Create a clone of this object, a new instance ID must be specified.
* Do not use this function directly to create new instances, the
* UAVObjectManager should be used instead.
*/
public UAVDataObject clone(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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> AirspeedElemNames = new ArrayList<String>();
AirspeedElemNames.add("0");
fields.add( new UAVObjectField("Airspeed", "m/s", UAVObjectField.FieldType.FLOAT32, AirspeedElemNames, null) );
List<String> SensorValueElemNames = new ArrayList<String>();
SensorValueElemNames.add("0");
fields.add( new UAVObjectField("SensorValue", "raw", UAVObjectField.FieldType.UINT16, SensorValueElemNames, null) );
List<String> ZeroPointElemNames = new ArrayList<String>();
ZeroPointElemNames.add("0");
fields.add( new UAVObjectField("ZeroPoint", "raw", UAVObjectField.FieldType.UINT16, ZeroPointElemNames, null) );
List<String> ConnectedElemNames = new ArrayList<String>();
ConnectedElemNames.add("0");
List<String> ConnectedEnumOptions = new ArrayList<String>();
ConnectedEnumOptions.add("False");
ConnectedEnumOptions.add("True");
fields.add( new UAVObjectField("Connected", "", UAVObjectField.FieldType.ENUM, ConnectedElemNames, ConnectedEnumOptions) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
}
/**
* Create a clone of this object, a new instance ID must be specified.
* Do not use this function directly to create new instances, the
* UAVObjectManager should be used instead.
*/
public UAVDataObject clone(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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> AltitudeElemNames = new ArrayList<String>();
AltitudeElemNames.add("0");
fields.add( new UAVObjectField("Altitude", "m", UAVObjectField.FieldType.FLOAT32, AltitudeElemNames, null) );
List<String> TemperatureElemNames = new ArrayList<String>();
TemperatureElemNames.add("0");
fields.add( new UAVObjectField("Temperature", "C", UAVObjectField.FieldType.FLOAT32, TemperatureElemNames, null) );
List<String> PressureElemNames = new ArrayList<String>();
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<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
}
/**
* Create a clone of this object, a new instance ID must be specified.
* Do not use this function directly to create new instances, the
* UAVObjectManager should be used instead.
*/
public UAVDataObject clone(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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> RollElemNames = new ArrayList<String>();
RollElemNames.add("0");
fields.add( new UAVObjectField("Roll", "", UAVObjectField.FieldType.FLOAT32, RollElemNames, null) );
List<String> PitchElemNames = new ArrayList<String>();
PitchElemNames.add("0");
fields.add( new UAVObjectField("Pitch", "", UAVObjectField.FieldType.FLOAT32, PitchElemNames, null) );
List<String> YawElemNames = new ArrayList<String>();
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<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
}
/**
* Create a clone of this object, a new instance ID must be specified.
* Do not use this function directly to create new instances, the
* UAVObjectManager should be used instead.
*/
public UAVDataObject clone(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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> MaxAxisLockRateElemNames = new ArrayList<String>();
MaxAxisLockRateElemNames.add("0");
fields.add( new UAVObjectField("MaxAxisLockRate", "deg/s", UAVObjectField.FieldType.FLOAT32, MaxAxisLockRateElemNames, null) );
List<String> ResponseTimeElemNames = new ArrayList<String>();
ResponseTimeElemNames.add("Roll");
ResponseTimeElemNames.add("Pitch");
ResponseTimeElemNames.add("Yaw");
fields.add( new UAVObjectField("ResponseTime", "ms", UAVObjectField.FieldType.UINT16, ResponseTimeElemNames, null) );
List<String> InputElemNames = new ArrayList<String>();
InputElemNames.add("Roll");
InputElemNames.add("Pitch");
InputElemNames.add("Yaw");
List<String> InputEnumOptions = new ArrayList<String>();
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<String> InputRangeElemNames = new ArrayList<String>();
InputRangeElemNames.add("Roll");
InputRangeElemNames.add("Pitch");
InputRangeElemNames.add("Yaw");
fields.add( new UAVObjectField("InputRange", "deg", UAVObjectField.FieldType.UINT8, InputRangeElemNames, null) );
List<String> InputRateElemNames = new ArrayList<String>();
InputRateElemNames.add("Roll");
InputRateElemNames.add("Pitch");
InputRateElemNames.add("Yaw");
fields.add( new UAVObjectField("InputRate", "deg/s", UAVObjectField.FieldType.UINT8, InputRateElemNames, null) );
List<String> StabilizationModeElemNames = new ArrayList<String>();
StabilizationModeElemNames.add("Roll");
StabilizationModeElemNames.add("Pitch");
StabilizationModeElemNames.add("Yaw");
List<String> StabilizationModeEnumOptions = new ArrayList<String>();
StabilizationModeEnumOptions.add("Attitude");
StabilizationModeEnumOptions.add("AxisLock");
fields.add( new UAVObjectField("StabilizationMode", "", UAVObjectField.FieldType.ENUM, StabilizationModeElemNames, StabilizationModeEnumOptions) );
List<String> OutputRangeElemNames = new ArrayList<String>();
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<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
getField("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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> ActivateFaultElemNames = new ArrayList<String>();
ActivateFaultElemNames.add("0");
List<String> ActivateFaultEnumOptions = new ArrayList<String>();
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<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
getField("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;
}

View File

@ -104,6 +104,66 @@ public class FirmwareIAPObj extends UAVDataObject {
DescriptionElemNames.add("37");
DescriptionElemNames.add("38");
DescriptionElemNames.add("39");
DescriptionElemNames.add("40");
DescriptionElemNames.add("41");
DescriptionElemNames.add("42");
DescriptionElemNames.add("43");
DescriptionElemNames.add("44");
DescriptionElemNames.add("45");
DescriptionElemNames.add("46");
DescriptionElemNames.add("47");
DescriptionElemNames.add("48");
DescriptionElemNames.add("49");
DescriptionElemNames.add("50");
DescriptionElemNames.add("51");
DescriptionElemNames.add("52");
DescriptionElemNames.add("53");
DescriptionElemNames.add("54");
DescriptionElemNames.add("55");
DescriptionElemNames.add("56");
DescriptionElemNames.add("57");
DescriptionElemNames.add("58");
DescriptionElemNames.add("59");
DescriptionElemNames.add("60");
DescriptionElemNames.add("61");
DescriptionElemNames.add("62");
DescriptionElemNames.add("63");
DescriptionElemNames.add("64");
DescriptionElemNames.add("65");
DescriptionElemNames.add("66");
DescriptionElemNames.add("67");
DescriptionElemNames.add("68");
DescriptionElemNames.add("69");
DescriptionElemNames.add("70");
DescriptionElemNames.add("71");
DescriptionElemNames.add("72");
DescriptionElemNames.add("73");
DescriptionElemNames.add("74");
DescriptionElemNames.add("75");
DescriptionElemNames.add("76");
DescriptionElemNames.add("77");
DescriptionElemNames.add("78");
DescriptionElemNames.add("79");
DescriptionElemNames.add("80");
DescriptionElemNames.add("81");
DescriptionElemNames.add("82");
DescriptionElemNames.add("83");
DescriptionElemNames.add("84");
DescriptionElemNames.add("85");
DescriptionElemNames.add("86");
DescriptionElemNames.add("87");
DescriptionElemNames.add("88");
DescriptionElemNames.add("89");
DescriptionElemNames.add("90");
DescriptionElemNames.add("91");
DescriptionElemNames.add("92");
DescriptionElemNames.add("93");
DescriptionElemNames.add("94");
DescriptionElemNames.add("95");
DescriptionElemNames.add("96");
DescriptionElemNames.add("97");
DescriptionElemNames.add("98");
DescriptionElemNames.add("99");
fields.add( new UAVObjectField("Description", "", UAVObjectField.FieldType.UINT8, DescriptionElemNames, null) );
List<String> CPUSerialElemNames = new ArrayList<String>();
@ -201,7 +261,7 @@ public class FirmwareIAPObj extends UAVDataObject {
}
// Constants
protected static final long OBJID = 0x3CCDFB68l;
protected static final long OBJID = 0x5E6E8FDCl;
protected static final String NAME = "FirmwareIAPObj";
protected static String DESCRIPTION = "Queries board for SN, model, revision, and sends reset command";
protected static final boolean ISSINGLEINST = 1 > 0;

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> AirSpeedMaxElemNames = new ArrayList<String>();
AirSpeedMaxElemNames.add("0");
fields.add( new UAVObjectField("AirSpeedMax", "m/s", UAVObjectField.FieldType.FLOAT32, AirSpeedMaxElemNames, null) );
List<String> AirSpeedMinElemNames = new ArrayList<String>();
AirSpeedMinElemNames.add("0");
fields.add( new UAVObjectField("AirSpeedMin", "m/s", UAVObjectField.FieldType.FLOAT32, AirSpeedMinElemNames, null) );
List<String> VerticalVelMaxElemNames = new ArrayList<String>();
VerticalVelMaxElemNames.add("0");
fields.add( new UAVObjectField("VerticalVelMax", "m/s", UAVObjectField.FieldType.FLOAT32, VerticalVelMaxElemNames, null) );
List<String> HorizontalPosPElemNames = new ArrayList<String>();
HorizontalPosPElemNames.add("0");
fields.add( new UAVObjectField("HorizontalPosP", "(m/s)/m", UAVObjectField.FieldType.FLOAT32, HorizontalPosPElemNames, null) );
List<String> VerticalPosPElemNames = new ArrayList<String>();
VerticalPosPElemNames.add("0");
fields.add( new UAVObjectField("VerticalPosP", "(m/s)/m", UAVObjectField.FieldType.FLOAT32, VerticalPosPElemNames, null) );
List<String> CoursePIElemNames = new ArrayList<String>();
CoursePIElemNames.add("Kp");
CoursePIElemNames.add("Ki");
CoursePIElemNames.add("ILimit");
fields.add( new UAVObjectField("CoursePI", "deg/deg", UAVObjectField.FieldType.FLOAT32, CoursePIElemNames, null) );
List<String> SpeedPElemNames = new ArrayList<String>();
SpeedPElemNames.add("Kp");
SpeedPElemNames.add("Max");
fields.add( new UAVObjectField("SpeedP", "(m/s^2) / ((m/s)/(m/s)", UAVObjectField.FieldType.FLOAT32, SpeedPElemNames, null) );
List<String> AccelPIElemNames = new ArrayList<String>();
AccelPIElemNames.add("Kp");
AccelPIElemNames.add("Ki");
AccelPIElemNames.add("ILimit");
fields.add( new UAVObjectField("AccelPI", "deg / (m/s^2)", UAVObjectField.FieldType.FLOAT32, AccelPIElemNames, null) );
List<String> VerticalToPitchCrossFeedElemNames = new ArrayList<String>();
VerticalToPitchCrossFeedElemNames.add("Kp");
VerticalToPitchCrossFeedElemNames.add("Max");
fields.add( new UAVObjectField("VerticalToPitchCrossFeed", "deg / ((m/s)/(m/s))", UAVObjectField.FieldType.FLOAT32, VerticalToPitchCrossFeedElemNames, null) );
List<String> AirspeedToVerticalCrossFeedElemNames = new ArrayList<String>();
AirspeedToVerticalCrossFeedElemNames.add("Kp");
AirspeedToVerticalCrossFeedElemNames.add("Max");
fields.add( new UAVObjectField("AirspeedToVerticalCrossFeed", "(m/s) / ((m/s)/(m/s))", UAVObjectField.FieldType.FLOAT32, AirspeedToVerticalCrossFeedElemNames, null) );
List<String> PowerPIElemNames = new ArrayList<String>();
PowerPIElemNames.add("Kp");
PowerPIElemNames.add("Ki");
PowerPIElemNames.add("ILimit");
fields.add( new UAVObjectField("PowerPI", "1/(m/s)", UAVObjectField.FieldType.FLOAT32, PowerPIElemNames, null) );
List<String> RollLimitElemNames = new ArrayList<String>();
RollLimitElemNames.add("Min");
RollLimitElemNames.add("Neutral");
RollLimitElemNames.add("Max");
fields.add( new UAVObjectField("RollLimit", "deg", UAVObjectField.FieldType.FLOAT32, RollLimitElemNames, null) );
List<String> PitchLimitElemNames = new ArrayList<String>();
PitchLimitElemNames.add("Min");
PitchLimitElemNames.add("Neutral");
PitchLimitElemNames.add("Max");
fields.add( new UAVObjectField("PitchLimit", "deg", UAVObjectField.FieldType.FLOAT32, PitchLimitElemNames, null) );
List<String> ThrottleLimitElemNames = new ArrayList<String>();
ThrottleLimitElemNames.add("Min");
ThrottleLimitElemNames.add("Neutral");
ThrottleLimitElemNames.add("Max");
fields.add( new UAVObjectField("ThrottleLimit", "", UAVObjectField.FieldType.FLOAT32, ThrottleLimitElemNames, null) );
List<String> UpdatePeriodElemNames = new ArrayList<String>();
UpdatePeriodElemNames.add("0");
fields.add( new UAVObjectField("UpdatePeriod", "ms", UAVObjectField.FieldType.INT32, UpdatePeriodElemNames, null) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
getField("AirSpeedMax").setValue(15);
getField("AirSpeedMin").setValue(10);
getField("VerticalVelMax").setValue(10);
getField("HorizontalPosP").setValue(0.05);
getField("VerticalPosP").setValue(0.05);
getField("CoursePI").setValue(0.2,0);
getField("CoursePI").setValue(0,1);
getField("CoursePI").setValue(0,2);
getField("SpeedP").setValue(10,0);
getField("SpeedP").setValue(10,1);
getField("AccelPI").setValue(1.5,0);
getField("AccelPI").setValue(1.5,1);
getField("AccelPI").setValue(20,2);
getField("VerticalToPitchCrossFeed").setValue(50,0);
getField("VerticalToPitchCrossFeed").setValue(5,1);
getField("AirspeedToVerticalCrossFeed").setValue(100,0);
getField("AirspeedToVerticalCrossFeed").setValue(100,1);
getField("PowerPI").setValue(0.01,0);
getField("PowerPI").setValue(0.01,1);
getField("PowerPI").setValue(0.8,2);
getField("RollLimit").setValue(-35,0);
getField("RollLimit").setValue(0,1);
getField("RollLimit").setValue(35,2);
getField("PitchLimit").setValue(-10,0);
getField("PitchLimit").setValue(5,1);
getField("PitchLimit").setValue(20,2);
getField("ThrottleLimit").setValue(0.1,0);
getField("ThrottleLimit").setValue(0.5,1);
getField("ThrottleLimit").setValue(0.9,2);
getField("UpdatePeriod").setValue(100);
}
/**
* Create a clone of this object, a new instance ID must be specified.
* Do not use this function directly to create new instances, the
* UAVObjectManager should be used instead.
*/
public UAVDataObject clone(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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> EElemNames = new ArrayList<String>();
EElemNames.add("Course");
EElemNames.add("Speed");
EElemNames.add("Accel");
EElemNames.add("Power");
fields.add( new UAVObjectField("E", "", UAVObjectField.FieldType.FLOAT32, EElemNames, null) );
List<String> AElemNames = new ArrayList<String>();
AElemNames.add("Course");
AElemNames.add("Speed");
AElemNames.add("Accel");
AElemNames.add("Power");
fields.add( new UAVObjectField("A", "", UAVObjectField.FieldType.FLOAT32, AElemNames, null) );
List<String> CElemNames = new ArrayList<String>();
CElemNames.add("Course");
CElemNames.add("Speed");
CElemNames.add("Accel");
CElemNames.add("Power");
fields.add( new UAVObjectField("C", "", UAVObjectField.FieldType.FLOAT32, CElemNames, null) );
List<String> ErrorsElemNames = new ArrayList<String>();
ErrorsElemNames.add("Wind");
ErrorsElemNames.add("Lowspeed");
ErrorsElemNames.add("Highspeed");
ErrorsElemNames.add("Lowpower");
ErrorsElemNames.add("Highpower");
ErrorsElemNames.add("Pitchcontrol");
fields.add( new UAVObjectField("Errors", "", UAVObjectField.FieldType.UINT8, ErrorsElemNames, null) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 500;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
}
/**
* Create a clone of this object, a new instance ID must be specified.
* Do not use this function directly to create new instances, the
* UAVObjectManager should be used instead.
*/
public UAVDataObject clone(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;
}

View File

@ -1,176 +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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> CapacityElemNames = new ArrayList<String>();
CapacityElemNames.add("0");
fields.add( new UAVObjectField("Capacity", "mAh", UAVObjectField.FieldType.UINT32, CapacityElemNames, null) );
List<String> VoltageThresholdsElemNames = new ArrayList<String>();
VoltageThresholdsElemNames.add("Warning");
VoltageThresholdsElemNames.add("Alarm");
fields.add( new UAVObjectField("VoltageThresholds", "V", UAVObjectField.FieldType.FLOAT32, VoltageThresholdsElemNames, null) );
List<String> SensorCalibrationsElemNames = new ArrayList<String>();
SensorCalibrationsElemNames.add("VoltageFactor");
SensorCalibrationsElemNames.add("CurrentFactor");
fields.add( new UAVObjectField("SensorCalibrations", "", UAVObjectField.FieldType.FLOAT32, SensorCalibrationsElemNames, null) );
List<String> TypeElemNames = new ArrayList<String>();
TypeElemNames.add("0");
List<String> TypeEnumOptions = new ArrayList<String>();
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<String> NbCellsElemNames = new ArrayList<String>();
NbCellsElemNames.add("0");
fields.add( new UAVObjectField("NbCells", "", UAVObjectField.FieldType.UINT8, NbCellsElemNames, null) );
List<String> SensorTypeElemNames = new ArrayList<String>();
SensorTypeElemNames.add("0");
List<String> SensorTypeEnumOptions = new ArrayList<String>();
SensorTypeEnumOptions.add("None");
fields.add( new UAVObjectField("SensorType", "", UAVObjectField.FieldType.ENUM, SensorTypeElemNames, SensorTypeEnumOptions) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
getField("Capacity").setValue(2200);
getField("VoltageThresholds").setValue(9.8,0);
getField("VoltageThresholds").setValue(9.2,1);
getField("SensorCalibrations").setValue(1,0);
getField("SensorCalibrations").setValue(1,1);
getField("Type").setValue("LiPo");
getField("NbCells").setValue(3);
getField("SensorType").setValue("None");
}
/**
* Create a clone of this object, a new instance ID must be specified.
* Do not use this function directly to create new instances, the
* UAVObjectManager should be used instead.
*/
public UAVDataObject clone(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 = 0xF172BB18l;
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;
}

View File

@ -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.
* 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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> VoltageElemNames = new ArrayList<String>();
VoltageElemNames.add("0");
fields.add( new UAVObjectField("Voltage", "V", UAVObjectField.FieldType.FLOAT32, VoltageElemNames, null) );
List<String> CurrentElemNames = new ArrayList<String>();
CurrentElemNames.add("0");
fields.add( new UAVObjectField("Current", "A", UAVObjectField.FieldType.FLOAT32, CurrentElemNames, null) );
List<String> PeakCurrentElemNames = new ArrayList<String>();
PeakCurrentElemNames.add("0");
fields.add( new UAVObjectField("PeakCurrent", "A", UAVObjectField.FieldType.FLOAT32, PeakCurrentElemNames, null) );
List<String> AvgCurrentElemNames = new ArrayList<String>();
AvgCurrentElemNames.add("0");
fields.add( new UAVObjectField("AvgCurrent", "A", UAVObjectField.FieldType.FLOAT32, AvgCurrentElemNames, null) );
List<String> ConsumedEnergyElemNames = new ArrayList<String>();
ConsumedEnergyElemNames.add("0");
fields.add( new UAVObjectField("ConsumedEnergy", "mAh", UAVObjectField.FieldType.FLOAT32, ConsumedEnergyElemNames, null) );
List<String> EstimatedFlightTimeElemNames = new ArrayList<String>();
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<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READONLY) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_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("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 = 0x8C0D756l;
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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> CommandElemNames = new ArrayList<String>();
CommandElemNames.add("0");
List<String> CommandEnumOptions = new ArrayList<String>();
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<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> TestElemNames = new ArrayList<String>();
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<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
getField("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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> ErrorFileIDElemNames = new ArrayList<String>();
ErrorFileIDElemNames.add("0");
fields.add( new UAVObjectField("ErrorFileID", "", UAVObjectField.FieldType.UINT32, ErrorFileIDElemNames, null) );
List<String> ErrorLineNumElemNames = new ArrayList<String>();
ErrorLineNumElemNames.add("0");
fields.add( new UAVObjectField("ErrorLineNum", "", UAVObjectField.FieldType.UINT32, ErrorLineNumElemNames, null) );
List<String> DebugElemNames = new ArrayList<String>();
DebugElemNames.add("0");
DebugElemNames.add("1");
fields.add( new UAVObjectField("Debug", "", UAVObjectField.FieldType.FLOAT32, DebugElemNames, null) );
List<String> StatusElemNames = new ArrayList<String>();
StatusElemNames.add("0");
List<String> StatusEnumOptions = new ArrayList<String>();
StatusEnumOptions.add("Stopped");
StatusEnumOptions.add("Running");
StatusEnumOptions.add("Error");
fields.add( new UAVObjectField("Status", "", UAVObjectField.FieldType.ENUM, StatusElemNames, StatusEnumOptions) );
List<String> ErrorTypeElemNames = new ArrayList<String>();
ErrorTypeElemNames.add("0");
List<String> ErrorTypeEnumOptions = new ArrayList<String>();
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<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 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;
}

View File

@ -1,156 +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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> ArmedElemNames = new ArrayList<String>();
ArmedElemNames.add("0");
List<String> ArmedEnumOptions = new ArrayList<String>();
ArmedEnumOptions.add("Disarmed");
ArmedEnumOptions.add("Arming");
ArmedEnumOptions.add("Armed");
fields.add( new UAVObjectField("Armed", "", UAVObjectField.FieldType.ENUM, ArmedElemNames, ArmedEnumOptions) );
List<String> FlightModeElemNames = new ArrayList<String>();
FlightModeElemNames.add("0");
List<String> FlightModeEnumOptions = new ArrayList<String>();
FlightModeEnumOptions.add("Manual");
FlightModeEnumOptions.add("Stabilized1");
FlightModeEnumOptions.add("Stabilized2");
FlightModeEnumOptions.add("Stabilized3");
FlightModeEnumOptions.add("Autotune");
FlightModeEnumOptions.add("AltitudeHold");
FlightModeEnumOptions.add("VelocityControl");
FlightModeEnumOptions.add("PositionHold");
fields.add( new UAVObjectField("FlightMode", "", UAVObjectField.FieldType.ENUM, FlightModeElemNames, FlightModeEnumOptions) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 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 = 0x9B6A127El;
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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> ChannelElemNames = new ArrayList<String>();
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<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> LatitudeElemNames = new ArrayList<String>();
LatitudeElemNames.add("0");
fields.add( new UAVObjectField("Latitude", "degrees x 10^-7", UAVObjectField.FieldType.INT32, LatitudeElemNames, null) );
List<String> LongitudeElemNames = new ArrayList<String>();
LongitudeElemNames.add("0");
fields.add( new UAVObjectField("Longitude", "degrees x 10^-7", UAVObjectField.FieldType.INT32, LongitudeElemNames, null) );
List<String> AltitudeElemNames = new ArrayList<String>();
AltitudeElemNames.add("0");
fields.add( new UAVObjectField("Altitude", "meters", UAVObjectField.FieldType.FLOAT32, AltitudeElemNames, null) );
List<String> GeoidSeparationElemNames = new ArrayList<String>();
GeoidSeparationElemNames.add("0");
fields.add( new UAVObjectField("GeoidSeparation", "meters", UAVObjectField.FieldType.FLOAT32, GeoidSeparationElemNames, null) );
List<String> HeadingElemNames = new ArrayList<String>();
HeadingElemNames.add("0");
fields.add( new UAVObjectField("Heading", "degrees", UAVObjectField.FieldType.FLOAT32, HeadingElemNames, null) );
List<String> GroundspeedElemNames = new ArrayList<String>();
GroundspeedElemNames.add("0");
fields.add( new UAVObjectField("Groundspeed", "m/s", UAVObjectField.FieldType.FLOAT32, GroundspeedElemNames, null) );
List<String> PDOPElemNames = new ArrayList<String>();
PDOPElemNames.add("0");
fields.add( new UAVObjectField("PDOP", "", UAVObjectField.FieldType.FLOAT32, PDOPElemNames, null) );
List<String> HDOPElemNames = new ArrayList<String>();
HDOPElemNames.add("0");
fields.add( new UAVObjectField("HDOP", "", UAVObjectField.FieldType.FLOAT32, HDOPElemNames, null) );
List<String> VDOPElemNames = new ArrayList<String>();
VDOPElemNames.add("0");
fields.add( new UAVObjectField("VDOP", "", UAVObjectField.FieldType.FLOAT32, VDOPElemNames, null) );
List<String> StatusElemNames = new ArrayList<String>();
StatusElemNames.add("0");
List<String> StatusEnumOptions = new ArrayList<String>();
StatusEnumOptions.add("NoGPS");
StatusEnumOptions.add("NoFix");
StatusEnumOptions.add("Fix2D");
StatusEnumOptions.add("Fix3D");
fields.add( new UAVObjectField("Status", "", UAVObjectField.FieldType.ENUM, StatusElemNames, StatusEnumOptions) );
List<String> SatellitesElemNames = new ArrayList<String>();
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<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 1000;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
}
/**
* Create a clone of this object, a new instance ID must be specified.
* Do not use this function directly to create new instances, the
* UAVObjectManager should be used instead.
*/
public UAVDataObject clone(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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> ElevationElemNames = new ArrayList<String>();
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<String> AzimuthElemNames = new ArrayList<String>();
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<String> SatsInViewElemNames = new ArrayList<String>();
SatsInViewElemNames.add("0");
fields.add( new UAVObjectField("SatsInView", "", UAVObjectField.FieldType.INT8, SatsInViewElemNames, null) );
List<String> PRNElemNames = new ArrayList<String>();
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<String> SNRElemNames = new ArrayList<String>();
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<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> DataProtocolElemNames = new ArrayList<String>();
DataProtocolElemNames.add("0");
List<String> DataProtocolEnumOptions = new ArrayList<String>();
DataProtocolEnumOptions.add("NMEA");
DataProtocolEnumOptions.add("UBX");
fields.add( new UAVObjectField("DataProtocol", "", UAVObjectField.FieldType.ENUM, DataProtocolElemNames, DataProtocolEnumOptions) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
getField("DataProtocol").setValue("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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> YearElemNames = new ArrayList<String>();
YearElemNames.add("0");
fields.add( new UAVObjectField("Year", "", UAVObjectField.FieldType.INT16, YearElemNames, null) );
List<String> MonthElemNames = new ArrayList<String>();
MonthElemNames.add("0");
fields.add( new UAVObjectField("Month", "", UAVObjectField.FieldType.INT8, MonthElemNames, null) );
List<String> DayElemNames = new ArrayList<String>();
DayElemNames.add("0");
fields.add( new UAVObjectField("Day", "", UAVObjectField.FieldType.INT8, DayElemNames, null) );
List<String> HourElemNames = new ArrayList<String>();
HourElemNames.add("0");
fields.add( new UAVObjectField("Hour", "", UAVObjectField.FieldType.INT8, HourElemNames, null) );
List<String> MinuteElemNames = new ArrayList<String>();
MinuteElemNames.add("0");
fields.add( new UAVObjectField("Minute", "", UAVObjectField.FieldType.INT8, MinuteElemNames, null) );
List<String> SecondElemNames = new ArrayList<String>();
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<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> NorthElemNames = new ArrayList<String>();
NorthElemNames.add("0");
fields.add( new UAVObjectField("North", "m/s", UAVObjectField.FieldType.FLOAT32, NorthElemNames, null) );
List<String> EastElemNames = new ArrayList<String>();
EastElemNames.add("0");
fields.add( new UAVObjectField("East", "m/s", UAVObjectField.FieldType.FLOAT32, EastElemNames, null) );
List<String> DownElemNames = new ArrayList<String>();
DownElemNames.add("0");
fields.add( new UAVObjectField("Down", "m/s", UAVObjectField.FieldType.FLOAT32, DownElemNames, null) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 1000;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
}
/**
* Create a clone of this object, a new instance ID must be specified.
* Do not use this function directly to create new instances, the
* UAVObjectManager should be used instead.
*/
public UAVDataObject clone(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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> HorizontalPosPIElemNames = new ArrayList<String>();
HorizontalPosPIElemNames.add("Kp");
HorizontalPosPIElemNames.add("Ki");
HorizontalPosPIElemNames.add("ILimit");
fields.add( new UAVObjectField("HorizontalPosPI", "(m/s)/m", UAVObjectField.FieldType.FLOAT32, HorizontalPosPIElemNames, null) );
List<String> HorizontalVelPIDElemNames = new ArrayList<String>();
HorizontalVelPIDElemNames.add("Kp");
HorizontalVelPIDElemNames.add("Ki");
HorizontalVelPIDElemNames.add("Kd");
HorizontalVelPIDElemNames.add("ILimit");
fields.add( new UAVObjectField("HorizontalVelPID", "deg/(m/s)", UAVObjectField.FieldType.FLOAT32, HorizontalVelPIDElemNames, null) );
List<String> VerticalPosPIElemNames = new ArrayList<String>();
VerticalPosPIElemNames.add("Kp");
VerticalPosPIElemNames.add("Ki");
VerticalPosPIElemNames.add("ILimit");
fields.add( new UAVObjectField("VerticalPosPI", "", UAVObjectField.FieldType.FLOAT32, VerticalPosPIElemNames, null) );
List<String> VerticalVelPIDElemNames = new ArrayList<String>();
VerticalVelPIDElemNames.add("Kp");
VerticalVelPIDElemNames.add("Ki");
VerticalVelPIDElemNames.add("Kd");
VerticalVelPIDElemNames.add("ILimit");
fields.add( new UAVObjectField("VerticalVelPID", "", UAVObjectField.FieldType.FLOAT32, VerticalVelPIDElemNames, null) );
List<String> MaxRollPitchElemNames = new ArrayList<String>();
MaxRollPitchElemNames.add("0");
fields.add( new UAVObjectField("MaxRollPitch", "deg", UAVObjectField.FieldType.FLOAT32, MaxRollPitchElemNames, null) );
List<String> UpdatePeriodElemNames = new ArrayList<String>();
UpdatePeriodElemNames.add("0");
fields.add( new UAVObjectField("UpdatePeriod", "", UAVObjectField.FieldType.INT32, UpdatePeriodElemNames, null) );
List<String> HorizontalVelMaxElemNames = new ArrayList<String>();
HorizontalVelMaxElemNames.add("0");
fields.add( new UAVObjectField("HorizontalVelMax", "m/s", UAVObjectField.FieldType.UINT16, HorizontalVelMaxElemNames, null) );
List<String> VerticalVelMaxElemNames = new ArrayList<String>();
VerticalVelMaxElemNames.add("0");
fields.add( new UAVObjectField("VerticalVelMax", "m/s", UAVObjectField.FieldType.UINT16, VerticalVelMaxElemNames, null) );
List<String> GuidanceModeElemNames = new ArrayList<String>();
GuidanceModeElemNames.add("0");
List<String> GuidanceModeEnumOptions = new ArrayList<String>();
GuidanceModeEnumOptions.add("DUAL_LOOP");
GuidanceModeEnumOptions.add("VELOCITY_CONTROL");
fields.add( new UAVObjectField("GuidanceMode", "", UAVObjectField.FieldType.ENUM, GuidanceModeElemNames, GuidanceModeEnumOptions) );
List<String> ThrottleControlElemNames = new ArrayList<String>();
ThrottleControlElemNames.add("0");
List<String> ThrottleControlEnumOptions = new ArrayList<String>();
ThrottleControlEnumOptions.add("FALSE");
ThrottleControlEnumOptions.add("TRUE");
fields.add( new UAVObjectField("ThrottleControl", "", UAVObjectField.FieldType.ENUM, ThrottleControlElemNames, ThrottleControlEnumOptions) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> xElemNames = new ArrayList<String>();
xElemNames.add("0");
fields.add( new UAVObjectField("x", "deg/s", UAVObjectField.FieldType.FLOAT32, xElemNames, null) );
List<String> yElemNames = new ArrayList<String>();
yElemNames.add("0");
fields.add( new UAVObjectField("y", "deg/s", UAVObjectField.FieldType.FLOAT32, yElemNames, null) );
List<String> zElemNames = new ArrayList<String>();
zElemNames.add("0");
fields.add( new UAVObjectField("z", "deg/s", UAVObjectField.FieldType.FLOAT32, zElemNames, null) );
List<String> temperatureElemNames = new ArrayList<String>();
temperatureElemNames.add("0");
fields.add( new UAVObjectField("temperature", "deg C", UAVObjectField.FieldType.FLOAT32, temperatureElemNames, null) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
}
/**
* Create a clone of this object, a new instance ID must be specified.
* Do not use this function directly to create new instances, the
* UAVObjectManager should be used instead.
*/
public UAVDataObject clone(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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> xElemNames = new ArrayList<String>();
xElemNames.add("0");
fields.add( new UAVObjectField("x", "deg/s", UAVObjectField.FieldType.FLOAT32, xElemNames, null) );
List<String> yElemNames = new ArrayList<String>();
yElemNames.add("0");
fields.add( new UAVObjectField("y", "deg/s", UAVObjectField.FieldType.FLOAT32, yElemNames, null) );
List<String> zElemNames = new ArrayList<String>();
zElemNames.add("0");
fields.add( new UAVObjectField("z", "deg/s", UAVObjectField.FieldType.FLOAT32, zElemNames, null) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
}
/**
* Create a clone of this object, a new instance ID must be specified.
* Do not use this function directly to create new instances, the
* UAVObjectManager should be used instead.
*/
public UAVDataObject clone(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;
}

View File

@ -1,201 +0,0 @@
/**
******************************************************************************
*
* @file uavobjecttemplate.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Template for an uavobject in java
* This is a autogenerated file!! Do not modify and expect a result.
* 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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> LatitudeElemNames = new ArrayList<String>();
LatitudeElemNames.add("0");
fields.add( new UAVObjectField("Latitude", "deg * 10e6", UAVObjectField.FieldType.INT32, LatitudeElemNames, null) );
List<String> LongitudeElemNames = new ArrayList<String>();
LongitudeElemNames.add("0");
fields.add( new UAVObjectField("Longitude", "deg * 10e6", UAVObjectField.FieldType.INT32, LongitudeElemNames, null) );
List<String> AltitudeElemNames = new ArrayList<String>();
AltitudeElemNames.add("0");
fields.add( new UAVObjectField("Altitude", "m over geoid", UAVObjectField.FieldType.FLOAT32, AltitudeElemNames, null) );
List<String> ECEFElemNames = new ArrayList<String>();
ECEFElemNames.add("0");
ECEFElemNames.add("1");
ECEFElemNames.add("2");
fields.add( new UAVObjectField("ECEF", "cm", UAVObjectField.FieldType.INT32, ECEFElemNames, null) );
List<String> RNEElemNames = new ArrayList<String>();
RNEElemNames.add("0");
RNEElemNames.add("1");
RNEElemNames.add("2");
RNEElemNames.add("3");
RNEElemNames.add("4");
RNEElemNames.add("5");
RNEElemNames.add("6");
RNEElemNames.add("7");
RNEElemNames.add("8");
fields.add( new UAVObjectField("RNE", "", UAVObjectField.FieldType.FLOAT32, RNEElemNames, null) );
List<String> BeElemNames = new ArrayList<String>();
BeElemNames.add("0");
BeElemNames.add("1");
BeElemNames.add("2");
fields.add( new UAVObjectField("Be", "", UAVObjectField.FieldType.FLOAT32, BeElemNames, null) );
List<String> g_eElemNames = new ArrayList<String>();
g_eElemNames.add("0");
fields.add( new UAVObjectField("g_e", "m/s^2", UAVObjectField.FieldType.FLOAT32, g_eElemNames, null) );
List<String> SetElemNames = new ArrayList<String>();
SetElemNames.add("0");
List<String> SetEnumOptions = new ArrayList<String>();
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<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
getField("Latitude").setValue(0);
getField("Longitude").setValue(0);
getField("Altitude").setValue(0);
getField("ECEF").setValue(0,0);
getField("ECEF").setValue(0,1);
getField("ECEF").setValue(0,2);
getField("RNE").setValue(0,0);
getField("RNE").setValue(0,1);
getField("RNE").setValue(0,2);
getField("RNE").setValue(0,3);
getField("RNE").setValue(0,4);
getField("RNE").setValue(0,5);
getField("RNE").setValue(0,6);
getField("RNE").setValue(0,7);
getField("RNE").setValue(0,8);
getField("Be").setValue(0,0);
getField("Be").setValue(0,1);
getField("Be").setValue(0,2);
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 = 0x5BB3AEFCl;
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;
}

View File

@ -1,328 +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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> CC_RcvrPortElemNames = new ArrayList<String>();
CC_RcvrPortElemNames.add("0");
List<String> CC_RcvrPortEnumOptions = new ArrayList<String>();
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<String> CC_MainPortElemNames = new ArrayList<String>();
CC_MainPortElemNames.add("0");
List<String> CC_MainPortEnumOptions = new ArrayList<String>();
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<String> CC_FlexiPortElemNames = new ArrayList<String>();
CC_FlexiPortElemNames.add("0");
List<String> CC_FlexiPortEnumOptions = new ArrayList<String>();
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<String> RV_RcvrPortElemNames = new ArrayList<String>();
RV_RcvrPortElemNames.add("0");
List<String> RV_RcvrPortEnumOptions = new ArrayList<String>();
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<String> RV_AuxPortElemNames = new ArrayList<String>();
RV_AuxPortElemNames.add("0");
List<String> RV_AuxPortEnumOptions = new ArrayList<String>();
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<String> RV_AuxSBusPortElemNames = new ArrayList<String>();
RV_AuxSBusPortElemNames.add("0");
List<String> RV_AuxSBusPortEnumOptions = new ArrayList<String>();
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<String> RV_FlexiPortElemNames = new ArrayList<String>();
RV_FlexiPortElemNames.add("0");
List<String> RV_FlexiPortEnumOptions = new ArrayList<String>();
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<String> RV_TelemetryPortElemNames = new ArrayList<String>();
RV_TelemetryPortElemNames.add("0");
List<String> RV_TelemetryPortEnumOptions = new ArrayList<String>();
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<String> RV_GPSPortElemNames = new ArrayList<String>();
RV_GPSPortElemNames.add("0");
List<String> RV_GPSPortEnumOptions = new ArrayList<String>();
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<String> TelemetrySpeedElemNames = new ArrayList<String>();
TelemetrySpeedElemNames.add("0");
List<String> TelemetrySpeedEnumOptions = new ArrayList<String>();
TelemetrySpeedEnumOptions.add("2400");
TelemetrySpeedEnumOptions.add("4800");
TelemetrySpeedEnumOptions.add("9600");
TelemetrySpeedEnumOptions.add("19200");
TelemetrySpeedEnumOptions.add("38400");
TelemetrySpeedEnumOptions.add("57600");
TelemetrySpeedEnumOptions.add("115200");
fields.add( new UAVObjectField("TelemetrySpeed", "bps", UAVObjectField.FieldType.ENUM, TelemetrySpeedElemNames, TelemetrySpeedEnumOptions) );
List<String> GPSSpeedElemNames = new ArrayList<String>();
GPSSpeedElemNames.add("0");
List<String> GPSSpeedEnumOptions = new ArrayList<String>();
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<String> ComUsbBridgeSpeedElemNames = new ArrayList<String>();
ComUsbBridgeSpeedElemNames.add("0");
List<String> ComUsbBridgeSpeedEnumOptions = new ArrayList<String>();
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<String> USB_HIDPortElemNames = new ArrayList<String>();
USB_HIDPortElemNames.add("0");
List<String> USB_HIDPortEnumOptions = new ArrayList<String>();
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<String> USB_VCPPortElemNames = new ArrayList<String>();
USB_VCPPortElemNames.add("0");
List<String> USB_VCPPortEnumOptions = new ArrayList<String>();
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<String> OptionalModulesElemNames = new ArrayList<String>();
OptionalModulesElemNames.add("CameraStab");
OptionalModulesElemNames.add("GPS");
OptionalModulesElemNames.add("ComUsbBridge");
OptionalModulesElemNames.add("Fault");
OptionalModulesElemNames.add("Altitude");
OptionalModulesElemNames.add("TxPID");
OptionalModulesElemNames.add("Autotune");
List<String> OptionalModulesEnumOptions = new ArrayList<String>();
OptionalModulesEnumOptions.add("Disabled");
OptionalModulesEnumOptions.add("Enabled");
fields.add( new UAVObjectField("OptionalModules", "", UAVObjectField.FieldType.ENUM, OptionalModulesElemNames, OptionalModulesEnumOptions) );
List<String> DSMxBindElemNames = new ArrayList<String>();
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<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
getField("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("Telemetry");
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("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 = 0x428D4DCEl;
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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> evirq_logElemNames = new ArrayList<String>();
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<String> erirq_logElemNames = new ArrayList<String>();
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<String> event_errorsElemNames = new ArrayList<String>();
event_errorsElemNames.add("0");
fields.add( new UAVObjectField("event_errors", "", UAVObjectField.FieldType.UINT8, event_errorsElemNames, null) );
List<String> fsm_errorsElemNames = new ArrayList<String>();
fsm_errorsElemNames.add("0");
fields.add( new UAVObjectField("fsm_errors", "", UAVObjectField.FieldType.UINT8, fsm_errorsElemNames, null) );
List<String> irq_errorsElemNames = new ArrayList<String>();
irq_errorsElemNames.add("0");
fields.add( new UAVObjectField("irq_errors", "", UAVObjectField.FieldType.UINT8, irq_errorsElemNames, null) );
List<String> nacksElemNames = new ArrayList<String>();
nacksElemNames.add("0");
fields.add( new UAVObjectField("nacks", "", UAVObjectField.FieldType.UINT8, nacksElemNames, null) );
List<String> timeoutsElemNames = new ArrayList<String>();
timeoutsElemNames.add("0");
fields.add( new UAVObjectField("timeouts", "", UAVObjectField.FieldType.UINT8, timeoutsElemNames, null) );
List<String> last_error_typeElemNames = new ArrayList<String>();
last_error_typeElemNames.add("0");
List<String> last_error_typeEnumOptions = new ArrayList<String>();
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<String> event_logElemNames = new ArrayList<String>();
event_logElemNames.add("0");
event_logElemNames.add("1");
event_logElemNames.add("2");
event_logElemNames.add("3");
event_logElemNames.add("4");
List<String> event_logEnumOptions = new ArrayList<String>();
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<String> state_logElemNames = new ArrayList<String>();
state_logElemNames.add("0");
state_logElemNames.add("1");
state_logElemNames.add("2");
state_logElemNames.add("3");
state_logElemNames.add("4");
List<String> state_logEnumOptions = new ArrayList<String>();
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<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> xElemNames = new ArrayList<String>();
xElemNames.add("0");
fields.add( new UAVObjectField("x", "mGau", UAVObjectField.FieldType.FLOAT32, xElemNames, null) );
List<String> yElemNames = new ArrayList<String>();
yElemNames.add("0");
fields.add( new UAVObjectField("y", "mGau", UAVObjectField.FieldType.FLOAT32, yElemNames, null) );
List<String> zElemNames = new ArrayList<String>();
zElemNames.add("0");
fields.add( new UAVObjectField("z", "mGau", UAVObjectField.FieldType.FLOAT32, zElemNames, null) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
}
/**
* Create a clone of this object, a new instance ID must be specified.
* Do not use this function directly to create new instances, the
* UAVObjectManager should be used instead.
*/
public UAVDataObject clone(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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> xElemNames = new ArrayList<String>();
xElemNames.add("0");
fields.add( new UAVObjectField("x", "mGa", UAVObjectField.FieldType.FLOAT32, xElemNames, null) );
List<String> yElemNames = new ArrayList<String>();
yElemNames.add("0");
fields.add( new UAVObjectField("y", "mGa", UAVObjectField.FieldType.FLOAT32, yElemNames, null) );
List<String> zElemNames = new ArrayList<String>();
zElemNames.add("0");
fields.add( new UAVObjectField("z", "mGa", UAVObjectField.FieldType.FLOAT32, zElemNames, null) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
}
/**
* Create a clone of this object, a new instance ID must be specified.
* Do not use this function directly to create new instances, the
* UAVObjectManager should be used instead.
*/
public UAVDataObject clone(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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> ThrottleElemNames = new ArrayList<String>();
ThrottleElemNames.add("0");
fields.add( new UAVObjectField("Throttle", "%", UAVObjectField.FieldType.FLOAT32, ThrottleElemNames, null) );
List<String> RollElemNames = new ArrayList<String>();
RollElemNames.add("0");
fields.add( new UAVObjectField("Roll", "%", UAVObjectField.FieldType.FLOAT32, RollElemNames, null) );
List<String> PitchElemNames = new ArrayList<String>();
PitchElemNames.add("0");
fields.add( new UAVObjectField("Pitch", "%", UAVObjectField.FieldType.FLOAT32, PitchElemNames, null) );
List<String> YawElemNames = new ArrayList<String>();
YawElemNames.add("0");
fields.add( new UAVObjectField("Yaw", "%", UAVObjectField.FieldType.FLOAT32, YawElemNames, null) );
List<String> CollectiveElemNames = new ArrayList<String>();
CollectiveElemNames.add("0");
fields.add( new UAVObjectField("Collective", "%", UAVObjectField.FieldType.FLOAT32, CollectiveElemNames, null) );
List<String> ChannelElemNames = new ArrayList<String>();
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<String> ConnectedElemNames = new ArrayList<String>();
ConnectedElemNames.add("0");
List<String> ConnectedEnumOptions = new ArrayList<String>();
ConnectedEnumOptions.add("False");
ConnectedEnumOptions.add("True");
fields.add( new UAVObjectField("Connected", "", UAVObjectField.FieldType.ENUM, ConnectedElemNames, ConnectedEnumOptions) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 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;
}

View File

@ -1,354 +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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> DeadbandElemNames = new ArrayList<String>();
DeadbandElemNames.add("0");
fields.add( new UAVObjectField("Deadband", "%", UAVObjectField.FieldType.FLOAT32, DeadbandElemNames, null) );
List<String> ChannelMinElemNames = new ArrayList<String>();
ChannelMinElemNames.add("Throttle");
ChannelMinElemNames.add("Roll");
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<String> ChannelNeutralElemNames = new ArrayList<String>();
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<String> ChannelMaxElemNames = new ArrayList<String>();
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<String> ArmedTimeoutElemNames = new ArrayList<String>();
ArmedTimeoutElemNames.add("0");
fields.add( new UAVObjectField("ArmedTimeout", "ms", UAVObjectField.FieldType.UINT16, ArmedTimeoutElemNames, null) );
List<String> ChannelGroupsElemNames = new ArrayList<String>();
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<String> ChannelGroupsEnumOptions = new ArrayList<String>();
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<String> ChannelNumberElemNames = new ArrayList<String>();
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<String> ArmingElemNames = new ArrayList<String>();
ArmingElemNames.add("0");
List<String> ArmingEnumOptions = new ArrayList<String>();
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<String> Stabilization1SettingsElemNames = new ArrayList<String>();
Stabilization1SettingsElemNames.add("Roll");
Stabilization1SettingsElemNames.add("Pitch");
Stabilization1SettingsElemNames.add("Yaw");
List<String> Stabilization1SettingsEnumOptions = new ArrayList<String>();
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<String> Stabilization2SettingsElemNames = new ArrayList<String>();
Stabilization2SettingsElemNames.add("Roll");
Stabilization2SettingsElemNames.add("Pitch");
Stabilization2SettingsElemNames.add("Yaw");
List<String> Stabilization2SettingsEnumOptions = new ArrayList<String>();
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<String> Stabilization3SettingsElemNames = new ArrayList<String>();
Stabilization3SettingsElemNames.add("Roll");
Stabilization3SettingsElemNames.add("Pitch");
Stabilization3SettingsElemNames.add("Yaw");
List<String> Stabilization3SettingsEnumOptions = new ArrayList<String>();
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<String> FlightModeNumberElemNames = new ArrayList<String>();
FlightModeNumberElemNames.add("0");
fields.add( new UAVObjectField("FlightModeNumber", "", UAVObjectField.FieldType.UINT8, FlightModeNumberElemNames, null) );
List<String> FlightModePositionElemNames = new ArrayList<String>();
FlightModePositionElemNames.add("0");
FlightModePositionElemNames.add("1");
FlightModePositionElemNames.add("2");
FlightModePositionElemNames.add("3");
FlightModePositionElemNames.add("4");
FlightModePositionElemNames.add("5");
List<String> FlightModePositionEnumOptions = new ArrayList<String>();
FlightModePositionEnumOptions.add("Manual");
FlightModePositionEnumOptions.add("Stabilized1");
FlightModePositionEnumOptions.add("Stabilized2");
FlightModePositionEnumOptions.add("Stabilized3");
FlightModePositionEnumOptions.add("Autotune");
FlightModePositionEnumOptions.add("AltitudeHold");
FlightModePositionEnumOptions.add("VelocityControl");
FlightModePositionEnumOptions.add("PositionHold");
fields.add( new UAVObjectField("FlightModePosition", "", UAVObjectField.FieldType.ENUM, FlightModePositionElemNames, FlightModePositionEnumOptions) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
getField("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);
}
/**
* 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 = 0xA240D466l;
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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> MaxAccelElemNames = new ArrayList<String>();
MaxAccelElemNames.add("0");
fields.add( new UAVObjectField("MaxAccel", "units/sec", UAVObjectField.FieldType.FLOAT32, MaxAccelElemNames, null) );
List<String> FeedForwardElemNames = new ArrayList<String>();
FeedForwardElemNames.add("0");
fields.add( new UAVObjectField("FeedForward", "", UAVObjectField.FieldType.FLOAT32, FeedForwardElemNames, null) );
List<String> AccelTimeElemNames = new ArrayList<String>();
AccelTimeElemNames.add("0");
fields.add( new UAVObjectField("AccelTime", "ms", UAVObjectField.FieldType.FLOAT32, AccelTimeElemNames, null) );
List<String> DecelTimeElemNames = new ArrayList<String>();
DecelTimeElemNames.add("0");
fields.add( new UAVObjectField("DecelTime", "ms", UAVObjectField.FieldType.FLOAT32, DecelTimeElemNames, null) );
List<String> ThrottleCurve1ElemNames = new ArrayList<String>();
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<String> ThrottleCurve2ElemNames = new ArrayList<String>();
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<String> Curve2SourceElemNames = new ArrayList<String>();
Curve2SourceElemNames.add("0");
List<String> Curve2SourceEnumOptions = new ArrayList<String>();
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<String> Mixer1TypeElemNames = new ArrayList<String>();
Mixer1TypeElemNames.add("0");
List<String> Mixer1TypeEnumOptions = new ArrayList<String>();
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<String> Mixer1VectorElemNames = new ArrayList<String>();
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<String> Mixer2TypeElemNames = new ArrayList<String>();
Mixer2TypeElemNames.add("0");
List<String> Mixer2TypeEnumOptions = new ArrayList<String>();
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<String> Mixer2VectorElemNames = new ArrayList<String>();
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<String> Mixer3TypeElemNames = new ArrayList<String>();
Mixer3TypeElemNames.add("0");
List<String> Mixer3TypeEnumOptions = new ArrayList<String>();
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<String> Mixer3VectorElemNames = new ArrayList<String>();
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<String> Mixer4TypeElemNames = new ArrayList<String>();
Mixer4TypeElemNames.add("0");
List<String> Mixer4TypeEnumOptions = new ArrayList<String>();
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<String> Mixer4VectorElemNames = new ArrayList<String>();
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<String> Mixer5TypeElemNames = new ArrayList<String>();
Mixer5TypeElemNames.add("0");
List<String> Mixer5TypeEnumOptions = new ArrayList<String>();
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<String> Mixer5VectorElemNames = new ArrayList<String>();
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<String> Mixer6TypeElemNames = new ArrayList<String>();
Mixer6TypeElemNames.add("0");
List<String> Mixer6TypeEnumOptions = new ArrayList<String>();
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<String> Mixer6VectorElemNames = new ArrayList<String>();
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<String> Mixer7TypeElemNames = new ArrayList<String>();
Mixer7TypeElemNames.add("0");
List<String> Mixer7TypeEnumOptions = new ArrayList<String>();
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<String> Mixer7VectorElemNames = new ArrayList<String>();
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<String> Mixer8TypeElemNames = new ArrayList<String>();
Mixer8TypeElemNames.add("0");
List<String> Mixer8TypeEnumOptions = new ArrayList<String>();
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<String> Mixer8VectorElemNames = new ArrayList<String>();
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<String> Mixer9TypeElemNames = new ArrayList<String>();
Mixer9TypeElemNames.add("0");
List<String> Mixer9TypeEnumOptions = new ArrayList<String>();
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<String> Mixer9VectorElemNames = new ArrayList<String>();
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<String> Mixer10TypeElemNames = new ArrayList<String>();
Mixer10TypeElemNames.add("0");
List<String> Mixer10TypeEnumOptions = new ArrayList<String>();
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<String> Mixer10VectorElemNames = new ArrayList<String>();
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<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
getField("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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> Mixer1ElemNames = new ArrayList<String>();
Mixer1ElemNames.add("0");
fields.add( new UAVObjectField("Mixer1", "", UAVObjectField.FieldType.FLOAT32, Mixer1ElemNames, null) );
List<String> Mixer2ElemNames = new ArrayList<String>();
Mixer2ElemNames.add("0");
fields.add( new UAVObjectField("Mixer2", "", UAVObjectField.FieldType.FLOAT32, Mixer2ElemNames, null) );
List<String> Mixer3ElemNames = new ArrayList<String>();
Mixer3ElemNames.add("0");
fields.add( new UAVObjectField("Mixer3", "", UAVObjectField.FieldType.FLOAT32, Mixer3ElemNames, null) );
List<String> Mixer4ElemNames = new ArrayList<String>();
Mixer4ElemNames.add("0");
fields.add( new UAVObjectField("Mixer4", "", UAVObjectField.FieldType.FLOAT32, Mixer4ElemNames, null) );
List<String> Mixer5ElemNames = new ArrayList<String>();
Mixer5ElemNames.add("0");
fields.add( new UAVObjectField("Mixer5", "", UAVObjectField.FieldType.FLOAT32, Mixer5ElemNames, null) );
List<String> Mixer6ElemNames = new ArrayList<String>();
Mixer6ElemNames.add("0");
fields.add( new UAVObjectField("Mixer6", "", UAVObjectField.FieldType.FLOAT32, Mixer6ElemNames, null) );
List<String> Mixer7ElemNames = new ArrayList<String>();
Mixer7ElemNames.add("0");
fields.add( new UAVObjectField("Mixer7", "", UAVObjectField.FieldType.FLOAT32, Mixer7ElemNames, null) );
List<String> Mixer8ElemNames = new ArrayList<String>();
Mixer8ElemNames.add("0");
fields.add( new UAVObjectField("Mixer8", "", UAVObjectField.FieldType.FLOAT32, Mixer8ElemNames, null) );
List<String> Mixer9ElemNames = new ArrayList<String>();
Mixer9ElemNames.add("0");
fields.add( new UAVObjectField("Mixer9", "", UAVObjectField.FieldType.FLOAT32, Mixer9ElemNames, null) );
List<String> Mixer10ElemNames = new ArrayList<String>();
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<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 1000;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
}
/**
* Create a clone of this object, a new instance ID must be specified.
* Do not use this function directly to create new instances, the
* UAVObjectManager should be used instead.
*/
public UAVDataObject clone(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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> NorthElemNames = new ArrayList<String>();
NorthElemNames.add("0");
fields.add( new UAVObjectField("North", "m", UAVObjectField.FieldType.FLOAT32, NorthElemNames, null) );
List<String> EastElemNames = new ArrayList<String>();
EastElemNames.add("0");
fields.add( new UAVObjectField("East", "m", UAVObjectField.FieldType.FLOAT32, EastElemNames, null) );
List<String> DownElemNames = new ArrayList<String>();
DownElemNames.add("0");
fields.add( new UAVObjectField("Down", "m", UAVObjectField.FieldType.FLOAT32, DownElemNames, null) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 1000;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
}
/**
* Create a clone of this object, a new instance ID must be specified.
* Do not use this function directly to create new instances, the
* UAVObjectManager should be used instead.
*/
public UAVDataObject clone(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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> NorthElemNames = new ArrayList<String>();
NorthElemNames.add("0");
fields.add( new UAVObjectField("North", "m/s^2", UAVObjectField.FieldType.FLOAT32, NorthElemNames, null) );
List<String> EastElemNames = new ArrayList<String>();
EastElemNames.add("0");
fields.add( new UAVObjectField("East", "m/s^2", UAVObjectField.FieldType.FLOAT32, EastElemNames, null) );
List<String> DownElemNames = new ArrayList<String>();
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<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> ObjectIDElemNames = new ArrayList<String>();
ObjectIDElemNames.add("0");
fields.add( new UAVObjectField("ObjectID", "", UAVObjectField.FieldType.UINT32, ObjectIDElemNames, null) );
List<String> InstanceIDElemNames = new ArrayList<String>();
InstanceIDElemNames.add("0");
fields.add( new UAVObjectField("InstanceID", "", UAVObjectField.FieldType.UINT32, InstanceIDElemNames, null) );
List<String> OperationElemNames = new ArrayList<String>();
OperationElemNames.add("0");
List<String> OperationEnumOptions = new ArrayList<String>();
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<String> SelectionElemNames = new ArrayList<String>();
SelectionElemNames.add("0");
List<String> SelectionEnumOptions = new ArrayList<String>();
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<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> LogOnElemNames = new ArrayList<String>();
LogOnElemNames.add("0");
List<String> LogOnEnumOptions = new ArrayList<String>();
LogOnEnumOptions.add("Never");
LogOnEnumOptions.add("Always");
LogOnEnumOptions.add("Armed");
fields.add( new UAVObjectField("LogOn", "", UAVObjectField.FieldType.ENUM, LogOnElemNames, LogOnEnumOptions) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 1000;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
getField("LogOn").setValue("Armed");
}
/**
* Create a clone of this object, a new instance ID must be specified.
* Do not use this function directly to create new instances, the
* UAVObjectManager should be used instead.
*/
public UAVDataObject clone(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;
}

View File

@ -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.
* Maintains statistics on transfer rate to and from over
*
* @see The GNU Public License (GPL) Version 3
*
*****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.openpilot.uavtalk.uavobjects;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;
import org.openpilot.uavtalk.UAVObjectManager;
import org.openpilot.uavtalk.UAVObject;
import org.openpilot.uavtalk.UAVDataObject;
import org.openpilot.uavtalk.UAVObjectField;
/**
Maintains statistics on transfer rate to and from over
generated from overosyncstats.xml
**/
public class OveroSyncStats extends UAVDataObject {
public OveroSyncStats() {
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> SendElemNames = new ArrayList<String>();
SendElemNames.add("0");
fields.add( new UAVObjectField("Send", "B/s", UAVObjectField.FieldType.UINT32, SendElemNames, null) );
List<String> ReceivedElemNames = new ArrayList<String>();
ReceivedElemNames.add("0");
fields.add( new UAVObjectField("Received", "B/s", UAVObjectField.FieldType.UINT32, ReceivedElemNames, null) );
List<String> DroppedUpdatesElemNames = new ArrayList<String>();
DroppedUpdatesElemNames.add("0");
fields.add( new UAVObjectField("DroppedUpdates", "", UAVObjectField.FieldType.UINT32, DroppedUpdatesElemNames, null) );
List<String> ConnectedElemNames = new ArrayList<String>();
ConnectedElemNames.add("0");
List<String> ConnectedEnumOptions = new ArrayList<String>();
ConnectedEnumOptions.add("False");
ConnectedEnumOptions.add("True");
fields.add( new UAVObjectField("Connected", "", UAVObjectField.FieldType.ENUM, ConnectedElemNames, ConnectedEnumOptions) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 1000;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
}
/**
* Create a clone of this object, a new instance ID must be specified.
* Do not use this function directly to create new instances, the
* UAVObjectManager should be used instead.
*/
public UAVDataObject clone(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 = 0x388468B8l;
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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> ModeParametersElemNames = new ArrayList<String>();
ModeParametersElemNames.add("0");
ModeParametersElemNames.add("1");
ModeParametersElemNames.add("2");
ModeParametersElemNames.add("3");
fields.add( new UAVObjectField("ModeParameters", "", UAVObjectField.FieldType.FLOAT32, ModeParametersElemNames, null) );
List<String> ConditionParametersElemNames = new ArrayList<String>();
ConditionParametersElemNames.add("0");
ConditionParametersElemNames.add("1");
ConditionParametersElemNames.add("2");
ConditionParametersElemNames.add("3");
fields.add( new UAVObjectField("ConditionParameters", "", UAVObjectField.FieldType.FLOAT32, ConditionParametersElemNames, null) );
List<String> ModeElemNames = new ArrayList<String>();
ModeElemNames.add("0");
List<String> ModeEnumOptions = new ArrayList<String>();
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<String> EndConditionElemNames = new ArrayList<String>();
EndConditionElemNames.add("0");
List<String> EndConditionEnumOptions = new ArrayList<String>();
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<String> CommandElemNames = new ArrayList<String>();
CommandElemNames.add("0");
List<String> CommandEnumOptions = new ArrayList<String>();
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<String> JumpDestinationElemNames = new ArrayList<String>();
JumpDestinationElemNames.add("0");
fields.add( new UAVObjectField("JumpDestination", "waypoint", UAVObjectField.FieldType.UINT8, JumpDestinationElemNames, null) );
List<String> ErrorDestinationElemNames = new ArrayList<String>();
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<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 4000;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 1000;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
}
/**
* Create a clone of this object, a new instance ID must be specified.
* Do not use this function directly to create new instances, the
* UAVObjectManager should be used instead.
*/
public UAVDataObject clone(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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> StartElemNames = new ArrayList<String>();
StartElemNames.add("North");
StartElemNames.add("East");
StartElemNames.add("Down");
fields.add( new UAVObjectField("Start", "m", UAVObjectField.FieldType.FLOAT32, StartElemNames, null) );
List<String> EndElemNames = new ArrayList<String>();
EndElemNames.add("North");
EndElemNames.add("East");
EndElemNames.add("Down");
fields.add( new UAVObjectField("End", "m", UAVObjectField.FieldType.FLOAT32, EndElemNames, null) );
List<String> StartingVelocityElemNames = new ArrayList<String>();
StartingVelocityElemNames.add("0");
fields.add( new UAVObjectField("StartingVelocity", "m/s", UAVObjectField.FieldType.FLOAT32, StartingVelocityElemNames, null) );
List<String> EndingVelocityElemNames = new ArrayList<String>();
EndingVelocityElemNames.add("0");
fields.add( new UAVObjectField("EndingVelocity", "m/s", UAVObjectField.FieldType.FLOAT32, EndingVelocityElemNames, null) );
List<String> ModeElemNames = new ArrayList<String>();
ModeElemNames.add("0");
List<String> ModeEnumOptions = new ArrayList<String>();
ModeEnumOptions.add("Endpoint");
ModeEnumOptions.add("Path");
ModeEnumOptions.add("Land");
fields.add( new UAVObjectField("Mode", "", UAVObjectField.FieldType.ENUM, ModeElemNames, ModeEnumOptions) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
}
/**
* Create a clone of this object, a new instance ID must be specified.
* Do not use this function directly to create new instances, the
* UAVObjectManager should be used instead.
*/
public UAVDataObject clone(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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> PathModeElemNames = new ArrayList<String>();
PathModeElemNames.add("0");
List<String> PathModeEnumOptions = new ArrayList<String>();
PathModeEnumOptions.add("ENDPOINT");
PathModeEnumOptions.add("PATH");
fields.add( new UAVObjectField("PathMode", "", UAVObjectField.FieldType.ENUM, PathModeElemNames, PathModeEnumOptions) );
List<String> PreprogrammedPathElemNames = new ArrayList<String>();
PreprogrammedPathElemNames.add("0");
List<String> PreprogrammedPathEnumOptions = new ArrayList<String>();
PreprogrammedPathEnumOptions.add("NONE");
PreprogrammedPathEnumOptions.add("10M_BOX");
PreprogrammedPathEnumOptions.add("LOGO");
fields.add( new UAVObjectField("PreprogrammedPath", "", UAVObjectField.FieldType.ENUM, PreprogrammedPathElemNames, PreprogrammedPathEnumOptions) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
getField("PathMode").setValue("PATH");
getField("PreprogrammedPath").setValue("NONE");
}
/**
* Create a clone of this object, a new instance ID must be specified.
* Do not use this function directly to create new instances, the
* UAVObjectManager should be used instead.
*/
public UAVDataObject clone(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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> PairIDElemNames = new ArrayList<String>();
PairIDElemNames.add("0");
fields.add( new UAVObjectField("PairID", "", UAVObjectField.FieldType.UINT32, PairIDElemNames, null) );
List<String> FrequencyElemNames = new ArrayList<String>();
FrequencyElemNames.add("0");
fields.add( new UAVObjectField("Frequency", "", UAVObjectField.FieldType.UINT32, FrequencyElemNames, null) );
List<String> SendTimeoutElemNames = new ArrayList<String>();
SendTimeoutElemNames.add("0");
fields.add( new UAVObjectField("SendTimeout", "ms", UAVObjectField.FieldType.UINT16, SendTimeoutElemNames, null) );
List<String> TelemetryConfigElemNames = new ArrayList<String>();
TelemetryConfigElemNames.add("0");
List<String> TelemetryConfigEnumOptions = new ArrayList<String>();
TelemetryConfigEnumOptions.add("Disabled");
TelemetryConfigEnumOptions.add("Serial");
TelemetryConfigEnumOptions.add("UAVTalk");
TelemetryConfigEnumOptions.add("GCS");
TelemetryConfigEnumOptions.add("Debug");
fields.add( new UAVObjectField("TelemetryConfig", "function", UAVObjectField.FieldType.ENUM, TelemetryConfigElemNames, TelemetryConfigEnumOptions) );
List<String> TelemetrySpeedElemNames = new ArrayList<String>();
TelemetrySpeedElemNames.add("0");
List<String> TelemetrySpeedEnumOptions = new ArrayList<String>();
TelemetrySpeedEnumOptions.add("2400");
TelemetrySpeedEnumOptions.add("4800");
TelemetrySpeedEnumOptions.add("9600");
TelemetrySpeedEnumOptions.add("19200");
TelemetrySpeedEnumOptions.add("38400");
TelemetrySpeedEnumOptions.add("57600");
TelemetrySpeedEnumOptions.add("115200");
fields.add( new UAVObjectField("TelemetrySpeed", "bps", UAVObjectField.FieldType.ENUM, TelemetrySpeedElemNames, TelemetrySpeedEnumOptions) );
List<String> FlexiConfigElemNames = new ArrayList<String>();
FlexiConfigElemNames.add("0");
List<String> FlexiConfigEnumOptions = new ArrayList<String>();
FlexiConfigEnumOptions.add("Disabled");
FlexiConfigEnumOptions.add("Serial");
FlexiConfigEnumOptions.add("UAVTalk");
FlexiConfigEnumOptions.add("GCS");
FlexiConfigEnumOptions.add("PPM_In");
FlexiConfigEnumOptions.add("PPM_Out");
FlexiConfigEnumOptions.add("RSSI");
FlexiConfigEnumOptions.add("Debug");
fields.add( new UAVObjectField("FlexiConfig", "function", UAVObjectField.FieldType.ENUM, FlexiConfigElemNames, FlexiConfigEnumOptions) );
List<String> FlexiSpeedElemNames = new ArrayList<String>();
FlexiSpeedElemNames.add("0");
List<String> FlexiSpeedEnumOptions = new ArrayList<String>();
FlexiSpeedEnumOptions.add("2400");
FlexiSpeedEnumOptions.add("4800");
FlexiSpeedEnumOptions.add("9600");
FlexiSpeedEnumOptions.add("19200");
FlexiSpeedEnumOptions.add("38400");
FlexiSpeedEnumOptions.add("57600");
FlexiSpeedEnumOptions.add("115200");
fields.add( new UAVObjectField("FlexiSpeed", "bps", UAVObjectField.FieldType.ENUM, FlexiSpeedElemNames, FlexiSpeedEnumOptions) );
List<String> VCPConfigElemNames = new ArrayList<String>();
VCPConfigElemNames.add("0");
List<String> VCPConfigEnumOptions = new ArrayList<String>();
VCPConfigEnumOptions.add("Disabled");
VCPConfigEnumOptions.add("Serial");
VCPConfigEnumOptions.add("Debug");
fields.add( new UAVObjectField("VCPConfig", "function", UAVObjectField.FieldType.ENUM, VCPConfigElemNames, VCPConfigEnumOptions) );
List<String> VCPSpeedElemNames = new ArrayList<String>();
VCPSpeedElemNames.add("0");
List<String> VCPSpeedEnumOptions = new ArrayList<String>();
VCPSpeedEnumOptions.add("2400");
VCPSpeedEnumOptions.add("4800");
VCPSpeedEnumOptions.add("9600");
VCPSpeedEnumOptions.add("19200");
VCPSpeedEnumOptions.add("38400");
VCPSpeedEnumOptions.add("57600");
VCPSpeedEnumOptions.add("115200");
fields.add( new UAVObjectField("VCPSpeed", "bps", UAVObjectField.FieldType.ENUM, VCPSpeedElemNames, VCPSpeedEnumOptions) );
List<String> RFSpeedElemNames = new ArrayList<String>();
RFSpeedElemNames.add("0");
List<String> RFSpeedEnumOptions = new ArrayList<String>();
RFSpeedEnumOptions.add("2400");
RFSpeedEnumOptions.add("4800");
RFSpeedEnumOptions.add("9600");
RFSpeedEnumOptions.add("19200");
RFSpeedEnumOptions.add("38400");
RFSpeedEnumOptions.add("57600");
RFSpeedEnumOptions.add("115200");
fields.add( new UAVObjectField("RFSpeed", "bps", UAVObjectField.FieldType.ENUM, RFSpeedElemNames, RFSpeedEnumOptions) );
List<String> MaxRFPowerElemNames = new ArrayList<String>();
MaxRFPowerElemNames.add("0");
List<String> MaxRFPowerEnumOptions = new ArrayList<String>();
MaxRFPowerEnumOptions.add("1.25");
MaxRFPowerEnumOptions.add("1.6");
MaxRFPowerEnumOptions.add("3.16");
MaxRFPowerEnumOptions.add("6.3");
MaxRFPowerEnumOptions.add("12.6");
MaxRFPowerEnumOptions.add("25");
MaxRFPowerEnumOptions.add("50");
MaxRFPowerEnumOptions.add("100");
fields.add( new UAVObjectField("MaxRFPower", "mW", UAVObjectField.FieldType.ENUM, MaxRFPowerElemNames, MaxRFPowerEnumOptions) );
List<String> MinPacketSizeElemNames = new ArrayList<String>();
MinPacketSizeElemNames.add("0");
fields.add( new UAVObjectField("MinPacketSize", "bytes", UAVObjectField.FieldType.UINT8, MinPacketSizeElemNames, null) );
List<String> FrequencyCalibrationElemNames = new ArrayList<String>();
FrequencyCalibrationElemNames.add("0");
fields.add( new UAVObjectField("FrequencyCalibration", "", UAVObjectField.FieldType.UINT8, FrequencyCalibrationElemNames, null) );
List<String> AESKeyElemNames = new ArrayList<String>();
AESKeyElemNames.add("0");
AESKeyElemNames.add("1");
AESKeyElemNames.add("2");
AESKeyElemNames.add("3");
AESKeyElemNames.add("4");
AESKeyElemNames.add("5");
AESKeyElemNames.add("6");
AESKeyElemNames.add("7");
AESKeyElemNames.add("8");
AESKeyElemNames.add("9");
AESKeyElemNames.add("10");
AESKeyElemNames.add("11");
AESKeyElemNames.add("12");
AESKeyElemNames.add("13");
AESKeyElemNames.add("14");
AESKeyElemNames.add("15");
AESKeyElemNames.add("16");
AESKeyElemNames.add("17");
AESKeyElemNames.add("18");
AESKeyElemNames.add("19");
AESKeyElemNames.add("20");
AESKeyElemNames.add("21");
AESKeyElemNames.add("22");
AESKeyElemNames.add("23");
AESKeyElemNames.add("24");
AESKeyElemNames.add("25");
AESKeyElemNames.add("26");
AESKeyElemNames.add("27");
AESKeyElemNames.add("28");
AESKeyElemNames.add("29");
AESKeyElemNames.add("30");
AESKeyElemNames.add("31");
fields.add( new UAVObjectField("AESKey", "", UAVObjectField.FieldType.UINT8, AESKeyElemNames, null) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
getField("PairID").setValue(0);
getField("Frequency").setValue(434000000);
getField("SendTimeout").setValue(50);
getField("TelemetryConfig").setValue("UAVTalk");
getField("TelemetrySpeed").setValue("57600");
getField("FlexiConfig").setValue("Disabled");
getField("FlexiSpeed").setValue("57600");
getField("VCPConfig").setValue("Disabled");
getField("VCPSpeed").setValue("57600");
getField("RFSpeed").setValue("115200");
getField("MaxRFPower").setValue("100");
getField("MinPacketSize").setValue(50);
getField("FrequencyCalibration").setValue(127);
getField("AESKey").setValue(0,0);
getField("AESKey").setValue(0,1);
getField("AESKey").setValue(0,2);
getField("AESKey").setValue(0,3);
getField("AESKey").setValue(0,4);
getField("AESKey").setValue(0,5);
getField("AESKey").setValue(0,6);
getField("AESKey").setValue(0,7);
getField("AESKey").setValue(0,8);
getField("AESKey").setValue(0,9);
getField("AESKey").setValue(0,10);
getField("AESKey").setValue(0,11);
getField("AESKey").setValue(0,12);
getField("AESKey").setValue(0,13);
getField("AESKey").setValue(0,14);
getField("AESKey").setValue(0,15);
getField("AESKey").setValue(0,16);
getField("AESKey").setValue(0,17);
getField("AESKey").setValue(0,18);
getField("AESKey").setValue(0,19);
getField("AESKey").setValue(0,20);
getField("AESKey").setValue(0,21);
getField("AESKey").setValue(0,22);
getField("AESKey").setValue(0,23);
getField("AESKey").setValue(0,24);
getField("AESKey").setValue(0,25);
getField("AESKey").setValue(0,26);
getField("AESKey").setValue(0,27);
getField("AESKey").setValue(0,28);
getField("AESKey").setValue(0,29);
getField("AESKey").setValue(0,30);
getField("AESKey").setValue(0,31);
}
/**
* Create a clone of this object, a new instance ID must be specified.
* Do not use this function directly to create new instances, the
* UAVObjectManager should be used instead.
*/
public UAVDataObject clone(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;
}

View File

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

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> NorthElemNames = new ArrayList<String>();
NorthElemNames.add("0");
fields.add( new UAVObjectField("North", "m", UAVObjectField.FieldType.FLOAT32, NorthElemNames, null) );
List<String> EastElemNames = new ArrayList<String>();
EastElemNames.add("0");
fields.add( new UAVObjectField("East", "m", UAVObjectField.FieldType.FLOAT32, EastElemNames, null) );
List<String> DownElemNames = new ArrayList<String>();
DownElemNames.add("0");
fields.add( new UAVObjectField("Down", "m", UAVObjectField.FieldType.FLOAT32, DownElemNames, null) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 1000;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
}
/**
* Create a clone of this object, a new instance ID must be specified.
* Do not use this function directly to create new instances, the
* UAVObjectManager should be used instead.
*/
public UAVDataObject clone(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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> NorthElemNames = new ArrayList<String>();
NorthElemNames.add("0");
fields.add( new UAVObjectField("North", "m", UAVObjectField.FieldType.FLOAT32, NorthElemNames, null) );
List<String> EastElemNames = new ArrayList<String>();
EastElemNames.add("0");
fields.add( new UAVObjectField("East", "m", UAVObjectField.FieldType.FLOAT32, EastElemNames, null) );
List<String> DownElemNames = new ArrayList<String>();
DownElemNames.add("0");
fields.add( new UAVObjectField("Down", "m", UAVObjectField.FieldType.FLOAT32, DownElemNames, null) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> RollElemNames = new ArrayList<String>();
RollElemNames.add("0");
fields.add( new UAVObjectField("Roll", "deg/s", UAVObjectField.FieldType.FLOAT32, RollElemNames, null) );
List<String> PitchElemNames = new ArrayList<String>();
PitchElemNames.add("0");
fields.add( new UAVObjectField("Pitch", "deg/s", UAVObjectField.FieldType.FLOAT32, PitchElemNames, null) );
List<String> YawElemNames = new ArrayList<String>();
YawElemNames.add("0");
fields.add( new UAVObjectField("Yaw", "deg/s", UAVObjectField.FieldType.FLOAT32, YawElemNames, null) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> ActiveGroupElemNames = new ArrayList<String>();
ActiveGroupElemNames.add("0");
List<String> ActiveGroupEnumOptions = new ArrayList<String>();
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<String> ActiveChannelElemNames = new ArrayList<String>();
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<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READONLY) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> PeriodElemNames = new ArrayList<String>();
PeriodElemNames.add("Roll");
PeriodElemNames.add("Pitch");
PeriodElemNames.add("Yaw");
fields.add( new UAVObjectField("Period", "ms", UAVObjectField.FieldType.FLOAT32, PeriodElemNames, null) );
List<String> GainElemNames = new ArrayList<String>();
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<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
}
/**
* Create a clone of this object, a new instance ID must be specified.
* Do not use this function directly to create new instances, the
* UAVObjectManager should be used instead.
*/
public UAVDataObject clone(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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> RateGainElemNames = new ArrayList<String>();
RateGainElemNames.add("0");
fields.add( new UAVObjectField("RateGain", "", UAVObjectField.FieldType.FLOAT32, RateGainElemNames, null) );
List<String> AttitudeGainElemNames = new ArrayList<String>();
AttitudeGainElemNames.add("0");
fields.add( new UAVObjectField("AttitudeGain", "", UAVObjectField.FieldType.FLOAT32, AttitudeGainElemNames, null) );
List<String> AmplitudeElemNames = new ArrayList<String>();
AmplitudeElemNames.add("0");
fields.add( new UAVObjectField("Amplitude", "", UAVObjectField.FieldType.FLOAT32, AmplitudeElemNames, null) );
List<String> HysteresisThreshElemNames = new ArrayList<String>();
HysteresisThreshElemNames.add("0");
fields.add( new UAVObjectField("HysteresisThresh", "deg/s", UAVObjectField.FieldType.UINT8, HysteresisThreshElemNames, null) );
List<String> ModeElemNames = new ArrayList<String>();
ModeElemNames.add("0");
List<String> ModeEnumOptions = new ArrayList<String>();
ModeEnumOptions.add("Rate");
ModeEnumOptions.add("Attitude");
fields.add( new UAVObjectField("Mode", "", UAVObjectField.FieldType.ENUM, ModeElemNames, ModeEnumOptions) );
List<String> BehaviorElemNames = new ArrayList<String>();
BehaviorElemNames.add("0");
List<String> BehaviorEnumOptions = new ArrayList<String>();
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<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
getField("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;
}

View File

@ -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 INS to control the algorithm and what is updated
*
* @see The GNU Public License (GPL) Version 3
*
*****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.openpilot.uavtalk.uavobjects;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;
import org.openpilot.uavtalk.UAVObjectManager;
import org.openpilot.uavtalk.UAVObject;
import org.openpilot.uavtalk.UAVDataObject;
import org.openpilot.uavtalk.UAVObjectField;
/**
Settings for the INS to control the algorithm and what is updated
generated from revocalibration.xml
**/
public class RevoCalibration extends UAVDataObject {
public RevoCalibration() {
super(OBJID, ISSINGLEINST, ISSETTINGS, NAME);
List<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> accel_biasElemNames = new ArrayList<String>();
accel_biasElemNames.add("X");
accel_biasElemNames.add("Y");
accel_biasElemNames.add("Z");
fields.add( new UAVObjectField("accel_bias", "m/s", UAVObjectField.FieldType.FLOAT32, accel_biasElemNames, null) );
List<String> accel_scaleElemNames = new ArrayList<String>();
accel_scaleElemNames.add("X");
accel_scaleElemNames.add("Y");
accel_scaleElemNames.add("Z");
fields.add( new UAVObjectField("accel_scale", "gain", UAVObjectField.FieldType.FLOAT32, accel_scaleElemNames, null) );
List<String> accel_varElemNames = new ArrayList<String>();
accel_varElemNames.add("X");
accel_varElemNames.add("Y");
accel_varElemNames.add("Z");
fields.add( new UAVObjectField("accel_var", "(m/s)^2", UAVObjectField.FieldType.FLOAT32, accel_varElemNames, null) );
List<String> gyro_biasElemNames = new ArrayList<String>();
gyro_biasElemNames.add("X");
gyro_biasElemNames.add("Y");
gyro_biasElemNames.add("Z");
fields.add( new UAVObjectField("gyro_bias", "deg/s", UAVObjectField.FieldType.FLOAT32, gyro_biasElemNames, null) );
List<String> gyro_scaleElemNames = new ArrayList<String>();
gyro_scaleElemNames.add("X");
gyro_scaleElemNames.add("Y");
gyro_scaleElemNames.add("Z");
fields.add( new UAVObjectField("gyro_scale", "gain", UAVObjectField.FieldType.FLOAT32, gyro_scaleElemNames, null) );
List<String> gyro_varElemNames = new ArrayList<String>();
gyro_varElemNames.add("X");
gyro_varElemNames.add("Y");
gyro_varElemNames.add("Z");
fields.add( new UAVObjectField("gyro_var", "(deg/s)^2", UAVObjectField.FieldType.FLOAT32, gyro_varElemNames, null) );
List<String> gyro_tempcoeffElemNames = new ArrayList<String>();
gyro_tempcoeffElemNames.add("X");
gyro_tempcoeffElemNames.add("Y");
gyro_tempcoeffElemNames.add("Z");
fields.add( new UAVObjectField("gyro_tempcoeff", "(deg/s)/deg", UAVObjectField.FieldType.FLOAT32, gyro_tempcoeffElemNames, null) );
List<String> mag_biasElemNames = new ArrayList<String>();
mag_biasElemNames.add("X");
mag_biasElemNames.add("Y");
mag_biasElemNames.add("Z");
fields.add( new UAVObjectField("mag_bias", "mGau", UAVObjectField.FieldType.FLOAT32, mag_biasElemNames, null) );
List<String> mag_scaleElemNames = new ArrayList<String>();
mag_scaleElemNames.add("X");
mag_scaleElemNames.add("Y");
mag_scaleElemNames.add("Z");
fields.add( new UAVObjectField("mag_scale", "gain", UAVObjectField.FieldType.FLOAT32, mag_scaleElemNames, null) );
List<String> mag_varElemNames = new ArrayList<String>();
mag_varElemNames.add("X");
mag_varElemNames.add("Y");
mag_varElemNames.add("Z");
fields.add( new UAVObjectField("mag_var", "mGau^2", UAVObjectField.FieldType.FLOAT32, mag_varElemNames, null) );
List<String> BiasCorrectedRawElemNames = new ArrayList<String>();
BiasCorrectedRawElemNames.add("0");
List<String> BiasCorrectedRawEnumOptions = new ArrayList<String>();
BiasCorrectedRawEnumOptions.add("TRUE");
BiasCorrectedRawEnumOptions.add("FALSE");
fields.add( new UAVObjectField("BiasCorrectedRaw", "", UAVObjectField.FieldType.ENUM, BiasCorrectedRawElemNames, BiasCorrectedRawEnumOptions) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
getField("accel_bias").setValue(0,0);
getField("accel_bias").setValue(0,1);
getField("accel_bias").setValue(0,2);
getField("accel_scale").setValue(1,0);
getField("accel_scale").setValue(1,1);
getField("accel_scale").setValue(1,2);
getField("accel_var").setValue(1,0);
getField("accel_var").setValue(1,1);
getField("accel_var").setValue(1,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(1,0);
getField("gyro_var").setValue(1,1);
getField("gyro_var").setValue(1,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(50,0);
getField("mag_var").setValue(50,1);
getField("mag_var").setValue(50,2);
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 = 0xC26D37B2l;
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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> FusionAlgorithmElemNames = new ArrayList<String>();
FusionAlgorithmElemNames.add("0");
List<String> FusionAlgorithmEnumOptions = new ArrayList<String>();
FusionAlgorithmEnumOptions.add("Complimentary");
FusionAlgorithmEnumOptions.add("INSIndoor");
FusionAlgorithmEnumOptions.add("INSOutdoor");
fields.add( new UAVObjectField("FusionAlgorithm", "", UAVObjectField.FieldType.ENUM, FusionAlgorithmElemNames, FusionAlgorithmEnumOptions) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
getField("FusionAlgorithm").setValue("Complimentary");
}
/**
* Create a clone of this object, a new instance ID must be specified.
* Do not use this function directly to create new instances, the
* UAVObjectManager should be used instead.
*/
public UAVDataObject clone(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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> AltitudeElemNames = new ArrayList<String>();
AltitudeElemNames.add("0");
fields.add( new UAVObjectField("Altitude", "m", UAVObjectField.FieldType.FLOAT32, AltitudeElemNames, null) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
}
/**
* Create a clone of this object, a new instance ID must be specified.
* Do not use this function directly to create new instances, the
* UAVObjectManager should be used instead.
*/
public UAVDataObject clone(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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> RollElemNames = new ArrayList<String>();
RollElemNames.add("0");
fields.add( new UAVObjectField("Roll", "degrees", UAVObjectField.FieldType.FLOAT32, RollElemNames, null) );
List<String> PitchElemNames = new ArrayList<String>();
PitchElemNames.add("0");
fields.add( new UAVObjectField("Pitch", "degrees", UAVObjectField.FieldType.FLOAT32, PitchElemNames, null) );
List<String> YawElemNames = new ArrayList<String>();
YawElemNames.add("0");
fields.add( new UAVObjectField("Yaw", "degrees", UAVObjectField.FieldType.FLOAT32, YawElemNames, null) );
List<String> ThrottleElemNames = new ArrayList<String>();
ThrottleElemNames.add("0");
fields.add( new UAVObjectField("Throttle", "%", UAVObjectField.FieldType.FLOAT32, ThrottleElemNames, null) );
List<String> StabilizationModeElemNames = new ArrayList<String>();
StabilizationModeElemNames.add("Roll");
StabilizationModeElemNames.add("Pitch");
StabilizationModeElemNames.add("Yaw");
List<String> StabilizationModeEnumOptions = new ArrayList<String>();
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<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
}
/**
* Create a clone of this object, a new instance ID must be specified.
* Do not use this function directly to create new instances, the
* UAVObjectManager should be used instead.
*/
public UAVDataObject clone(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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> ManualRateElemNames = new ArrayList<String>();
ManualRateElemNames.add("Roll");
ManualRateElemNames.add("Pitch");
ManualRateElemNames.add("Yaw");
fields.add( new UAVObjectField("ManualRate", "degrees/sec", UAVObjectField.FieldType.FLOAT32, ManualRateElemNames, null) );
List<String> MaximumRateElemNames = new ArrayList<String>();
MaximumRateElemNames.add("Roll");
MaximumRateElemNames.add("Pitch");
MaximumRateElemNames.add("Yaw");
fields.add( new UAVObjectField("MaximumRate", "degrees/sec", UAVObjectField.FieldType.FLOAT32, MaximumRateElemNames, null) );
List<String> RollRatePIDElemNames = new ArrayList<String>();
RollRatePIDElemNames.add("Kp");
RollRatePIDElemNames.add("Ki");
RollRatePIDElemNames.add("Kd");
RollRatePIDElemNames.add("ILimit");
fields.add( new UAVObjectField("RollRatePID", "", UAVObjectField.FieldType.FLOAT32, RollRatePIDElemNames, null) );
List<String> PitchRatePIDElemNames = new ArrayList<String>();
PitchRatePIDElemNames.add("Kp");
PitchRatePIDElemNames.add("Ki");
PitchRatePIDElemNames.add("Kd");
PitchRatePIDElemNames.add("ILimit");
fields.add( new UAVObjectField("PitchRatePID", "", UAVObjectField.FieldType.FLOAT32, PitchRatePIDElemNames, null) );
List<String> YawRatePIDElemNames = new ArrayList<String>();
YawRatePIDElemNames.add("Kp");
YawRatePIDElemNames.add("Ki");
YawRatePIDElemNames.add("Kd");
YawRatePIDElemNames.add("ILimit");
fields.add( new UAVObjectField("YawRatePID", "", UAVObjectField.FieldType.FLOAT32, YawRatePIDElemNames, null) );
List<String> RollPIElemNames = new ArrayList<String>();
RollPIElemNames.add("Kp");
RollPIElemNames.add("Ki");
RollPIElemNames.add("ILimit");
fields.add( new UAVObjectField("RollPI", "", UAVObjectField.FieldType.FLOAT32, RollPIElemNames, null) );
List<String> PitchPIElemNames = new ArrayList<String>();
PitchPIElemNames.add("Kp");
PitchPIElemNames.add("Ki");
PitchPIElemNames.add("ILimit");
fields.add( new UAVObjectField("PitchPI", "", UAVObjectField.FieldType.FLOAT32, PitchPIElemNames, null) );
List<String> YawPIElemNames = new ArrayList<String>();
YawPIElemNames.add("Kp");
YawPIElemNames.add("Ki");
YawPIElemNames.add("ILimit");
fields.add( new UAVObjectField("YawPI", "", UAVObjectField.FieldType.FLOAT32, YawPIElemNames, null) );
List<String> VbarSensitivityElemNames = new ArrayList<String>();
VbarSensitivityElemNames.add("Roll");
VbarSensitivityElemNames.add("Pitch");
VbarSensitivityElemNames.add("Yaw");
fields.add( new UAVObjectField("VbarSensitivity", "frac", UAVObjectField.FieldType.FLOAT32, VbarSensitivityElemNames, null) );
List<String> VbarRollPIElemNames = new ArrayList<String>();
VbarRollPIElemNames.add("Kp");
VbarRollPIElemNames.add("Ki");
fields.add( new UAVObjectField("VbarRollPI", "1/(deg/s)", UAVObjectField.FieldType.FLOAT32, VbarRollPIElemNames, null) );
List<String> VbarPitchPIElemNames = new ArrayList<String>();
VbarPitchPIElemNames.add("Kp");
VbarPitchPIElemNames.add("Ki");
fields.add( new UAVObjectField("VbarPitchPI", "1/(deg/s)", UAVObjectField.FieldType.FLOAT32, VbarPitchPIElemNames, null) );
List<String> VbarYawPIElemNames = new ArrayList<String>();
VbarYawPIElemNames.add("Kp");
VbarYawPIElemNames.add("Ki");
fields.add( new UAVObjectField("VbarYawPI", "1/(deg/s)", UAVObjectField.FieldType.FLOAT32, VbarYawPIElemNames, null) );
List<String> VbarTauElemNames = new ArrayList<String>();
VbarTauElemNames.add("0");
fields.add( new UAVObjectField("VbarTau", "sec", UAVObjectField.FieldType.FLOAT32, VbarTauElemNames, null) );
List<String> GyroTauElemNames = new ArrayList<String>();
GyroTauElemNames.add("0");
fields.add( new UAVObjectField("GyroTau", "", UAVObjectField.FieldType.FLOAT32, GyroTauElemNames, null) );
List<String> DerivativeGammaElemNames = new ArrayList<String>();
DerivativeGammaElemNames.add("0");
fields.add( new UAVObjectField("DerivativeGamma", "", UAVObjectField.FieldType.FLOAT32, DerivativeGammaElemNames, null) );
List<String> WeakLevelingKpElemNames = new ArrayList<String>();
WeakLevelingKpElemNames.add("0");
fields.add( new UAVObjectField("WeakLevelingKp", "(deg/s)/deg", UAVObjectField.FieldType.FLOAT32, WeakLevelingKpElemNames, null) );
List<String> RollMaxElemNames = new ArrayList<String>();
RollMaxElemNames.add("0");
fields.add( new UAVObjectField("RollMax", "degrees", UAVObjectField.FieldType.UINT8, RollMaxElemNames, null) );
List<String> PitchMaxElemNames = new ArrayList<String>();
PitchMaxElemNames.add("0");
fields.add( new UAVObjectField("PitchMax", "degrees", UAVObjectField.FieldType.UINT8, PitchMaxElemNames, null) );
List<String> YawMaxElemNames = new ArrayList<String>();
YawMaxElemNames.add("0");
fields.add( new UAVObjectField("YawMax", "degrees", UAVObjectField.FieldType.UINT8, YawMaxElemNames, null) );
List<String> VbarGyroSuppressElemNames = new ArrayList<String>();
VbarGyroSuppressElemNames.add("0");
fields.add( new UAVObjectField("VbarGyroSuppress", "%", UAVObjectField.FieldType.INT8, VbarGyroSuppressElemNames, null) );
List<String> VbarPiroCompElemNames = new ArrayList<String>();
VbarPiroCompElemNames.add("0");
List<String> VbarPiroCompEnumOptions = new ArrayList<String>();
VbarPiroCompEnumOptions.add("FALSE");
VbarPiroCompEnumOptions.add("TRUE");
fields.add( new UAVObjectField("VbarPiroComp", "", UAVObjectField.FieldType.ENUM, VbarPiroCompElemNames, VbarPiroCompEnumOptions) );
List<String> VbarMaxAngleElemNames = new ArrayList<String>();
VbarMaxAngleElemNames.add("0");
fields.add( new UAVObjectField("VbarMaxAngle", "deg", UAVObjectField.FieldType.UINT8, VbarMaxAngleElemNames, null) );
List<String> DerivativeCutoffElemNames = new ArrayList<String>();
DerivativeCutoffElemNames.add("0");
fields.add( new UAVObjectField("DerivativeCutoff", "Hz", UAVObjectField.FieldType.UINT8, DerivativeCutoffElemNames, null) );
List<String> MaxAxisLockElemNames = new ArrayList<String>();
MaxAxisLockElemNames.add("0");
fields.add( new UAVObjectField("MaxAxisLock", "deg", UAVObjectField.FieldType.UINT8, MaxAxisLockElemNames, null) );
List<String> MaxAxisLockRateElemNames = new ArrayList<String>();
MaxAxisLockRateElemNames.add("0");
fields.add( new UAVObjectField("MaxAxisLockRate", "deg/s", UAVObjectField.FieldType.UINT8, MaxAxisLockRateElemNames, null) );
List<String> MaxWeakLevelingRateElemNames = new ArrayList<String>();
MaxWeakLevelingRateElemNames.add("0");
fields.add( new UAVObjectField("MaxWeakLevelingRate", "deg/s", UAVObjectField.FieldType.UINT8, MaxWeakLevelingRateElemNames, null) );
List<String> LowThrottleZeroIntegralElemNames = new ArrayList<String>();
LowThrottleZeroIntegralElemNames.add("0");
List<String> LowThrottleZeroIntegralEnumOptions = new ArrayList<String>();
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<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
getField("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;
}

View File

@ -1,175 +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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> AlarmElemNames = new ArrayList<String>();
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");
List<String> AlarmEnumOptions = new ArrayList<String>();
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<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 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);
}
/**
* 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 = 0x7BD9C77Al;
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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> GUIConfigDataElemNames = new ArrayList<String>();
GUIConfigDataElemNames.add("0");
GUIConfigDataElemNames.add("1");
GUIConfigDataElemNames.add("2");
GUIConfigDataElemNames.add("3");
fields.add( new UAVObjectField("GUIConfigData", "bits", UAVObjectField.FieldType.UINT32, GUIConfigDataElemNames, null) );
List<String> AirframeTypeElemNames = new ArrayList<String>();
AirframeTypeElemNames.add("0");
List<String> AirframeTypeEnumOptions = new ArrayList<String>();
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<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
getField("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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> FlightTimeElemNames = new ArrayList<String>();
FlightTimeElemNames.add("0");
fields.add( new UAVObjectField("FlightTime", "ms", UAVObjectField.FieldType.UINT32, FlightTimeElemNames, null) );
List<String> EventSystemWarningIDElemNames = new ArrayList<String>();
EventSystemWarningIDElemNames.add("0");
fields.add( new UAVObjectField("EventSystemWarningID", "uavoid", UAVObjectField.FieldType.UINT32, EventSystemWarningIDElemNames, null) );
List<String> ObjectManagerCallbackIDElemNames = new ArrayList<String>();
ObjectManagerCallbackIDElemNames.add("0");
fields.add( new UAVObjectField("ObjectManagerCallbackID", "uavoid", UAVObjectField.FieldType.UINT32, ObjectManagerCallbackIDElemNames, null) );
List<String> ObjectManagerQueueIDElemNames = new ArrayList<String>();
ObjectManagerQueueIDElemNames.add("0");
fields.add( new UAVObjectField("ObjectManagerQueueID", "uavoid", UAVObjectField.FieldType.UINT32, ObjectManagerQueueIDElemNames, null) );
List<String> HeapRemainingElemNames = new ArrayList<String>();
HeapRemainingElemNames.add("0");
fields.add( new UAVObjectField("HeapRemaining", "bytes", UAVObjectField.FieldType.UINT16, HeapRemainingElemNames, null) );
List<String> IRQStackRemainingElemNames = new ArrayList<String>();
IRQStackRemainingElemNames.add("0");
fields.add( new UAVObjectField("IRQStackRemaining", "bytes", UAVObjectField.FieldType.UINT16, IRQStackRemainingElemNames, null) );
List<String> CPULoadElemNames = new ArrayList<String>();
CPULoadElemNames.add("0");
fields.add( new UAVObjectField("CPULoad", "%", UAVObjectField.FieldType.UINT8, CPULoadElemNames, null) );
List<String> CPUTempElemNames = new ArrayList<String>();
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<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 1000;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
}
/**
* Create a clone of this object, a new instance ID must be specified.
* Do not use this function directly to create new instances, the
* UAVObjectManager should be used instead.
*/
public UAVDataObject clone(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;
}

View File

@ -1,203 +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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> StackRemainingElemNames = new ArrayList<String>();
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("Stabilization");
StackRemainingElemNames.add("AltitudeHold");
StackRemainingElemNames.add("Guidance");
StackRemainingElemNames.add("FlightPlan");
StackRemainingElemNames.add("Com2UsbBridge");
StackRemainingElemNames.add("Usb2ComBridge");
StackRemainingElemNames.add("OveroSync");
StackRemainingElemNames.add("Autotune");
StackRemainingElemNames.add("EventDispatcher");
fields.add( new UAVObjectField("StackRemaining", "bytes", UAVObjectField.FieldType.UINT16, StackRemainingElemNames, null) );
List<String> RunningElemNames = new ArrayList<String>();
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("Stabilization");
RunningElemNames.add("AltitudeHold");
RunningElemNames.add("Guidance");
RunningElemNames.add("FlightPlan");
RunningElemNames.add("Com2UsbBridge");
RunningElemNames.add("Usb2ComBridge");
RunningElemNames.add("OveroSync");
RunningElemNames.add("Autotune");
RunningElemNames.add("EventDispatcher");
List<String> RunningEnumOptions = new ArrayList<String>();
RunningEnumOptions.add("False");
RunningEnumOptions.add("True");
fields.add( new UAVObjectField("Running", "bool", UAVObjectField.FieldType.ENUM, RunningElemNames, RunningEnumOptions) );
List<String> RunningTimeElemNames = new ArrayList<String>();
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("Stabilization");
RunningTimeElemNames.add("AltitudeHold");
RunningTimeElemNames.add("Guidance");
RunningTimeElemNames.add("FlightPlan");
RunningTimeElemNames.add("Com2UsbBridge");
RunningTimeElemNames.add("Usb2ComBridge");
RunningTimeElemNames.add("OveroSync");
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<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_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 = 0xB81CD2AEl;
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;
}

View File

@ -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();
}
}
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> ThrottleRangeElemNames = new ArrayList<String>();
ThrottleRangeElemNames.add("Min");
ThrottleRangeElemNames.add("Max");
fields.add( new UAVObjectField("ThrottleRange", "%", UAVObjectField.FieldType.FLOAT32, ThrottleRangeElemNames, null) );
List<String> MinPIDElemNames = new ArrayList<String>();
MinPIDElemNames.add("Instance1");
MinPIDElemNames.add("Instance2");
MinPIDElemNames.add("Instance3");
fields.add( new UAVObjectField("MinPID", "", UAVObjectField.FieldType.FLOAT32, MinPIDElemNames, null) );
List<String> MaxPIDElemNames = new ArrayList<String>();
MaxPIDElemNames.add("Instance1");
MaxPIDElemNames.add("Instance2");
MaxPIDElemNames.add("Instance3");
fields.add( new UAVObjectField("MaxPID", "", UAVObjectField.FieldType.FLOAT32, MaxPIDElemNames, null) );
List<String> UpdateModeElemNames = new ArrayList<String>();
UpdateModeElemNames.add("0");
List<String> UpdateModeEnumOptions = new ArrayList<String>();
UpdateModeEnumOptions.add("Never");
UpdateModeEnumOptions.add("When Armed");
UpdateModeEnumOptions.add("Always");
fields.add( new UAVObjectField("UpdateMode", "option", UAVObjectField.FieldType.ENUM, UpdateModeElemNames, UpdateModeEnumOptions) );
List<String> InputsElemNames = new ArrayList<String>();
InputsElemNames.add("Instance1");
InputsElemNames.add("Instance2");
InputsElemNames.add("Instance3");
List<String> InputsEnumOptions = new ArrayList<String>();
InputsEnumOptions.add("Throttle");
InputsEnumOptions.add("Accessory0");
InputsEnumOptions.add("Accessory1");
InputsEnumOptions.add("Accessory2");
InputsEnumOptions.add("Accessory3");
InputsEnumOptions.add("Accessory4");
InputsEnumOptions.add("Accessory5");
fields.add( new UAVObjectField("Inputs", "channel", UAVObjectField.FieldType.ENUM, InputsElemNames, InputsEnumOptions) );
List<String> PIDsElemNames = new ArrayList<String>();
PIDsElemNames.add("Instance1");
PIDsElemNames.add("Instance2");
PIDsElemNames.add("Instance3");
List<String> PIDsEnumOptions = new ArrayList<String>();
PIDsEnumOptions.add("Disabled");
PIDsEnumOptions.add("Roll Rate.Kp");
PIDsEnumOptions.add("Pitch Rate.Kp");
PIDsEnumOptions.add("Roll+Pitch Rate.Kp");
PIDsEnumOptions.add("Yaw Rate.Kp");
PIDsEnumOptions.add("Roll Rate.Ki");
PIDsEnumOptions.add("Pitch Rate.Ki");
PIDsEnumOptions.add("Roll+Pitch Rate.Ki");
PIDsEnumOptions.add("Yaw Rate.Ki");
PIDsEnumOptions.add("Roll Rate.Kd");
PIDsEnumOptions.add("Pitch Rate.Kd");
PIDsEnumOptions.add("Roll+Pitch Rate.Kd");
PIDsEnumOptions.add("Yaw Rate.Kd");
PIDsEnumOptions.add("Roll Rate.ILimit");
PIDsEnumOptions.add("Pitch Rate.ILimit");
PIDsEnumOptions.add("Roll+Pitch Rate.ILimit");
PIDsEnumOptions.add("Yaw Rate.ILimit");
PIDsEnumOptions.add("Roll Attitude.Kp");
PIDsEnumOptions.add("Pitch Attitude.Kp");
PIDsEnumOptions.add("Roll+Pitch Attitude.Kp");
PIDsEnumOptions.add("Yaw Attitude.Kp");
PIDsEnumOptions.add("Roll Attitude.Ki");
PIDsEnumOptions.add("Pitch Attitude.Ki");
PIDsEnumOptions.add("Roll+Pitch Attitude.Ki");
PIDsEnumOptions.add("Yaw Attitude.Ki");
PIDsEnumOptions.add("Roll Attitude.ILimit");
PIDsEnumOptions.add("Pitch Attitude.ILimit");
PIDsEnumOptions.add("Roll+Pitch Attitude.ILimit");
PIDsEnumOptions.add("Yaw Attitude.ILimit");
PIDsEnumOptions.add("GyroTau");
fields.add( new UAVObjectField("PIDs", "option", UAVObjectField.FieldType.ENUM, PIDsElemNames, PIDsEnumOptions) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
getField("ThrottleRange").setValue(0.2,0);
getField("ThrottleRange").setValue(0.8,1);
getField("MinPID").setValue(0,0);
getField("MinPID").setValue(0,1);
getField("MinPID").setValue(0,2);
getField("MaxPID").setValue(0,0);
getField("MaxPID").setValue(0,1);
getField("MaxPID").setValue(0,2);
getField("UpdateMode").setValue("When Armed");
getField("Inputs").setValue("Throttle",0);
getField("Inputs").setValue("Accessory0",1);
getField("Inputs").setValue("Accessory1",2);
getField("PIDs").setValue("Disabled",0);
getField("PIDs").setValue("Disabled",1);
getField("PIDs").setValue("Disabled",2);
}
/**
* Create a clone of this object, a new instance ID must be specified.
* Do not use this function directly to create new instances, the
* UAVObjectManager should be used instead.
*/
public UAVDataObject clone(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;
}

View File

@ -1,108 +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 BaroAltitude() );
objMngr.registerObject( new CameraDesired() );
objMngr.registerObject( new CameraStabSettings() );
objMngr.registerObject( new FaultSettings() );
objMngr.registerObject( new FirmwareIAPObj() );
objMngr.registerObject( new FlightBatterySettings() );
objMngr.registerObject( new FlightBatteryState() );
objMngr.registerObject( new FlightPlanControl() );
objMngr.registerObject( new FlightPlanSettings() );
objMngr.registerObject( new FlightPlanStatus() );
objMngr.registerObject( new FlightStatus() );
objMngr.registerObject( new FlightTelemetryStats() );
objMngr.registerObject( new GCSReceiver() );
objMngr.registerObject( new GCSTelemetryStats() );
objMngr.registerObject( new GPSPosition() );
objMngr.registerObject( new GPSSatellites() );
objMngr.registerObject( new GPSSettings() );
objMngr.registerObject( new GPSTime() );
objMngr.registerObject( new GPSVelocity() );
objMngr.registerObject( new GuidanceSettings() );
objMngr.registerObject( new Gyros() );
objMngr.registerObject( new GyrosBias() );
objMngr.registerObject( new HomeLocation() );
objMngr.registerObject( new HwSettings() );
objMngr.registerObject( new I2CStats() );
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 ObjectPersistence() );
objMngr.registerObject( new OveroSyncStats() );
objMngr.registerObject( new PathAction() );
objMngr.registerObject( new PipXSettings() );
objMngr.registerObject( new PipXStatus() );
objMngr.registerObject( new PositionActual() );
objMngr.registerObject( new PositionDesired() );
objMngr.registerObject( new RateDesired() );
objMngr.registerObject( new ReceiverActivity() );
objMngr.registerObject( new RelayTuning() );
objMngr.registerObject( new RelayTuningSettings() );
objMngr.registerObject( new RevoCalibration() );
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 WatchdogStatus() );
objMngr.registerObject( new Waypoint() );
objMngr.registerObject( new WaypointActive() );
} catch (Exception e) {
e.printStackTrace();
}
}
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> NorthElemNames = new ArrayList<String>();
NorthElemNames.add("0");
fields.add( new UAVObjectField("North", "m/s", UAVObjectField.FieldType.FLOAT32, NorthElemNames, null) );
List<String> EastElemNames = new ArrayList<String>();
EastElemNames.add("0");
fields.add( new UAVObjectField("East", "m/s", UAVObjectField.FieldType.FLOAT32, EastElemNames, null) );
List<String> DownElemNames = new ArrayList<String>();
DownElemNames.add("0");
fields.add( new UAVObjectField("Down", "m/s", UAVObjectField.FieldType.FLOAT32, DownElemNames, null) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 1000;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
}
/**
* Create a clone of this object, a new instance ID must be specified.
* Do not use this function directly to create new instances, the
* UAVObjectManager should be used instead.
*/
public UAVDataObject clone(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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> NorthElemNames = new ArrayList<String>();
NorthElemNames.add("0");
fields.add( new UAVObjectField("North", "m/s", UAVObjectField.FieldType.FLOAT32, NorthElemNames, null) );
List<String> EastElemNames = new ArrayList<String>();
EastElemNames.add("0");
fields.add( new UAVObjectField("East", "m/s", UAVObjectField.FieldType.FLOAT32, EastElemNames, null) );
List<String> DownElemNames = new ArrayList<String>();
DownElemNames.add("0");
fields.add( new UAVObjectField("Down", "m/s", UAVObjectField.FieldType.FLOAT32, DownElemNames, null) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 1000;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 1000;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
}
/**
* Create a clone of this object, a new instance ID must be specified.
* Do not use this function directly to create new instances, the
* UAVObjectManager should be used instead.
*/
public UAVDataObject clone(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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> HorizontalPosPIElemNames = new ArrayList<String>();
HorizontalPosPIElemNames.add("Kp");
HorizontalPosPIElemNames.add("Ki");
HorizontalPosPIElemNames.add("ILimit");
fields.add( new UAVObjectField("HorizontalPosPI", "(m/s)/m", UAVObjectField.FieldType.FLOAT32, HorizontalPosPIElemNames, null) );
List<String> HorizontalVelPIDElemNames = new ArrayList<String>();
HorizontalVelPIDElemNames.add("Kp");
HorizontalVelPIDElemNames.add("Ki");
HorizontalVelPIDElemNames.add("Kd");
HorizontalVelPIDElemNames.add("ILimit");
fields.add( new UAVObjectField("HorizontalVelPID", "deg/(m/s)", UAVObjectField.FieldType.FLOAT32, HorizontalVelPIDElemNames, null) );
List<String> VerticalPosPIElemNames = new ArrayList<String>();
VerticalPosPIElemNames.add("Kp");
VerticalPosPIElemNames.add("Ki");
VerticalPosPIElemNames.add("ILimit");
fields.add( new UAVObjectField("VerticalPosPI", "", UAVObjectField.FieldType.FLOAT32, VerticalPosPIElemNames, null) );
List<String> VerticalVelPIDElemNames = new ArrayList<String>();
VerticalVelPIDElemNames.add("Kp");
VerticalVelPIDElemNames.add("Ki");
VerticalVelPIDElemNames.add("Kd");
VerticalVelPIDElemNames.add("ILimit");
fields.add( new UAVObjectField("VerticalVelPID", "", UAVObjectField.FieldType.FLOAT32, VerticalVelPIDElemNames, null) );
List<String> VelocityFeedforwardElemNames = new ArrayList<String>();
VelocityFeedforwardElemNames.add("0");
fields.add( new UAVObjectField("VelocityFeedforward", "deg/(m/s)", UAVObjectField.FieldType.FLOAT32, VelocityFeedforwardElemNames, null) );
List<String> MaxRollPitchElemNames = new ArrayList<String>();
MaxRollPitchElemNames.add("0");
fields.add( new UAVObjectField("MaxRollPitch", "deg", UAVObjectField.FieldType.FLOAT32, MaxRollPitchElemNames, null) );
List<String> UpdatePeriodElemNames = new ArrayList<String>();
UpdatePeriodElemNames.add("0");
fields.add( new UAVObjectField("UpdatePeriod", "ms", UAVObjectField.FieldType.INT32, UpdatePeriodElemNames, null) );
List<String> HorizontalVelMaxElemNames = new ArrayList<String>();
HorizontalVelMaxElemNames.add("0");
fields.add( new UAVObjectField("HorizontalVelMax", "m/s", UAVObjectField.FieldType.UINT16, HorizontalVelMaxElemNames, null) );
List<String> VerticalVelMaxElemNames = new ArrayList<String>();
VerticalVelMaxElemNames.add("0");
fields.add( new UAVObjectField("VerticalVelMax", "m/s", UAVObjectField.FieldType.UINT16, VerticalVelMaxElemNames, null) );
List<String> GuidanceModeElemNames = new ArrayList<String>();
GuidanceModeElemNames.add("0");
List<String> GuidanceModeEnumOptions = new ArrayList<String>();
GuidanceModeEnumOptions.add("DUAL_LOOP");
GuidanceModeEnumOptions.add("VELOCITY_CONTROL");
fields.add( new UAVObjectField("GuidanceMode", "", UAVObjectField.FieldType.ENUM, GuidanceModeElemNames, GuidanceModeEnumOptions) );
List<String> ThrottleControlElemNames = new ArrayList<String>();
ThrottleControlElemNames.add("0");
List<String> ThrottleControlEnumOptions = new ArrayList<String>();
ThrottleControlEnumOptions.add("FALSE");
ThrottleControlEnumOptions.add("TRUE");
fields.add( new UAVObjectField("ThrottleControl", "", UAVObjectField.FieldType.ENUM, ThrottleControlElemNames, ThrottleControlEnumOptions) );
List<String> VelocitySourceElemNames = new ArrayList<String>();
VelocitySourceElemNames.add("0");
List<String> VelocitySourceEnumOptions = new ArrayList<String>();
VelocitySourceEnumOptions.add("EKF");
VelocitySourceEnumOptions.add("NEDVEL");
VelocitySourceEnumOptions.add("GPSPOS");
fields.add( new UAVObjectField("VelocitySource", "", UAVObjectField.FieldType.ENUM, VelocitySourceElemNames, VelocitySourceEnumOptions) );
List<String> PositionSourceElemNames = new ArrayList<String>();
PositionSourceElemNames.add("0");
List<String> PositionSourceEnumOptions = new ArrayList<String>();
PositionSourceEnumOptions.add("EKF");
PositionSourceEnumOptions.add("GPSPOS");
fields.add( new UAVObjectField("PositionSource", "", UAVObjectField.FieldType.ENUM, PositionSourceElemNames, PositionSourceEnumOptions) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 0;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
getField("HorizontalPosPI").setValue(1,0);
getField("HorizontalPosPI").setValue(0,1);
getField("HorizontalPosPI").setValue(0,2);
getField("HorizontalVelPID").setValue(5,0);
getField("HorizontalVelPID").setValue(0,1);
getField("HorizontalVelPID").setValue(1,2);
getField("HorizontalVelPID").setValue(0,3);
getField("VerticalPosPI").setValue(0.1,0);
getField("VerticalPosPI").setValue(0.001,1);
getField("VerticalPosPI").setValue(200,2);
getField("VerticalVelPID").setValue(0.1,0);
getField("VerticalVelPID").setValue(0,1);
getField("VerticalVelPID").setValue(0,2);
getField("VerticalVelPID").setValue(0,3);
getField("VelocityFeedforward").setValue(0);
getField("MaxRollPitch").setValue(20);
getField("UpdatePeriod").setValue(100);
getField("HorizontalVelMax").setValue(10);
getField("VerticalVelMax").setValue(1);
getField("GuidanceMode").setValue("DUAL_LOOP");
getField("ThrottleControl").setValue("FALSE");
getField("VelocitySource").setValue("EKF");
getField("PositionSource").setValue("EKF");
}
/**
* Create a clone of this object, a new instance ID must be specified.
* Do not use this function directly to create new instances, the
* UAVObjectManager should be used instead.
*/
public UAVDataObject clone(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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> BootupFlagsElemNames = new ArrayList<String>();
BootupFlagsElemNames.add("0");
fields.add( new UAVObjectField("BootupFlags", "", UAVObjectField.FieldType.UINT16, BootupFlagsElemNames, null) );
List<String> ActiveFlagsElemNames = new ArrayList<String>();
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<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 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;
}

View File

@ -1,148 +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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> PositionElemNames = new ArrayList<String>();
PositionElemNames.add("North");
PositionElemNames.add("East");
PositionElemNames.add("Down");
fields.add( new UAVObjectField("Position", "m", UAVObjectField.FieldType.FLOAT32, PositionElemNames, null) );
List<String> VelocityElemNames = new ArrayList<String>();
VelocityElemNames.add("0");
fields.add( new UAVObjectField("Velocity", "m/s", UAVObjectField.FieldType.FLOAT32, VelocityElemNames, null) );
List<String> ActionElemNames = new ArrayList<String>();
ActionElemNames.add("0");
fields.add( new UAVObjectField("Action", "", UAVObjectField.FieldType.UINT8, ActionElemNames, null) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_PERIODIC) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 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 = 0xD23852DCl;
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;
}

View File

@ -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<UAVObjectField> fields = new ArrayList<UAVObjectField>();
List<String> IndexElemNames = new ArrayList<String>();
IndexElemNames.add("0");
fields.add( new UAVObjectField("Index", "", UAVObjectField.FieldType.UINT8, IndexElemNames, null) );
// Compute the number of bytes for this object
int numBytes = 0;
ListIterator<UAVObjectField> li = fields.listIterator();
while(li.hasNext()) {
numBytes += li.next().getNumBytes();
}
NUMBYTES = numBytes;
// Initialize object
initializeFields(fields, ByteBuffer.allocate(NUMBYTES), NUMBYTES);
// Set the default field values
setDefaultFieldValues();
// Set the object description
setDescription(DESCRIPTION);
}
/**
* Create a Metadata object filled with default values for this object
* @return Metadata object with default values
*/
public Metadata getDefaultMetadata() {
UAVObject.Metadata metadata = new UAVObject.Metadata();
metadata.flags =
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_ACCESS_SHIFT |
UAVObject.Metadata.AccessModeNum(UAVObject.AccessMode.ACCESS_READWRITE) << UAVOBJ_GCS_ACCESS_SHIFT |
0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_ONCHANGE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
UAVObject.Metadata.UpdateModeNum(UAVObject.UpdateMode.UPDATEMODE_MANUAL) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
metadata.flightTelemetryUpdatePeriod = 0;
metadata.gcsTelemetryUpdatePeriod = 0;
metadata.loggingUpdatePeriod = 1000;
return metadata;
}
/**
* Initialize object fields with the default values.
* If a default value is not specified the object fields
* will be initialized to zero.
*/
public void setDefaultFieldValues()
{
}
/**
* Create a clone of this object, a new instance ID must be specified.
* Do not use this function directly to create new instances, the
* UAVObjectManager should be used instead.
*/
public UAVDataObject clone(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;
}

View File

@ -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");
}
}

View File

@ -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<String> options = new ArrayList<String>();
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);
}
}

View File

@ -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));
}
}

View File

@ -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");
}
}

View File

@ -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"));
}
}

View File

@ -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");
}
}

Some files were not shown because too many files have changed in this diff Show More