From d7c02fd284eab794e97afeb310cbe9e3d70f7f17 Mon Sep 17 00:00:00 2001 From: Ricardo Martins Date: Thu, 18 Sep 2014 22:23:45 +0100 Subject: [PATCH] IMC Version 5.4.3 --- src-generated/pt/lsts/imc/CrudeOil.java | 103 ++++ .../{NavigationReset.java => FineOil.java} | 42 +- src-generated/pt/lsts/imc/ImcStringDefs.java | 291 +++++++---- src-generated/pt/lsts/imc/MessageFactory.java | 14 +- src-generated/pt/lsts/imc/RhodamineDye.java | 103 ++++ src-generated/pt/lsts/imc/UsblAngles.java | 136 +++++ src-generated/pt/lsts/imc/UsblFix.java | 207 ++++++++ src-generated/pt/lsts/imc/UsblPosition.java | 152 ++++++ .../pt/lsts/imc/state/ImcSysState.java | 476 +++++++++++++++--- 9 files changed, 1355 insertions(+), 169 deletions(-) create mode 100644 src-generated/pt/lsts/imc/CrudeOil.java rename src-generated/pt/lsts/imc/{NavigationReset.java => FineOil.java} (76%) create mode 100644 src-generated/pt/lsts/imc/RhodamineDye.java create mode 100644 src-generated/pt/lsts/imc/UsblAngles.java create mode 100644 src-generated/pt/lsts/imc/UsblFix.java create mode 100644 src-generated/pt/lsts/imc/UsblPosition.java diff --git a/src-generated/pt/lsts/imc/CrudeOil.java b/src-generated/pt/lsts/imc/CrudeOil.java new file mode 100644 index 00000000..47e6696b --- /dev/null +++ b/src-generated/pt/lsts/imc/CrudeOil.java @@ -0,0 +1,103 @@ +/* + * Below is the copyright agreement for IMCJava. + * + * Copyright (c) 2010-2014, Laboratório de Sistemas e Tecnologia Subaquática + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the names of IMC, LSTS, IMCJava nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL LABORATORIO DE SISTEMAS E TECNOLOGIA SUBAQUATICA + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package pt.lsts.imc; + +/** + * IMC Message Crude Oil (286)
+ * Crude oil measurement.
+ */ + +public class CrudeOil extends IMCMessage { + + public static final int ID_STATIC = 286; + + public CrudeOil() { + super(ID_STATIC); + } + + public CrudeOil(IMCMessage msg) { + super(ID_STATIC); + try{ + copyFrom(msg); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + public CrudeOil(IMCDefinition defs) { + super(defs, ID_STATIC); + } + + public static CrudeOil create(Object... values) { + CrudeOil m = new CrudeOil(); + for (int i = 0; i < values.length-1; i+= 2) + m.setValue(values[i].toString(), values[i+1]); + return m; + } + + public static CrudeOil clone(IMCMessage msg) throws Exception { + + CrudeOil m = new CrudeOil(); + if (msg == null) + return m; + if(msg.definitions != m.definitions){ + msg = msg.cloneMessage(); + IMCUtil.updateMessage(msg, m.definitions); + } + else if (msg.getMgid()!=m.getMgid()) + throw new Exception("Argument "+msg.getAbbrev()+" is incompatible with message "+m.getAbbrev()); + + m.getHeader().values.putAll(msg.getHeader().values); + m.values.putAll(msg.values); + return m; + } + + public CrudeOil(float value) { + super(ID_STATIC); + setValue(value); + } + + /** + * @return Value (ppb) - fp32_t + */ + public double getValue() { + return getDouble("value"); + } + + /** + * @param value Value (ppb) + */ + public CrudeOil setValue(double value) { + values.put("value", value); + return this; + } + +} diff --git a/src-generated/pt/lsts/imc/NavigationReset.java b/src-generated/pt/lsts/imc/FineOil.java similarity index 76% rename from src-generated/pt/lsts/imc/NavigationReset.java rename to src-generated/pt/lsts/imc/FineOil.java index d3fc9f58..c2b86724 100644 --- a/src-generated/pt/lsts/imc/NavigationReset.java +++ b/src-generated/pt/lsts/imc/FineOil.java @@ -30,19 +30,19 @@ package pt.lsts.imc; /** - * IMC Message Navigation Reset (359)
- * Request a navigation reset.
+ * IMC Message Fine Oil (287)
+ * Fine oil measurement.
*/ -public class NavigationReset extends IMCMessage { +public class FineOil extends IMCMessage { - public static final int ID_STATIC = 359; + public static final int ID_STATIC = 287; - public NavigationReset() { + public FineOil() { super(ID_STATIC); } - public NavigationReset(IMCMessage msg) { + public FineOil(IMCMessage msg) { super(ID_STATIC); try{ copyFrom(msg); @@ -52,20 +52,20 @@ public NavigationReset(IMCMessage msg) { } } - public NavigationReset(IMCDefinition defs) { + public FineOil(IMCDefinition defs) { super(defs, ID_STATIC); } - public static NavigationReset create(Object... values) { - NavigationReset m = new NavigationReset(); + public static FineOil create(Object... values) { + FineOil m = new FineOil(); for (int i = 0; i < values.length-1; i+= 2) m.setValue(values[i].toString(), values[i+1]); return m; } - public static NavigationReset clone(IMCMessage msg) throws Exception { + public static FineOil clone(IMCMessage msg) throws Exception { - NavigationReset m = new NavigationReset(); + FineOil m = new FineOil(); if (msg == null) return m; if(msg.definitions != m.definitions){ @@ -80,4 +80,24 @@ else if (msg.getMgid()!=m.getMgid()) return m; } + public FineOil(float value) { + super(ID_STATIC); + setValue(value); + } + + /** + * @return Value (ppb) - fp32_t + */ + public double getValue() { + return getDouble("value"); + } + + /** + * @param value Value (ppb) + */ + public FineOil setValue(double value) { + values.put("value", value); + return this; + } + } diff --git a/src-generated/pt/lsts/imc/ImcStringDefs.java b/src-generated/pt/lsts/imc/ImcStringDefs.java index 65b311b9..db2b284d 100644 --- a/src-generated/pt/lsts/imc/ImcStringDefs.java +++ b/src-generated/pt/lsts/imc/ImcStringDefs.java @@ -31,9 +31,9 @@ public class ImcStringDefs { - public static final String IMC_SHA = "4d99bc2bcf4738a367873a093636c94ac4f65836"; - public static final String IMC_BRANCH = "2014-09-16 4d99bc2 (HEAD, origin/master, origin/HEAD, master)"; - public static final String IMC_COMMIT = "Renato Caldas (rmsc@fe.up.pt), Tue Sep 16 15:23:22 WEST 2014, Revert \"Added messages EntityActivationLock, EntityStatus and QueryEntityStatus.\"\n\nThis reverts commit 2f66908a524205cbf8cba59e02a1e4c89fb157e8."; + public static final String IMC_SHA = "550440cbc77abde0ea5a85a3f78fd60caac980f6"; + public static final String IMC_BRANCH = "2014-09-18 550440c (HEAD, tag: imc-5.4.3, origin/master, origin/HEAD, master)"; + public static final String IMC_COMMIT = "Ricardo Martins (rasm@lsts.pt), Thu Sep 18 22:13:03 WEST 2014, IMC v5.4.3\n\nChanges since IMC v5.4.2:\n\n- Added units PPM and PPB.\n\n- Increased maximum message id of GroupDevelopment from 849 to 900.\n\n- Added messages RhodamineDye, CrudeOil, FineOil, PlanStatistics, UsblAngles,\n UsblPosition, and UsblFix\n\n- Removed obsolete message NavigationReset."; public static java.util.Map IMC_ADDRESSES = new java.util.LinkedHashMap(); @@ -190,7 +190,7 @@ public static String getDefinitions() { sb.append(" xsi:noNamespaceSchemaLocation=\"IMC.xsd\"\n"); sb.append(" name=\"IMC\"\n"); sb.append(" long-name=\"Inter Module Communication\"\n"); - sb.append(" version=\"5.4.2\">\n"); + sb.append(" version=\"5.4.3\">\n"); sb.append("\n"); sb.append(" \n"); sb.append(" This document describes the communications protocol associated\n"); @@ -379,6 +379,8 @@ public static String getDefinitions() { sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); + sb.append(" \n"); + sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); @@ -607,7 +609,7 @@ public static String getDefinitions() { sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); - sb.append(" \n"); + sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append("\n"); @@ -1000,7 +1002,7 @@ public static String getDefinitions() { sb.append(" \n"); sb.append("\n"); sb.append(" \n"); - sb.append(" \n"); + sb.append(" \n"); sb.append(" \n"); sb.append("\n"); sb.append(" \n"); @@ -2834,6 +2836,40 @@ public static String getDefinitions() { sb.append(" \n"); sb.append(" \n"); sb.append("\n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" Rhodamine Dye measurement.\n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" Amount of rhodamine dye detected.\n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append("\n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" Crude oil measurement.\n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" Amount of crude oil detected.\n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append("\n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" Fine oil measurement.\n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" Amount of fine oil detected.\n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append("\n"); + sb.append("\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); @@ -3250,7 +3286,8 @@ public static String getDefinitions() { sb.append(" The body-fixed reference frame and Euler angles are depicted\n"); sb.append(" next:\n"); sb.append("\n"); - sb.append(" .. figure:: images/euler-lauv.png\n"); + sb.append(" .. figure:: ../images/euler-lauv.png\n"); + sb.append("\n"); sb.append(" :align: center\n"); sb.append("\n"); sb.append(" Euler angles\n"); @@ -3689,12 +3726,6 @@ public static String getDefinitions() { sb.append(" \n"); sb.append(" \n"); sb.append("\n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" Request a navigation reset.\n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append("\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" LBL Beacon position estimate.\n"); @@ -4167,8 +4198,8 @@ public static String getDefinitions() { sb.append(" \n"); sb.append(" \n"); sb.append(" Unsigned integer reference of the desired path message to which this\n"); - sb.append("\tPathControlState message refers to.\n"); - sb.append("\tPath reference should only be set by a maneuver, not by path controllers.\n"); + sb.append(" PathControlState message refers to.\n"); + sb.append(" Path reference should only be set by a maneuver, not by path controllers.\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); @@ -5736,115 +5767,115 @@ public static String getDefinitions() { sb.append(" \n"); sb.append(" \n"); sb.append(" Commanded acceleration computed by the formation controller: northward direction.\n"); - sb.append("\tOn the vehicle directional reference frame.\n"); - sb.append("\tConstrained by the vehicle operational limits.\n"); + sb.append(" On the vehicle directional reference frame.\n"); + sb.append(" Constrained by the vehicle operational limits.\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" Commanded acceleration computed by the formation controller: eastward direction.\n"); - sb.append("\tOn the vehicle directional reference frame.\n"); - sb.append("\tConstrained by the vehicle operational limits.\n"); + sb.append(" On the vehicle directional reference frame.\n"); + sb.append(" Constrained by the vehicle operational limits.\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" Commanded acceleration computed by the formation controller: downward direction.\n"); - sb.append("\tOn the vehicle directional reference frame.\n"); - sb.append("\tConstrained by the vehicle operational limits.\n"); + sb.append(" On the vehicle directional reference frame.\n"); + sb.append(" Constrained by the vehicle operational limits.\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" Desired acceleration computed by the formation controller: northward direction.\n"); - sb.append("\tOn the fixed reference frame.\n"); + sb.append(" On the fixed reference frame.\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" Desired acceleration computed by the formation controller: eastward direction.\n"); - sb.append("\tOn the fixed reference frame.\n"); + sb.append(" On the fixed reference frame.\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" Desired acceleration computed by the formation controller: downward direction.\n"); - sb.append("\tOn the fixed reference frame.\n"); + sb.append(" On the fixed reference frame.\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); - sb.append("\tComponents of the vehicle desired acceleration.\n"); - sb.append("\tOverall formation combined virtual error: northward direction.\n"); - sb.append("\tOn the fixed reference frame.\n"); + sb.append(" Components of the vehicle desired acceleration.\n"); + sb.append(" Overall formation combined virtual error: northward direction.\n"); + sb.append(" On the fixed reference frame.\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); - sb.append("\tComponents of the vehicle desired acceleration.\n"); - sb.append("\tOverall formation combined virtual error: eastward direction.\n"); - sb.append("\tOn the fixed reference frame.\n"); + sb.append(" Components of the vehicle desired acceleration.\n"); + sb.append(" Overall formation combined virtual error: eastward direction.\n"); + sb.append(" On the fixed reference frame.\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); - sb.append("\tComponents of the vehicle desired acceleration.\n"); - sb.append("\tOverall formation combined virtual error: downward direction.\n"); - sb.append("\tOn the fixed reference frame.\n"); + sb.append(" Components of the vehicle desired acceleration.\n"); + sb.append(" Overall formation combined virtual error: downward direction.\n"); + sb.append(" On the fixed reference frame.\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); - sb.append("\tComponents of the vehicle desired acceleration.\n"); - sb.append("\tOverall formation combined sliding surface feedback: northward direction.\n"); - sb.append("\tOn the fixed reference frame.\n"); + sb.append(" Components of the vehicle desired acceleration.\n"); + sb.append(" Overall formation combined sliding surface feedback: northward direction.\n"); + sb.append(" On the fixed reference frame.\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); - sb.append("\tComponents of the vehicle desired acceleration.\n"); - sb.append("\tOverall formation combined sliding surface feedback: eastward direction.\n"); - sb.append("\tOn the fixed reference frame.\n"); + sb.append(" Components of the vehicle desired acceleration.\n"); + sb.append(" Overall formation combined sliding surface feedback: eastward direction.\n"); + sb.append(" On the fixed reference frame.\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); - sb.append("\tComponents of the vehicle desired acceleration.\n"); - sb.append("\tOverall formation combined sliding surface feedback: downward direction.\n"); - sb.append("\tOn the fixed reference frame.\n"); + sb.append(" Components of the vehicle desired acceleration.\n"); + sb.append(" Overall formation combined sliding surface feedback: downward direction.\n"); + sb.append(" On the fixed reference frame.\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); - sb.append("\tComponents of the vehicle desired acceleration.\n"); - sb.append("\tDynamics uncertainty compensation: northward direction.\n"); + sb.append(" Components of the vehicle desired acceleration.\n"); + sb.append(" Dynamics uncertainty compensation: northward direction.\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); - sb.append("\tComponents of the vehicle desired acceleration.\n"); - sb.append("\tDynamics uncertainty compensation: eastward direction.\n"); + sb.append(" Components of the vehicle desired acceleration.\n"); + sb.append(" Dynamics uncertainty compensation: eastward direction.\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); - sb.append("\tComponents of the vehicle desired acceleration.\n"); - sb.append("\tDynamics uncertainty compensation: downward direction.\n"); + sb.append(" Components of the vehicle desired acceleration.\n"); + sb.append(" Dynamics uncertainty compensation: downward direction.\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); - sb.append("\tCombined deviation from convergence (sliding surface): North component.\n"); + sb.append(" Combined deviation from convergence (sliding surface): North component.\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); - sb.append("\tCombined deviation from convergence (sliding surface): East component.\n"); + sb.append(" Combined deviation from convergence (sliding surface): East component.\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); - sb.append("\tCombined deviation from convergence (sliding surface): Down component.\n"); + sb.append(" Combined deviation from convergence (sliding surface): Down component.\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); @@ -5875,100 +5906,100 @@ public static String getDefinitions() { sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); - sb.append("\tWeight in the computation of the desired acceleration.\n"); + sb.append(" Weight in the computation of the desired acceleration.\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); - sb.append("\tInter-vehicle direction vector: North component.\n"); + sb.append(" Inter-vehicle direction vector: North component.\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); - sb.append("\tInter-vehicle direction vector: East component.\n"); + sb.append(" Inter-vehicle direction vector: East component.\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); - sb.append("\tInter-vehicle direction vector: Down component.\n"); + sb.append(" Inter-vehicle direction vector: Down component.\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); - sb.append("\tRelative position error: North component.\n"); + sb.append(" Relative position error: North component.\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); - sb.append("\tRelative position error: East component.\n"); + sb.append(" Relative position error: East component.\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); - sb.append("\tRelative position error: Down component.\n"); + sb.append(" Relative position error: Down component.\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); - sb.append("\tRelative position error: X component on the inter-vehicle reference frame.\n"); + sb.append(" Relative position error: X component on the inter-vehicle reference frame.\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); - sb.append("\tRelative position error: Y component on the inter-vehicle reference frame.\n"); + sb.append(" Relative position error: Y component on the inter-vehicle reference frame.\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); - sb.append("\tRelative position error: Z component on the inter-vehicle reference frame.\n"); + sb.append(" Relative position error: Z component on the inter-vehicle reference frame.\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); - sb.append("\tRelative veloctity error: X component in the inter-vehicle reference frame.\n"); + sb.append(" Relative veloctity error: X component in the inter-vehicle reference frame.\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); - sb.append("\tRelative velocity error: Y component on the inter-vehicle reference frame.\n"); + sb.append(" Relative velocity error: Y component on the inter-vehicle reference frame.\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); - sb.append("\tRelative velocity error: Z component on the inter-vehicle reference frame.\n"); + sb.append(" Relative velocity error: Z component on the inter-vehicle reference frame.\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); - sb.append("\tDeviation from convergence (sliding surface): X component on the inter-vehicle reference frame.\n"); + sb.append(" Deviation from convergence (sliding surface): X component on the inter-vehicle reference frame.\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); - sb.append("\tDeviation from convergence (sliding surface): Y component on the inter-vehicle reference frame.\n"); + sb.append(" Deviation from convergence (sliding surface): Y component on the inter-vehicle reference frame.\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); - sb.append("\tDeviation from convergence (sliding surface): Z component on the inter-vehicle reference frame.\n"); + sb.append(" Deviation from convergence (sliding surface): Z component on the inter-vehicle reference frame.\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); - sb.append("\tComponents of the vehicle desired acceleration.\n"); - sb.append("\tRelative virtual error: northward direction.\n"); + sb.append(" Components of the vehicle desired acceleration.\n"); + sb.append(" Relative virtual error: northward direction.\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); - sb.append("\tComponents of the vehicle desired acceleration.\n"); - sb.append("\tRelative virtual error: eastward direction.\n"); + sb.append(" Components of the vehicle desired acceleration.\n"); + sb.append(" Relative virtual error: eastward direction.\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); - sb.append("\tComponents of the vehicle desired acceleration.\n"); - sb.append("\tRelative virtual error: downward direction.\n"); + sb.append(" Components of the vehicle desired acceleration.\n"); + sb.append(" Relative virtual error: downward direction.\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); @@ -5995,7 +6026,7 @@ public static String getDefinitions() { sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); - sb.append("\tDirection to which the vehicle should attempt to unstuck.\n"); + sb.append(" Direction to which the vehicle should attempt to unstuck.\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); @@ -6995,7 +7026,8 @@ public static String getDefinitions() { sb.append(" The body-fixed reference frame and Euler angles are depicted\n"); sb.append(" next:\n"); sb.append("\n"); - sb.append(" .. figure:: images/euler-lauv.png\n"); + sb.append(" .. figure:: ../images/euler-lauv.png\n"); + sb.append("\n"); sb.append(" :align: center\n"); sb.append("\n"); sb.append(" Euler angles\n"); @@ -7124,7 +7156,7 @@ public static String getDefinitions() { sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); - sb.append("\t\n"); + sb.append(" \n"); sb.append(" Basic plan, meaning it is Linear, Finite and Noncyclic.\n"); sb.append(" \n"); sb.append(" \n"); @@ -7145,28 +7177,28 @@ public static String getDefinitions() { sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); - sb.append("\t All properties checked.\n"); + sb.append(" All properties checked.\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); - sb.append("\tManeuver and plan duration statistics in seconds, for example: \u201CTotal=1000,Goto1=20,Rows=980\u201D\n"); + sb.append(" Maneuver and plan duration statistics in seconds, for example: \u201CTotal=1000,Goto1=20,Rows=980\u201D\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); - sb.append("\tDistances travelled in meters in each maneuver and/or total: \u201CTotal=2000,Rows=1800,Elevator=200\u201D\n"); + sb.append(" Distances travelled in meters in each maneuver and/or total: \u201CTotal=2000,Rows=1800,Elevator=200\u201D\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); - sb.append("\tList of components active by plan actions during the plan and time active in seconds: \u201CSidescan=100,Camera Module=150\u201D\n"); + sb.append(" List of components active by plan actions during the plan and time active in seconds: \u201CSidescan=100,Camera Module=150\u201D\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); - sb.append("\tAmount of fuel spent, in battery percentage, by different parcels (if applicable): \u201CTotal=35,Hotel=5,Payload=10,Motion=20,IMU=0\u201D\n"); + sb.append(" Amount of fuel spent, in battery percentage, by different parcels (if applicable): \u201CTotal=35,Hotel=5,Payload=10,Motion=20,IMU=0\u201D\n"); sb.append(" \n"); sb.append(" \n"); sb.append(" \n"); @@ -7555,7 +7587,8 @@ public static String getDefinitions() { sb.append(" Request creating a new session with this remote peer. Example\n"); sb.append(" session sequence is shown in the following diagram.\n"); sb.append("\n"); - sb.append(" .. figure:: images/session_sequence.png\n"); + sb.append(" .. figure:: ../images/session_sequence.png\n"); + sb.append("\n"); sb.append(" :align: center\n"); sb.append(" \n"); sb.append(" \n"); @@ -7724,15 +7757,15 @@ public static String getDefinitions() { sb.append(" \n"); sb.append("\n"); sb.append(" \n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" \n"); sb.append(" \n"); sb.append("\n"); sb.append(" \n"); - sb.append(" \n"); - sb.append(" \n"); + sb.append(" \n"); + sb.append(" \n"); sb.append(" \n"); sb.append("\n"); sb.append(" \n"); @@ -7740,6 +7773,88 @@ public static String getDefinitions() { sb.append(" This message signals that an :ref:`Abort` message was received and acted upon.\n"); sb.append(" \n"); sb.append(" \n"); + sb.append("\n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" This message contains information, collected using USBL, about the\n"); + sb.append(" bearing and elevation of a target.\n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" Target's IMC address.\n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" Target's bearing.\n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" Target's elevation.\n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append("\n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" This message contains information, collected using USBL, about a\n"); + sb.append(" target's position.\n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" Target's IMC address.\n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" X coordinate of the target in the local device's reference frame.\n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" Y coordinate of the target in the local device's reference frame.\n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" Z coordinate of the target in the local device's reference frame.\n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append("\n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" This message contains the WGS-84 position of a target computed using\n"); + sb.append(" USBL.\n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" Target's IMC address.\n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" WGS-84 Latitude.\n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" WGS-84 Longitude.\n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" Units of the z reference.\n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" Target reference in the z axis. Use z_units to specify\n"); + sb.append(" whether z represents depth, altitude or other.\n"); + sb.append(" \n"); + sb.append(" \n"); + sb.append(" \n"); sb.append("\n"); return sb.toString(); } diff --git a/src-generated/pt/lsts/imc/MessageFactory.java b/src-generated/pt/lsts/imc/MessageFactory.java index ccd06669..f7cffea8 100644 --- a/src-generated/pt/lsts/imc/MessageFactory.java +++ b/src-generated/pt/lsts/imc/MessageFactory.java @@ -214,6 +214,12 @@ private IMCMessage createTypedMessage(int mgid, IMCDefinition defs) { return new BeamConfig(defs); case DataSanity.ID_STATIC: return new DataSanity(defs); + case RhodamineDye.ID_STATIC: + return new RhodamineDye(defs); + case CrudeOil.ID_STATIC: + return new CrudeOil(defs); + case FineOil.ID_STATIC: + return new FineOil(defs); case CameraZoom.ID_STATIC: return new CameraZoom(defs); case SetThrusterActuation.ID_STATIC: @@ -266,8 +272,6 @@ private IMCMessage createTypedMessage(int mgid, IMCDefinition defs) { return new LblRangeAcceptance(defs); case DvlRejection.ID_STATIC: return new DvlRejection(defs); - case NavigationReset.ID_STATIC: - return new NavigationReset(defs); case LblEstimate.ID_STATIC: return new LblEstimate(defs); case AlignmentState.ID_STATIC: @@ -504,6 +508,12 @@ private IMCMessage createTypedMessage(int mgid, IMCDefinition defs) { return new NeptusBlob(defs); case Aborted.ID_STATIC: return new Aborted(defs); + case UsblAngles.ID_STATIC: + return new UsblAngles(defs); + case UsblPosition.ID_STATIC: + return new UsblPosition(defs); + case UsblFix.ID_STATIC: + return new UsblFix(defs); default: return new IMCMessage(defs); } diff --git a/src-generated/pt/lsts/imc/RhodamineDye.java b/src-generated/pt/lsts/imc/RhodamineDye.java new file mode 100644 index 00000000..1e2b86c4 --- /dev/null +++ b/src-generated/pt/lsts/imc/RhodamineDye.java @@ -0,0 +1,103 @@ +/* + * Below is the copyright agreement for IMCJava. + * + * Copyright (c) 2010-2014, Laboratório de Sistemas e Tecnologia Subaquática + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the names of IMC, LSTS, IMCJava nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL LABORATORIO DE SISTEMAS E TECNOLOGIA SUBAQUATICA + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package pt.lsts.imc; + +/** + * IMC Message Rhodamine Dye (285)
+ * Rhodamine Dye measurement.
+ */ + +public class RhodamineDye extends IMCMessage { + + public static final int ID_STATIC = 285; + + public RhodamineDye() { + super(ID_STATIC); + } + + public RhodamineDye(IMCMessage msg) { + super(ID_STATIC); + try{ + copyFrom(msg); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + public RhodamineDye(IMCDefinition defs) { + super(defs, ID_STATIC); + } + + public static RhodamineDye create(Object... values) { + RhodamineDye m = new RhodamineDye(); + for (int i = 0; i < values.length-1; i+= 2) + m.setValue(values[i].toString(), values[i+1]); + return m; + } + + public static RhodamineDye clone(IMCMessage msg) throws Exception { + + RhodamineDye m = new RhodamineDye(); + if (msg == null) + return m; + if(msg.definitions != m.definitions){ + msg = msg.cloneMessage(); + IMCUtil.updateMessage(msg, m.definitions); + } + else if (msg.getMgid()!=m.getMgid()) + throw new Exception("Argument "+msg.getAbbrev()+" is incompatible with message "+m.getAbbrev()); + + m.getHeader().values.putAll(msg.getHeader().values); + m.values.putAll(msg.values); + return m; + } + + public RhodamineDye(float value) { + super(ID_STATIC); + setValue(value); + } + + /** + * @return Value (ppb) - fp32_t + */ + public double getValue() { + return getDouble("value"); + } + + /** + * @param value Value (ppb) + */ + public RhodamineDye setValue(double value) { + values.put("value", value); + return this; + } + +} diff --git a/src-generated/pt/lsts/imc/UsblAngles.java b/src-generated/pt/lsts/imc/UsblAngles.java new file mode 100644 index 00000000..ba153ee0 --- /dev/null +++ b/src-generated/pt/lsts/imc/UsblAngles.java @@ -0,0 +1,136 @@ +/* + * Below is the copyright agreement for IMCJava. + * + * Copyright (c) 2010-2014, Laboratório de Sistemas e Tecnologia Subaquática + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the names of IMC, LSTS, IMCJava nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL LABORATORIO DE SISTEMAS E TECNOLOGIA SUBAQUATICA + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package pt.lsts.imc; + +/** + * IMC Message USBL Angles (890)
+ * This message contains information, collected using USBL, about the
+ * bearing and elevation of a target.
+ */ + +public class UsblAngles extends IMCMessage { + + public static final int ID_STATIC = 890; + + public UsblAngles() { + super(ID_STATIC); + } + + public UsblAngles(IMCMessage msg) { + super(ID_STATIC); + try{ + copyFrom(msg); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + public UsblAngles(IMCDefinition defs) { + super(defs, ID_STATIC); + } + + public static UsblAngles create(Object... values) { + UsblAngles m = new UsblAngles(); + for (int i = 0; i < values.length-1; i+= 2) + m.setValue(values[i].toString(), values[i+1]); + return m; + } + + public static UsblAngles clone(IMCMessage msg) throws Exception { + + UsblAngles m = new UsblAngles(); + if (msg == null) + return m; + if(msg.definitions != m.definitions){ + msg = msg.cloneMessage(); + IMCUtil.updateMessage(msg, m.definitions); + } + else if (msg.getMgid()!=m.getMgid()) + throw new Exception("Argument "+msg.getAbbrev()+" is incompatible with message "+m.getAbbrev()); + + m.getHeader().values.putAll(msg.getHeader().values); + m.values.putAll(msg.values); + return m; + } + + public UsblAngles(int target, float bearing, float elevation) { + super(ID_STATIC); + setTarget(target); + setBearing(bearing); + setElevation(elevation); + } + + /** + * @return Target - uint16_t + */ + public int getTarget() { + return getInteger("target"); + } + + /** + * @param target Target + */ + public UsblAngles setTarget(int target) { + values.put("target", target); + return this; + } + + /** + * @return Bearing (rad) - fp32_t + */ + public double getBearing() { + return getDouble("bearing"); + } + + /** + * @param bearing Bearing (rad) + */ + public UsblAngles setBearing(double bearing) { + values.put("bearing", bearing); + return this; + } + + /** + * @return Elevation (rad) - fp32_t + */ + public double getElevation() { + return getDouble("elevation"); + } + + /** + * @param elevation Elevation (rad) + */ + public UsblAngles setElevation(double elevation) { + values.put("elevation", elevation); + return this; + } + +} diff --git a/src-generated/pt/lsts/imc/UsblFix.java b/src-generated/pt/lsts/imc/UsblFix.java new file mode 100644 index 00000000..8455bcc1 --- /dev/null +++ b/src-generated/pt/lsts/imc/UsblFix.java @@ -0,0 +1,207 @@ +/* + * Below is the copyright agreement for IMCJava. + * + * Copyright (c) 2010-2014, Laboratório de Sistemas e Tecnologia Subaquática + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the names of IMC, LSTS, IMCJava nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL LABORATORIO DE SISTEMAS E TECNOLOGIA SUBAQUATICA + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package pt.lsts.imc; + +/** + * IMC Message USBL Fix (892)
+ * This message contains the WGS-84 position of a target computed using
+ * USBL.
+ */ + +public class UsblFix extends IMCMessage { + + public enum Z_UNITS { + NONE(0), + DEPTH(1), + ALTITUDE(2), + HEIGHT(3); + + protected long value; + + public long value() { + return value; + } + + Z_UNITS(long value) { + this.value = value; + } + } + + public static final int ID_STATIC = 892; + + public UsblFix() { + super(ID_STATIC); + } + + public UsblFix(IMCMessage msg) { + super(ID_STATIC); + try{ + copyFrom(msg); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + public UsblFix(IMCDefinition defs) { + super(defs, ID_STATIC); + } + + public static UsblFix create(Object... values) { + UsblFix m = new UsblFix(); + for (int i = 0; i < values.length-1; i+= 2) + m.setValue(values[i].toString(), values[i+1]); + return m; + } + + public static UsblFix clone(IMCMessage msg) throws Exception { + + UsblFix m = new UsblFix(); + if (msg == null) + return m; + if(msg.definitions != m.definitions){ + msg = msg.cloneMessage(); + IMCUtil.updateMessage(msg, m.definitions); + } + else if (msg.getMgid()!=m.getMgid()) + throw new Exception("Argument "+msg.getAbbrev()+" is incompatible with message "+m.getAbbrev()); + + m.getHeader().values.putAll(msg.getHeader().values); + m.values.putAll(msg.values); + return m; + } + + public UsblFix(int target, double lat, double lon, Z_UNITS z_units, float z) { + super(ID_STATIC); + setTarget(target); + setLat(lat); + setLon(lon); + setZUnits(z_units); + setZ(z); + } + + /** + * @return Target - uint16_t + */ + public int getTarget() { + return getInteger("target"); + } + + /** + * @param target Target + */ + public UsblFix setTarget(int target) { + values.put("target", target); + return this; + } + + /** + * @return Latitude (WGS-84) (rad) - fp64_t + */ + public double getLat() { + return getDouble("lat"); + } + + /** + * @param lat Latitude (WGS-84) (rad) + */ + public UsblFix setLat(double lat) { + values.put("lat", lat); + return this; + } + + /** + * @return Longitude (WGS-84) (rad) - fp64_t + */ + public double getLon() { + return getDouble("lon"); + } + + /** + * @param lon Longitude (WGS-84) (rad) + */ + public UsblFix setLon(double lon) { + values.put("lon", lon); + return this; + } + + /** + * @return Z Units (enumerated) - uint8_t + */ + public Z_UNITS getZUnits() { + try { + Z_UNITS o = Z_UNITS.valueOf(getMessageType().getFieldPossibleValues("z_units").get(getLong("z_units"))); + return o; + } + catch (Exception e) { + return null; + } + } + + /** + * @param z_units Z Units (enumerated) + */ + public UsblFix setZUnits(Z_UNITS z_units) { + values.put("z_units", z_units.value()); + return this; + } + + /** + * @param z_units Z Units (as a String) + */ + public UsblFix setZUnits(String z_units) { + setValue("z_units", z_units); + return this; + } + + /** + * @param z_units Z Units (integer value) + */ + public UsblFix setZUnits(short z_units) { + setValue("z_units", z_units); + return this; + } + + /** + * @return Z Reference (m) - fp32_t + */ + public double getZ() { + return getDouble("z"); + } + + /** + * @param z Z Reference (m) + */ + public UsblFix setZ(double z) { + values.put("z", z); + return this; + } + +} diff --git a/src-generated/pt/lsts/imc/UsblPosition.java b/src-generated/pt/lsts/imc/UsblPosition.java new file mode 100644 index 00000000..66b65bdc --- /dev/null +++ b/src-generated/pt/lsts/imc/UsblPosition.java @@ -0,0 +1,152 @@ +/* + * Below is the copyright agreement for IMCJava. + * + * Copyright (c) 2010-2014, Laboratório de Sistemas e Tecnologia Subaquática + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the names of IMC, LSTS, IMCJava nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL LABORATORIO DE SISTEMAS E TECNOLOGIA SUBAQUATICA + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package pt.lsts.imc; + +/** + * IMC Message USBL Position (891)
+ * This message contains information, collected using USBL, about a
+ * target's position.
+ */ + +public class UsblPosition extends IMCMessage { + + public static final int ID_STATIC = 891; + + public UsblPosition() { + super(ID_STATIC); + } + + public UsblPosition(IMCMessage msg) { + super(ID_STATIC); + try{ + copyFrom(msg); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + public UsblPosition(IMCDefinition defs) { + super(defs, ID_STATIC); + } + + public static UsblPosition create(Object... values) { + UsblPosition m = new UsblPosition(); + for (int i = 0; i < values.length-1; i+= 2) + m.setValue(values[i].toString(), values[i+1]); + return m; + } + + public static UsblPosition clone(IMCMessage msg) throws Exception { + + UsblPosition m = new UsblPosition(); + if (msg == null) + return m; + if(msg.definitions != m.definitions){ + msg = msg.cloneMessage(); + IMCUtil.updateMessage(msg, m.definitions); + } + else if (msg.getMgid()!=m.getMgid()) + throw new Exception("Argument "+msg.getAbbrev()+" is incompatible with message "+m.getAbbrev()); + + m.getHeader().values.putAll(msg.getHeader().values); + m.values.putAll(msg.values); + return m; + } + + public UsblPosition(int target, float x, float y, float z) { + super(ID_STATIC); + setTarget(target); + setX(x); + setY(y); + setZ(z); + } + + /** + * @return Target - uint16_t + */ + public int getTarget() { + return getInteger("target"); + } + + /** + * @param target Target + */ + public UsblPosition setTarget(int target) { + values.put("target", target); + return this; + } + + /** + * @return X (m) - fp32_t + */ + public double getX() { + return getDouble("x"); + } + + /** + * @param x X (m) + */ + public UsblPosition setX(double x) { + values.put("x", x); + return this; + } + + /** + * @return Y (m) - fp32_t + */ + public double getY() { + return getDouble("y"); + } + + /** + * @param y Y (m) + */ + public UsblPosition setY(double y) { + values.put("y", y); + return this; + } + + /** + * @return Z (m) - fp32_t + */ + public double getZ() { + return getDouble("z"); + } + + /** + * @param z Z (m) + */ + public UsblPosition setZ(double z) { + values.put("z", z); + return this; + } + +} diff --git a/src-generated/pt/lsts/imc/state/ImcSysState.java b/src-generated/pt/lsts/imc/state/ImcSysState.java index 35f7ec1c..7a6e112d 100644 --- a/src-generated/pt/lsts/imc/state/ImcSysState.java +++ b/src-generated/pt/lsts/imc/state/ImcSysState.java @@ -5613,6 +5613,210 @@ public pt.lsts.imc.DataSanity pollDataSanity(String entityName, long timeoutMill return null; } + /** + * Retrieve the last {@link RhodamineDye} or null if no message of that type was received yet. + * @return last {@link RhodamineDye} on this state or null if no message of that type was received yet. + */ + public pt.lsts.imc.RhodamineDye lastRhodamineDye() { + IMCMessage m = get("RhodamineDye"); + if (m != null) + try { + RhodamineDye ms = new RhodamineDye(); + ms.copyFrom(m); + return ms; + } + catch (Exception e) { } + return null; + } + + /** + * Retrieve the last {@link RhodamineDye} generated by the given entityName or null if no such message was received yet. + * @param entityName The name of the entity that generated the message + * @return last {@link RhodamineDye} on this state or null if no message of that type was received yet. + */ + public pt.lsts.imc.RhodamineDye lastRhodamineDye(String entityName) { + IMCMessage m = get(pt.lsts.imc.RhodamineDye.ID_STATIC, entitiesInverted.get(entityName)); + if (m != null) + try { + RhodamineDye ms = new RhodamineDye(); + ms.copyFrom(m); + return ms; + } + catch (Exception e) { } + return null; + } + + /** + * Wait and retrieve the next {@link RhodamineDye}. + * @param timeoutMillis Maximum ammount of time to block, in milliseconds. + * @return The received {@link RhodamineDye} or null if no such message was received for timeoutMillis milliseconds + */ + public pt.lsts.imc.RhodamineDye pollRhodamineDye(long timeoutMillis) { + IMCMessage m = poll("RhodamineDye", timeoutMillis); + if (m != null) + try { + RhodamineDye ms = new RhodamineDye(); + ms.copyFrom(m); + return ms; + } + catch (Exception e) { } + return null; + } + + /** + * Wait and retrieve the next {@link RhodamineDye} generated by given entity. + * @param entityName The name of the generating entity. + * @param timeoutMillis Maximum ammount of time to block, in milliseconds. + * @return The received {@link RhodamineDye} or null if no such message was received for timeoutMillis milliseconds + */ + public pt.lsts.imc.RhodamineDye pollRhodamineDye(String entityName, long timeoutMillis) { + IMCMessage m = poll("RhodamineDye", entityName, timeoutMillis); + if (m != null) + try { + RhodamineDye ms = new RhodamineDye(); + ms.copyFrom(m); + return ms; + } + catch (Exception e) { } + return null; + } + + /** + * Retrieve the last {@link CrudeOil} or null if no message of that type was received yet. + * @return last {@link CrudeOil} on this state or null if no message of that type was received yet. + */ + public pt.lsts.imc.CrudeOil lastCrudeOil() { + IMCMessage m = get("CrudeOil"); + if (m != null) + try { + CrudeOil ms = new CrudeOil(); + ms.copyFrom(m); + return ms; + } + catch (Exception e) { } + return null; + } + + /** + * Retrieve the last {@link CrudeOil} generated by the given entityName or null if no such message was received yet. + * @param entityName The name of the entity that generated the message + * @return last {@link CrudeOil} on this state or null if no message of that type was received yet. + */ + public pt.lsts.imc.CrudeOil lastCrudeOil(String entityName) { + IMCMessage m = get(pt.lsts.imc.CrudeOil.ID_STATIC, entitiesInverted.get(entityName)); + if (m != null) + try { + CrudeOil ms = new CrudeOil(); + ms.copyFrom(m); + return ms; + } + catch (Exception e) { } + return null; + } + + /** + * Wait and retrieve the next {@link CrudeOil}. + * @param timeoutMillis Maximum ammount of time to block, in milliseconds. + * @return The received {@link CrudeOil} or null if no such message was received for timeoutMillis milliseconds + */ + public pt.lsts.imc.CrudeOil pollCrudeOil(long timeoutMillis) { + IMCMessage m = poll("CrudeOil", timeoutMillis); + if (m != null) + try { + CrudeOil ms = new CrudeOil(); + ms.copyFrom(m); + return ms; + } + catch (Exception e) { } + return null; + } + + /** + * Wait and retrieve the next {@link CrudeOil} generated by given entity. + * @param entityName The name of the generating entity. + * @param timeoutMillis Maximum ammount of time to block, in milliseconds. + * @return The received {@link CrudeOil} or null if no such message was received for timeoutMillis milliseconds + */ + public pt.lsts.imc.CrudeOil pollCrudeOil(String entityName, long timeoutMillis) { + IMCMessage m = poll("CrudeOil", entityName, timeoutMillis); + if (m != null) + try { + CrudeOil ms = new CrudeOil(); + ms.copyFrom(m); + return ms; + } + catch (Exception e) { } + return null; + } + + /** + * Retrieve the last {@link FineOil} or null if no message of that type was received yet. + * @return last {@link FineOil} on this state or null if no message of that type was received yet. + */ + public pt.lsts.imc.FineOil lastFineOil() { + IMCMessage m = get("FineOil"); + if (m != null) + try { + FineOil ms = new FineOil(); + ms.copyFrom(m); + return ms; + } + catch (Exception e) { } + return null; + } + + /** + * Retrieve the last {@link FineOil} generated by the given entityName or null if no such message was received yet. + * @param entityName The name of the entity that generated the message + * @return last {@link FineOil} on this state or null if no message of that type was received yet. + */ + public pt.lsts.imc.FineOil lastFineOil(String entityName) { + IMCMessage m = get(pt.lsts.imc.FineOil.ID_STATIC, entitiesInverted.get(entityName)); + if (m != null) + try { + FineOil ms = new FineOil(); + ms.copyFrom(m); + return ms; + } + catch (Exception e) { } + return null; + } + + /** + * Wait and retrieve the next {@link FineOil}. + * @param timeoutMillis Maximum ammount of time to block, in milliseconds. + * @return The received {@link FineOil} or null if no such message was received for timeoutMillis milliseconds + */ + public pt.lsts.imc.FineOil pollFineOil(long timeoutMillis) { + IMCMessage m = poll("FineOil", timeoutMillis); + if (m != null) + try { + FineOil ms = new FineOil(); + ms.copyFrom(m); + return ms; + } + catch (Exception e) { } + return null; + } + + /** + * Wait and retrieve the next {@link FineOil} generated by given entity. + * @param entityName The name of the generating entity. + * @param timeoutMillis Maximum ammount of time to block, in milliseconds. + * @return The received {@link FineOil} or null if no such message was received for timeoutMillis milliseconds + */ + public pt.lsts.imc.FineOil pollFineOil(String entityName, long timeoutMillis) { + IMCMessage m = poll("FineOil", entityName, timeoutMillis); + if (m != null) + try { + FineOil ms = new FineOil(); + ms.copyFrom(m); + return ms; + } + catch (Exception e) { } + return null; + } + /** * Retrieve the last {@link CameraZoom} or null if no message of that type was received yet. * @return last {@link CameraZoom} on this state or null if no message of that type was received yet. @@ -7381,74 +7585,6 @@ public pt.lsts.imc.DvlRejection pollDvlRejection(String entityName, long timeout return null; } - /** - * Retrieve the last {@link NavigationReset} or null if no message of that type was received yet. - * @return last {@link NavigationReset} on this state or null if no message of that type was received yet. - */ - public pt.lsts.imc.NavigationReset lastNavigationReset() { - IMCMessage m = get("NavigationReset"); - if (m != null) - try { - NavigationReset ms = new NavigationReset(); - ms.copyFrom(m); - return ms; - } - catch (Exception e) { } - return null; - } - - /** - * Retrieve the last {@link NavigationReset} generated by the given entityName or null if no such message was received yet. - * @param entityName The name of the entity that generated the message - * @return last {@link NavigationReset} on this state or null if no message of that type was received yet. - */ - public pt.lsts.imc.NavigationReset lastNavigationReset(String entityName) { - IMCMessage m = get(pt.lsts.imc.NavigationReset.ID_STATIC, entitiesInverted.get(entityName)); - if (m != null) - try { - NavigationReset ms = new NavigationReset(); - ms.copyFrom(m); - return ms; - } - catch (Exception e) { } - return null; - } - - /** - * Wait and retrieve the next {@link NavigationReset}. - * @param timeoutMillis Maximum ammount of time to block, in milliseconds. - * @return The received {@link NavigationReset} or null if no such message was received for timeoutMillis milliseconds - */ - public pt.lsts.imc.NavigationReset pollNavigationReset(long timeoutMillis) { - IMCMessage m = poll("NavigationReset", timeoutMillis); - if (m != null) - try { - NavigationReset ms = new NavigationReset(); - ms.copyFrom(m); - return ms; - } - catch (Exception e) { } - return null; - } - - /** - * Wait and retrieve the next {@link NavigationReset} generated by given entity. - * @param entityName The name of the generating entity. - * @param timeoutMillis Maximum ammount of time to block, in milliseconds. - * @return The received {@link NavigationReset} or null if no such message was received for timeoutMillis milliseconds - */ - public pt.lsts.imc.NavigationReset pollNavigationReset(String entityName, long timeoutMillis) { - IMCMessage m = poll("NavigationReset", entityName, timeoutMillis); - if (m != null) - try { - NavigationReset ms = new NavigationReset(); - ms.copyFrom(m); - return ms; - } - catch (Exception e) { } - return null; - } - /** * Retrieve the last {@link LblEstimate} or null if no message of that type was received yet. * @return last {@link LblEstimate} on this state or null if no message of that type was received yet. @@ -15473,4 +15609,208 @@ public pt.lsts.imc.Aborted pollAborted(String entityName, long timeoutMillis) { return null; } + /** + * Retrieve the last {@link UsblAngles} or null if no message of that type was received yet. + * @return last {@link UsblAngles} on this state or null if no message of that type was received yet. + */ + public pt.lsts.imc.UsblAngles lastUsblAngles() { + IMCMessage m = get("UsblAngles"); + if (m != null) + try { + UsblAngles ms = new UsblAngles(); + ms.copyFrom(m); + return ms; + } + catch (Exception e) { } + return null; + } + + /** + * Retrieve the last {@link UsblAngles} generated by the given entityName or null if no such message was received yet. + * @param entityName The name of the entity that generated the message + * @return last {@link UsblAngles} on this state or null if no message of that type was received yet. + */ + public pt.lsts.imc.UsblAngles lastUsblAngles(String entityName) { + IMCMessage m = get(pt.lsts.imc.UsblAngles.ID_STATIC, entitiesInverted.get(entityName)); + if (m != null) + try { + UsblAngles ms = new UsblAngles(); + ms.copyFrom(m); + return ms; + } + catch (Exception e) { } + return null; + } + + /** + * Wait and retrieve the next {@link UsblAngles}. + * @param timeoutMillis Maximum ammount of time to block, in milliseconds. + * @return The received {@link UsblAngles} or null if no such message was received for timeoutMillis milliseconds + */ + public pt.lsts.imc.UsblAngles pollUsblAngles(long timeoutMillis) { + IMCMessage m = poll("UsblAngles", timeoutMillis); + if (m != null) + try { + UsblAngles ms = new UsblAngles(); + ms.copyFrom(m); + return ms; + } + catch (Exception e) { } + return null; + } + + /** + * Wait and retrieve the next {@link UsblAngles} generated by given entity. + * @param entityName The name of the generating entity. + * @param timeoutMillis Maximum ammount of time to block, in milliseconds. + * @return The received {@link UsblAngles} or null if no such message was received for timeoutMillis milliseconds + */ + public pt.lsts.imc.UsblAngles pollUsblAngles(String entityName, long timeoutMillis) { + IMCMessage m = poll("UsblAngles", entityName, timeoutMillis); + if (m != null) + try { + UsblAngles ms = new UsblAngles(); + ms.copyFrom(m); + return ms; + } + catch (Exception e) { } + return null; + } + + /** + * Retrieve the last {@link UsblPosition} or null if no message of that type was received yet. + * @return last {@link UsblPosition} on this state or null if no message of that type was received yet. + */ + public pt.lsts.imc.UsblPosition lastUsblPosition() { + IMCMessage m = get("UsblPosition"); + if (m != null) + try { + UsblPosition ms = new UsblPosition(); + ms.copyFrom(m); + return ms; + } + catch (Exception e) { } + return null; + } + + /** + * Retrieve the last {@link UsblPosition} generated by the given entityName or null if no such message was received yet. + * @param entityName The name of the entity that generated the message + * @return last {@link UsblPosition} on this state or null if no message of that type was received yet. + */ + public pt.lsts.imc.UsblPosition lastUsblPosition(String entityName) { + IMCMessage m = get(pt.lsts.imc.UsblPosition.ID_STATIC, entitiesInverted.get(entityName)); + if (m != null) + try { + UsblPosition ms = new UsblPosition(); + ms.copyFrom(m); + return ms; + } + catch (Exception e) { } + return null; + } + + /** + * Wait and retrieve the next {@link UsblPosition}. + * @param timeoutMillis Maximum ammount of time to block, in milliseconds. + * @return The received {@link UsblPosition} or null if no such message was received for timeoutMillis milliseconds + */ + public pt.lsts.imc.UsblPosition pollUsblPosition(long timeoutMillis) { + IMCMessage m = poll("UsblPosition", timeoutMillis); + if (m != null) + try { + UsblPosition ms = new UsblPosition(); + ms.copyFrom(m); + return ms; + } + catch (Exception e) { } + return null; + } + + /** + * Wait and retrieve the next {@link UsblPosition} generated by given entity. + * @param entityName The name of the generating entity. + * @param timeoutMillis Maximum ammount of time to block, in milliseconds. + * @return The received {@link UsblPosition} or null if no such message was received for timeoutMillis milliseconds + */ + public pt.lsts.imc.UsblPosition pollUsblPosition(String entityName, long timeoutMillis) { + IMCMessage m = poll("UsblPosition", entityName, timeoutMillis); + if (m != null) + try { + UsblPosition ms = new UsblPosition(); + ms.copyFrom(m); + return ms; + } + catch (Exception e) { } + return null; + } + + /** + * Retrieve the last {@link UsblFix} or null if no message of that type was received yet. + * @return last {@link UsblFix} on this state or null if no message of that type was received yet. + */ + public pt.lsts.imc.UsblFix lastUsblFix() { + IMCMessage m = get("UsblFix"); + if (m != null) + try { + UsblFix ms = new UsblFix(); + ms.copyFrom(m); + return ms; + } + catch (Exception e) { } + return null; + } + + /** + * Retrieve the last {@link UsblFix} generated by the given entityName or null if no such message was received yet. + * @param entityName The name of the entity that generated the message + * @return last {@link UsblFix} on this state or null if no message of that type was received yet. + */ + public pt.lsts.imc.UsblFix lastUsblFix(String entityName) { + IMCMessage m = get(pt.lsts.imc.UsblFix.ID_STATIC, entitiesInverted.get(entityName)); + if (m != null) + try { + UsblFix ms = new UsblFix(); + ms.copyFrom(m); + return ms; + } + catch (Exception e) { } + return null; + } + + /** + * Wait and retrieve the next {@link UsblFix}. + * @param timeoutMillis Maximum ammount of time to block, in milliseconds. + * @return The received {@link UsblFix} or null if no such message was received for timeoutMillis milliseconds + */ + public pt.lsts.imc.UsblFix pollUsblFix(long timeoutMillis) { + IMCMessage m = poll("UsblFix", timeoutMillis); + if (m != null) + try { + UsblFix ms = new UsblFix(); + ms.copyFrom(m); + return ms; + } + catch (Exception e) { } + return null; + } + + /** + * Wait and retrieve the next {@link UsblFix} generated by given entity. + * @param entityName The name of the generating entity. + * @param timeoutMillis Maximum ammount of time to block, in milliseconds. + * @return The received {@link UsblFix} or null if no such message was received for timeoutMillis milliseconds + */ + public pt.lsts.imc.UsblFix pollUsblFix(String entityName, long timeoutMillis) { + IMCMessage m = poll("UsblFix", entityName, timeoutMillis); + if (m != null) + try { + UsblFix ms = new UsblFix(); + ms.copyFrom(m); + return ms; + } + catch (Exception e) { } + return null; + } + }