From e3565ffcffd4a548fd1551d44b9ff9015a2d5b62 Mon Sep 17 00:00:00 2001 From: Rowan Skewes Date: Sat, 21 Apr 2018 02:07:43 +1000 Subject: [PATCH 1/4] Fix gyrometer to read angular velocity --- simulator/pom.xml | 4 +-- .../src/main/java/msp/simulator/Main.java | 7 ++-- .../msp/simulator/NumericalSimulator.java | 6 ++-- .../integration/RotAccProvider.java | 4 +-- .../groundStation/GroundStation.java | 8 ++--- .../msp/simulator/satellite/Satellite.java | 2 +- .../satellite/assembly/SatelliteBody.java | 9 +++--- .../satellite/sensors/Gyrometer.java | 9 +++--- .../java/msp/simulator/user/Dashboard.java | 32 ++++++++++++------- .../logs/ephemeris/EphemerisGenerator.java | 6 ++-- 10 files changed, 50 insertions(+), 37 deletions(-) diff --git a/simulator/pom.xml b/simulator/pom.xml index f7a240f4..47fb9ec5 100644 --- a/simulator/pom.xml +++ b/simulator/pom.xml @@ -31,8 +31,6 @@ net.spy spymemcached 2.12.3 - system - ${project.basedir}/src/main/resources/jar/spymemcached-2.12.3.jar @@ -56,4 +54,4 @@ msp.simulator - \ No newline at end of file + diff --git a/simulator/src/main/java/msp/simulator/Main.java b/simulator/src/main/java/msp/simulator/Main.java index baf1b10f..8f0493d5 100644 --- a/simulator/src/main/java/msp/simulator/Main.java +++ b/simulator/src/main/java/msp/simulator/Main.java @@ -40,13 +40,14 @@ public static void main(String[] args) { Dashboard.setSimulationDuration(1000000); Dashboard.setIntegrationTimeStep(0.1); - Dashboard.setEphemerisTimeStep(1.0); - Dashboard.setSatelliteInertiaMatrix(SatelliteBody.satInertiaMatrix); + Dashboard.setEphemerisTimeStep(0.1); + //Dashboard.setSatelliteInertiaMatrix(SatelliteBody.satInertiaMatrix); + Dashboard.setStepDelay(0.1); Dashboard.setInitialAttitudeQuaternion(new Quaternion(1, 0, 0, 0)); Dashboard.setInitialSpin(new Vector3D(0.5, 0.5, 0.5)); Dashboard.setInitialRotAcceleration(new Vector3D(0,0,0)); - Dashboard.setTorqueDisturbances(true); + Dashboard.setTorqueDisturbances(false); Dashboard.setCommandTorqueProvider(TorqueProviderEnum.MEMCACHED); Dashboard.setMemCachedConnection(true, "127.0.0.1:11211"); diff --git a/simulator/src/main/java/msp/simulator/NumericalSimulator.java b/simulator/src/main/java/msp/simulator/NumericalSimulator.java index 83cae2f6..49a8c7e1 100644 --- a/simulator/src/main/java/msp/simulator/NumericalSimulator.java +++ b/simulator/src/main/java/msp/simulator/NumericalSimulator.java @@ -49,6 +49,9 @@ public class NumericalSimulator { * Default value is Long.MAX_VALUE. */ public static long simulationDuration = Long.MAX_VALUE; + /** Wall clock time between computing steps of the simulation. */ + public static double stepDelay = 0.1; + /** Real-time processing flag. */ public static boolean realTimeUserFlag = false; @@ -215,8 +218,7 @@ public void process() { scheduler.scheduleAtFixedRate( mainSimulationTask, 0, - (long) (this.dynamic.getPropagation().getIntegrationManager() - .getStepSize() * 1000), + (long) (stepDelay * 1000), TimeUnit.MILLISECONDS); diff --git a/simulator/src/main/java/msp/simulator/dynamic/propagation/integration/RotAccProvider.java b/simulator/src/main/java/msp/simulator/dynamic/propagation/integration/RotAccProvider.java index 8b0b3c9a..8e4dc34a 100644 --- a/simulator/src/main/java/msp/simulator/dynamic/propagation/integration/RotAccProvider.java +++ b/simulator/src/main/java/msp/simulator/dynamic/propagation/integration/RotAccProvider.java @@ -138,8 +138,8 @@ public static double[] computeEulerEquations( * the Euler Equations of motion for a rotating rigid body. */ rotAcc[0] = (M1 - (I3 - I2) * W2 * W3) / I1 ; - rotAcc[1] = (M2 - (I1 - I3) * W3 * W1) / I1 ; - rotAcc[2] = (M3 - (I2 - I1) * W1 * W2) / I1 ; + rotAcc[1] = (M2 - (I1 - I3) * W3 * W1) / I2 ; + rotAcc[2] = (M3 - (I2 - I1) * W1 * W2) / I3 ; return rotAcc; } diff --git a/simulator/src/main/java/msp/simulator/groundStation/GroundStation.java b/simulator/src/main/java/msp/simulator/groundStation/GroundStation.java index 83042569..c91dbbf3 100644 --- a/simulator/src/main/java/msp/simulator/groundStation/GroundStation.java +++ b/simulator/src/main/java/msp/simulator/groundStation/GroundStation.java @@ -158,7 +158,7 @@ public void executeMission(AbsoluteDate date) { byte[] raan = MemcachedRawTranscoder.toRawByteArray( Double.valueOf(tle.getLine2().substring(17, 25))); - byte[] eccentricity = MemcachedRawTranscoder.toRawByteArray( + byte[] eccentricity1e7 = MemcachedRawTranscoder.toRawByteArray( Double.valueOf(tle.getLine2().substring(26, 33))); byte[] argPerigee = MemcachedRawTranscoder.toRawByteArray( @@ -175,7 +175,7 @@ public void executeMission(AbsoluteDate date) { memcached.set("Simulation_TLE_Mean_Motion_First_Deriv" , 0, meanMotionFirstDerivative); memcached.set("Simulation_TLE_Mean_Motion" , 0, meanMotion); memcached.set("Simulation_TLE_Argument_Perigee" , 0, argPerigee); - memcached.set("Simulation_TLE_Eccentricity" , 0, eccentricity); + memcached.set("Simulation_TLE_Eccentricity_1e7" , 0, eccentricity1e7); memcached.set("Simulation_TLE_Mean_Anomaly" , 0, meanAnomaly); memcached.set("Simulation_TLE_Inclination" , 0, inclination); memcached.set("Simulation_TLE_Bstar" , 0, bStar); @@ -213,8 +213,8 @@ public void executeMission(AbsoluteDate date) { + "TLE_Epoch: " + + ByteBuffer.wrap(epoch).getDouble() + "\n" - + "TLE_Eccentricity: " + - + ByteBuffer.wrap(eccentricity).getDouble() + + "TLE_Eccentricity_1e7: " + + + ByteBuffer.wrap(eccentricity1e7).getDouble() + "\n" + "TLE_Argument_Perigee: " + + ByteBuffer.wrap(argPerigee).getDouble() diff --git a/simulator/src/main/java/msp/simulator/satellite/Satellite.java b/simulator/src/main/java/msp/simulator/satellite/Satellite.java index f5e5b2d1..2f116da8 100644 --- a/simulator/src/main/java/msp/simulator/satellite/Satellite.java +++ b/simulator/src/main/java/msp/simulator/satellite/Satellite.java @@ -105,7 +105,7 @@ public void executeStepMission() { ); /* Gyrometer Sensor Measurement */ - Vector3D gyroMeasure = this.getSensors().getGyrometer().getData_rotAcc(); + Vector3D gyroMeasure = this.getSensors().getGyrometer().getData_angularVelocity(); byte[] rawGyro_x = MemcachedRawTranscoder.toRawByteArray(gyroMeasure.getX()); byte[] rawGyro_y = MemcachedRawTranscoder.toRawByteArray(gyroMeasure.getY()); byte[] rawGyro_z = MemcachedRawTranscoder.toRawByteArray(gyroMeasure.getZ()); diff --git a/simulator/src/main/java/msp/simulator/satellite/assembly/SatelliteBody.java b/simulator/src/main/java/msp/simulator/satellite/assembly/SatelliteBody.java index a9a310ff..01995149 100644 --- a/simulator/src/main/java/msp/simulator/satellite/assembly/SatelliteBody.java +++ b/simulator/src/main/java/msp/simulator/satellite/assembly/SatelliteBody.java @@ -33,16 +33,16 @@ public class SatelliteBody extends BoxAndSolarArraySpacecraft { /* ******* Public Static Attributes ******* */ /** Size of the satellite box in meters - (x, y, z) */ - public static double[] satBoxSizeWithNoSolarPanel = new double[] {0.01, 0.01, 0.01} ; + public static final double[] satBoxSizeWithNoSolarPanel = new double[] {0.01, 0.01, 0.01} ; /* Note that the size of the solar panels is set to zero in the class constructor.*/ /** Mass of the satellite in kilogram. */ - public static double satelliteMass = 1.04; + public static final double satelliteMass = 1.04; /* TODO(rskew) update inertia matrix. */ /** Inertia matrix of the satellite. */ - public static double[][] satInertiaMatrix = /* kg.m^2 */ { + public static final double[][] satInertiaMatrix = /* kg.m^2 */ { {1191.648 * 1.3e-6, 0 , 0 }, { 0 , 1169.506 * 1.3e-6, 0 }, { 0 , 0 , 1203.969 * 1.3e-6 }, @@ -101,7 +101,8 @@ public SatelliteBody(Environment environment) { /* Copy the user value into a protected variable. */ this.satBoxSize = SatelliteBody.satBoxSizeWithNoSolarPanel; this.satMass = SatelliteBody.satelliteMass; - this.inertiaMatrix = SatelliteBody.satInertiaMatrix; + //this.inertiaMatrix = SatelliteBody.satInertiaMatrix; + this.inertiaMatrix = SatelliteBody.simpleBalancedInertiaMatrix; SatelliteBody.logger.info(CustomLoggingTools.indentMsg(SatelliteBody.logger, " -> Building the CubeSat body: Success.")); diff --git a/simulator/src/main/java/msp/simulator/satellite/sensors/Gyrometer.java b/simulator/src/main/java/msp/simulator/satellite/sensors/Gyrometer.java index ef1131fd..c5f86919 100644 --- a/simulator/src/main/java/msp/simulator/satellite/sensors/Gyrometer.java +++ b/simulator/src/main/java/msp/simulator/satellite/sensors/Gyrometer.java @@ -34,7 +34,8 @@ public class Gyrometer { /** This intensity is used to generate a random number to be * added to each components of the sensor data. */ - public static double defaultGyroNoiseIntensity = 1e-3; + //public static double defaultGyroNoiseIntensity = 1e-3; + public static double defaultGyroNoiseIntensity = 0; /* **************************************** */ @@ -65,13 +66,13 @@ public Gyrometer(Environment environment, Assembly assembly) { * Retrieve the data from the sensor. * @return Rotational Acceleration */ - public Vector3D getData_rotAcc() { - /* Get the acceleration from the satellite state. */ + public Vector3D getData_angularVelocity() { + /* Get the angular velocity from the satellite state. */ /* Note that these data are already in the satellite * body frame! */ Vector3D data = this.assembly.getStates() - .getCurrentState().getAttitude().getRotationAcceleration(); + .getCurrentState().getAttitude().getSpin(); /* Add the noise contribution. */ Vector3D noise = new Vector3D( diff --git a/simulator/src/main/java/msp/simulator/user/Dashboard.java b/simulator/src/main/java/msp/simulator/user/Dashboard.java index 681253b1..39468fdf 100644 --- a/simulator/src/main/java/msp/simulator/user/Dashboard.java +++ b/simulator/src/main/java/msp/simulator/user/Dashboard.java @@ -119,9 +119,9 @@ public static void setDefaultConfiguration() { Dashboard.setTorqueDisturbances(true); /* **** Structure Settings **** */ - Dashboard.setSatBoxSizeWithNoSolarPanel(new double[]{0.01, 0.01, 0.01}); - Dashboard.setSatelliteMass(1.0); - Dashboard.setSatelliteInertiaMatrix(SatelliteBody.simpleBalancedInertiaMatrix); + //Dashboard.setSatBoxSizeWithNoSolarPanel(new double[]{0.01, 0.01, 0.01}); + //Dashboard.setSatelliteMass(1.0); + //Dashboard.setSatelliteInertiaMatrix(SatelliteBody.simpleBalancedInertiaMatrix); /* **** Structure Settings **** */ Dashboard.setMagnetometerNoiseIntensity(1e2); @@ -232,6 +232,14 @@ public static void setSimulationDuration(long duration) { NumericalSimulator.simulationDuration = duration ; /* s. */ } + /** + * Set the wall clock time daley between comuting steps + * @param stepDelay in seconds + */ + public static void setStepDelay(double stepDelay) { + NumericalSimulator.stepDelay = stepDelay; + } + /** * Set the period of work of the ground station, i.e. the time without * any update. @@ -256,9 +264,9 @@ public static void setOrbitalParameters(OrbitalParameters param) { * Set the size of the satellite box without solar panel. * @param xyzSize a three-dimension array (x, y, z) in meter. */ - public static void setSatBoxSizeWithNoSolarPanel(double[] xyzSize) { - SatelliteBody.satBoxSizeWithNoSolarPanel = xyzSize; - } + //public static void setSatBoxSizeWithNoSolarPanel(double[] xyzSize) { + // SatelliteBody.satBoxSizeWithNoSolarPanel = xyzSize; + //} /** * Set the initial attitude quaternion. (Representing the rotation @@ -298,17 +306,17 @@ public static void setTorqueDisturbances(boolean flag) { * Set the user-defined satellite mass. * @param mass in kilogram */ - public static void setSatelliteMass(double mass) { - SatelliteBody.satelliteMass = mass; - } + //public static void setSatelliteMass(double mass) { + // SatelliteBody.satelliteMass = mass; + //} /** * Set the user-specified inertia matrix of the satellite. * @param iMatrix Inertia Matrix to be set */ - public static void setSatelliteInertiaMatrix(double[][] iMatrix) { - SatelliteBody.satInertiaMatrix = iMatrix; - } + //public static void setSatelliteInertiaMatrix(double[][] iMatrix) { + // SatelliteBody.satInertiaMatrix = iMatrix; + //} /** * Set the file path of the output ephemeris. diff --git a/simulator/src/main/java/msp/simulator/utils/logs/ephemeris/EphemerisGenerator.java b/simulator/src/main/java/msp/simulator/utils/logs/ephemeris/EphemerisGenerator.java index dd440d68..9cd0fd75 100644 --- a/simulator/src/main/java/msp/simulator/utils/logs/ephemeris/EphemerisGenerator.java +++ b/simulator/src/main/java/msp/simulator/utils/logs/ephemeris/EphemerisGenerator.java @@ -254,14 +254,16 @@ public void writeStep(Satellite satellite) { "Attitude: [{}, {}, {}, {}] \n" + "Spin : {} \n" + "RotAcc : {}\n" + - "Momentum: {}", + "Momentum: {}\n" + + "Momentum Norm: {}", newState.getAttitude().getRotation().getQ0(), newState.getAttitude().getRotation().getQ1(), newState.getAttitude().getRotation().getQ2(), newState.getAttitude().getRotation().getQ3(), newState.getAttitude().getSpin().toString(), newState.getAttitude().getRotationAcceleration().toString(), - satellite.getAssembly().getAngularMomentum() + satellite.getAssembly().getAngularMomentum(), + satellite.getAssembly().getAngularMomentum().getNorm() ); } catch (OrekitException | IOException e) { From 4d7c54d8b3184f3d6a176a95e5fbbec64d0a7171 Mon Sep 17 00:00:00 2001 From: Florian Chaubeyre Date: Wed, 25 Apr 2018 15:14:25 +1000 Subject: [PATCH 2/4] Fix ITRF to Body transformation. --- orekit-9.1/bin/.gitignore | 2 + orekit-9.1/bin/.project | 23 ++ .../target/classes/META-INF/LICENSE.txt | 202 ++++++++++++++++++ orekit-9.1/target/classes/META-INF/NOTICE.txt | 44 ++++ .../src/main/java/msp/simulator/Main.java | 4 +- .../groundStation/GroundStation.java | 6 +- .../msp/simulator/satellite/Satellite.java | 2 +- .../satellite/assembly/Assembly.java | 22 +- .../satellite/sensors/Magnetometer.java | 18 +- 9 files changed, 299 insertions(+), 24 deletions(-) create mode 100644 orekit-9.1/bin/.gitignore create mode 100644 orekit-9.1/bin/.project create mode 100644 orekit-9.1/target/classes/META-INF/LICENSE.txt create mode 100644 orekit-9.1/target/classes/META-INF/NOTICE.txt diff --git a/orekit-9.1/bin/.gitignore b/orekit-9.1/bin/.gitignore new file mode 100644 index 00000000..09e3bc9b --- /dev/null +++ b/orekit-9.1/bin/.gitignore @@ -0,0 +1,2 @@ +/bin/ +/target/ diff --git a/orekit-9.1/bin/.project b/orekit-9.1/bin/.project new file mode 100644 index 00000000..fbeca805 --- /dev/null +++ b/orekit-9.1/bin/.project @@ -0,0 +1,23 @@ + + + orekit-9.1 + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/orekit-9.1/target/classes/META-INF/LICENSE.txt b/orekit-9.1/target/classes/META-INF/LICENSE.txt new file mode 100644 index 00000000..d6456956 --- /dev/null +++ b/orekit-9.1/target/classes/META-INF/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/orekit-9.1/target/classes/META-INF/NOTICE.txt b/orekit-9.1/target/classes/META-INF/NOTICE.txt new file mode 100644 index 00000000..44cad725 --- /dev/null +++ b/orekit-9.1/target/classes/META-INF/NOTICE.txt @@ -0,0 +1,44 @@ +OREKIT +Copyright 2002-2017 CS Systèmes d'Information + +This product includes software developed by +CS Systèmes d'Information (http://www.c-s.fr/) + +This product includes software developed by +Bruce R. Bowman (HQ AFSPC, Space Analysis Division) + +This product includes software translated from original work developed by +David A. Vallado, Paul Crawford, Richard Hujsak, T.S. Kelso + +This product includes software translated from original work developed by +Felix R. Hoots, Ronald L. Roehrich + +This product includes software translated from original work developed by +R. Biancale, S. Bruinsma (CNES) + +This product includes data computed by +P. Gégout (CNRS / UMR5563 - GET) + +This product includes software translated from original work developed by +R. Biancale, S. Bruinsma (CNES) + +This product includes software translated from original work developed by +Mickaël Gastineau (CNRS - Observatoire de Paris - IMCCE) + +This product includes software translated from original work developed by +The Apache Software Foundation (http://www.apache.org/) + +This product depends on software developed by +The Apache Software Foundation (http://www.apache.org/) + +This product depends on software developed by +The Hipparchus project (https://hipparchus.org/) + +This product includes software translated from original work developed by +M. Picone, A.E. Hedin, D. Drob (Naval Research Laboratory) + +This product includes software translated from original work developed by +Dominik Brodowski + +This product includes software translated from original work developed by + Duncan Agnew and copyright 2008 IERS Conventions center diff --git a/simulator/src/main/java/msp/simulator/Main.java b/simulator/src/main/java/msp/simulator/Main.java index 8f0493d5..3d2073f1 100644 --- a/simulator/src/main/java/msp/simulator/Main.java +++ b/simulator/src/main/java/msp/simulator/Main.java @@ -41,13 +41,13 @@ public static void main(String[] args) { Dashboard.setIntegrationTimeStep(0.1); Dashboard.setEphemerisTimeStep(0.1); - //Dashboard.setSatelliteInertiaMatrix(SatelliteBody.satInertiaMatrix); - Dashboard.setStepDelay(0.1); + Dashboard.setStepDelay(0.1); Dashboard.setInitialAttitudeQuaternion(new Quaternion(1, 0, 0, 0)); Dashboard.setInitialSpin(new Vector3D(0.5, 0.5, 0.5)); Dashboard.setInitialRotAcceleration(new Vector3D(0,0,0)); Dashboard.setTorqueDisturbances(false); + //Dashboard.setSatelliteInertiaMatrix(SatelliteBody.satInertiaMatrix); Dashboard.setCommandTorqueProvider(TorqueProviderEnum.MEMCACHED); Dashboard.setMemCachedConnection(true, "127.0.0.1:11211"); diff --git a/simulator/src/main/java/msp/simulator/groundStation/GroundStation.java b/simulator/src/main/java/msp/simulator/groundStation/GroundStation.java index c91dbbf3..6ae7825c 100644 --- a/simulator/src/main/java/msp/simulator/groundStation/GroundStation.java +++ b/simulator/src/main/java/msp/simulator/groundStation/GroundStation.java @@ -175,7 +175,7 @@ public void executeMission(AbsoluteDate date) { memcached.set("Simulation_TLE_Mean_Motion_First_Deriv" , 0, meanMotionFirstDerivative); memcached.set("Simulation_TLE_Mean_Motion" , 0, meanMotion); memcached.set("Simulation_TLE_Argument_Perigee" , 0, argPerigee); - memcached.set("Simulation_TLE_Eccentricity_1e7" , 0, eccentricity1e7); + memcached.set("Simulation_TLE_Eccentricity_1e7" , 0, eccentricity1e7); memcached.set("Simulation_TLE_Mean_Anomaly" , 0, meanAnomaly); memcached.set("Simulation_TLE_Inclination" , 0, inclination); memcached.set("Simulation_TLE_Bstar" , 0, bStar); @@ -219,9 +219,9 @@ public void executeMission(AbsoluteDate date) { + "TLE_Argument_Perigee: " + + ByteBuffer.wrap(argPerigee).getDouble() + "\n" - + "Raw : " + tle.getLine1() + + "Raw: " + tle.getLine1() + "\n" - + "Raw : " + tle.getLine2() + + "Raw: " + tle.getLine2() ; logger.info(tleUpdate); diff --git a/simulator/src/main/java/msp/simulator/satellite/Satellite.java b/simulator/src/main/java/msp/simulator/satellite/Satellite.java index 2f116da8..89ac9a71 100644 --- a/simulator/src/main/java/msp/simulator/satellite/Satellite.java +++ b/simulator/src/main/java/msp/simulator/satellite/Satellite.java @@ -75,7 +75,7 @@ public Satellite(Environment environment) { */ public void executeStepMission() { AbsoluteDate date = this.getStates().getCurrentState().getDate(); - + /* Export Sensor Measurements */ if (this.io.isConnectedToMemCached()) { diff --git a/simulator/src/main/java/msp/simulator/satellite/assembly/Assembly.java b/simulator/src/main/java/msp/simulator/satellite/assembly/Assembly.java index ed27dd00..bb422f8d 100644 --- a/simulator/src/main/java/msp/simulator/satellite/assembly/Assembly.java +++ b/simulator/src/main/java/msp/simulator/satellite/assembly/Assembly.java @@ -37,7 +37,7 @@ public class Assembly { /** Logger of the class */ private static final Logger logger = LoggerFactory.getLogger(Assembly.class); - + /** Earth instance of the simulation. */ private Earth earth; @@ -46,9 +46,6 @@ public class Assembly { /** Instance of the satellite initial state in space. */ private SatelliteStates satelliteStates; - - /** Satellite frame. */ - private Frame satelliteFrame; /** * Build the satellite as a body and a state vector. @@ -62,11 +59,6 @@ public Assembly(Environment environment) { this.satelliteBody = new SatelliteBody(environment); this.satelliteStates = new SatelliteStates(environment, satelliteBody); - this.satelliteFrame = new Frame ( - FramesFactory.getEME2000(), - this.getStates().getCurrentState().toTransform(), - "SatelliteFrame" - ); this.earth = environment.getSolarSystem().getEarth(); } @@ -95,7 +87,11 @@ public SatelliteStates getStates() { * frame fixed with the axis body. */ public Frame getSatelliteFrame() { - return this.satelliteFrame; + return new Frame ( + FramesFactory.getEME2000(), + this.getStates().getCurrentState().toTransform(), + "SatelliteFrame" + ); } /** @@ -105,7 +101,7 @@ public Frame getSatelliteFrame() { public Vector3D getAngularMomentum() { Vector3D rotationRate = this.satelliteStates .getCurrentState().getAttitude().getSpin(); - + double[][] inertiaMatrix = this.satelliteBody.getInertiaMatrix(); Vector3D row0 = new Vector3D(inertiaMatrix[0]); @@ -130,13 +126,13 @@ public Transform getItrf2body(AbsoluteDate date) { Transform itrf2body = null; try { itrf2body = this.earth.getRotatingFrame().getTransformTo( - this.satelliteFrame, + this.getSatelliteFrame(), date ); } catch (OrekitException e) { e.printStackTrace(); } - + return itrf2body; } diff --git a/simulator/src/main/java/msp/simulator/satellite/sensors/Magnetometer.java b/simulator/src/main/java/msp/simulator/satellite/sensors/Magnetometer.java index 5b26a0d1..e6866c19 100644 --- a/simulator/src/main/java/msp/simulator/satellite/sensors/Magnetometer.java +++ b/simulator/src/main/java/msp/simulator/satellite/sensors/Magnetometer.java @@ -146,24 +146,32 @@ public GeoMagneticElements retrievePerfectField() { * the altitude of the satellite is slightly shifted from the true * one. */ +// GeoMagneticElements trueField_itrf = this.geomagField.getField().calculateField( +// FastMath.toDegrees(geodeticPosition.getLatitude()), /* decimal deg */ +// FastMath.toDegrees(geodeticPosition.getLongitude()), /* decimal deg */ +// (satState.getA() - this.earth.getRadius()) / 1e3 /* km */ +// ); + GeoMagneticElements trueField_itrf = this.geomagField.getField().calculateField( - FastMath.toDegrees(geodeticPosition.getLatitude()), /* decimal deg */ - FastMath.toDegrees(geodeticPosition.getLongitude()), /* decimal deg */ - (satState.getA() - this.earth.getRadius()) / 1e3 /* km */ + 0.007707323868690944, /* decimal deg */ + -156.00687854677085, /* decimal deg */ + 574.9999944513394/* km */ ); logger.debug("Magnetometer Measurement: \n" + "Latitude: " + FastMath.toDegrees(geodeticPosition.getLatitude()) + " °\n" + "Longitud: " + FastMath.toDegrees(geodeticPosition.getLongitude()) + " °\n" + "Altitude: " + (satState.getA() - this.earth.getRadius()) / 1e3 + " km\n" + - "True Geo ITRF" + trueField_itrf.toString() + "(ITRF): " + trueField_itrf.toString() ); /* Rotate the magnetic field reading into the body frame */ Vector3D trueField_body = this.assembly.getItrf2body(satState.getDate()) .transformVector(trueField_itrf.getFieldVector()); - return new GeoMagneticElements(trueField_body); + GeoMagneticElements trueGeoMag_body = new GeoMagneticElements(trueField_body); + + return trueGeoMag_body; } /** From 935fc598f9d4d36dfa11e686c5a03223897411eb Mon Sep 17 00:00:00 2001 From: Florian Chaubeyre Date: Thu, 26 Apr 2018 17:27:38 +1000 Subject: [PATCH 3/4] Delete remaining Orekit lib. --- orekit-9.1/bin/.gitignore | 2 - orekit-9.1/bin/.project | 23 -- .../target/classes/META-INF/LICENSE.txt | 202 ------------------ orekit-9.1/target/classes/META-INF/NOTICE.txt | 44 ---- 4 files changed, 271 deletions(-) delete mode 100644 orekit-9.1/bin/.gitignore delete mode 100644 orekit-9.1/bin/.project delete mode 100644 orekit-9.1/target/classes/META-INF/LICENSE.txt delete mode 100644 orekit-9.1/target/classes/META-INF/NOTICE.txt diff --git a/orekit-9.1/bin/.gitignore b/orekit-9.1/bin/.gitignore deleted file mode 100644 index 09e3bc9b..00000000 --- a/orekit-9.1/bin/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/bin/ -/target/ diff --git a/orekit-9.1/bin/.project b/orekit-9.1/bin/.project deleted file mode 100644 index fbeca805..00000000 --- a/orekit-9.1/bin/.project +++ /dev/null @@ -1,23 +0,0 @@ - - - orekit-9.1 - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.m2e.core.maven2Nature - - diff --git a/orekit-9.1/target/classes/META-INF/LICENSE.txt b/orekit-9.1/target/classes/META-INF/LICENSE.txt deleted file mode 100644 index d6456956..00000000 --- a/orekit-9.1/target/classes/META-INF/LICENSE.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/orekit-9.1/target/classes/META-INF/NOTICE.txt b/orekit-9.1/target/classes/META-INF/NOTICE.txt deleted file mode 100644 index 44cad725..00000000 --- a/orekit-9.1/target/classes/META-INF/NOTICE.txt +++ /dev/null @@ -1,44 +0,0 @@ -OREKIT -Copyright 2002-2017 CS Systèmes d'Information - -This product includes software developed by -CS Systèmes d'Information (http://www.c-s.fr/) - -This product includes software developed by -Bruce R. Bowman (HQ AFSPC, Space Analysis Division) - -This product includes software translated from original work developed by -David A. Vallado, Paul Crawford, Richard Hujsak, T.S. Kelso - -This product includes software translated from original work developed by -Felix R. Hoots, Ronald L. Roehrich - -This product includes software translated from original work developed by -R. Biancale, S. Bruinsma (CNES) - -This product includes data computed by -P. Gégout (CNRS / UMR5563 - GET) - -This product includes software translated from original work developed by -R. Biancale, S. Bruinsma (CNES) - -This product includes software translated from original work developed by -Mickaël Gastineau (CNRS - Observatoire de Paris - IMCCE) - -This product includes software translated from original work developed by -The Apache Software Foundation (http://www.apache.org/) - -This product depends on software developed by -The Apache Software Foundation (http://www.apache.org/) - -This product depends on software developed by -The Hipparchus project (https://hipparchus.org/) - -This product includes software translated from original work developed by -M. Picone, A.E. Hedin, D. Drob (Naval Research Laboratory) - -This product includes software translated from original work developed by -Dominik Brodowski - -This product includes software translated from original work developed by - Duncan Agnew and copyright 2008 IERS Conventions center From d06a6f87f8ddbca2a03e9ffa7161bed0e24c7aac Mon Sep 17 00:00:00 2001 From: Rowan Skewes Date: Thu, 16 Aug 2018 07:46:15 +1000 Subject: [PATCH 4/4] Lower initial angular velocity, use different inertia matrix --- .../src/main/java/msp/simulator/Main.java | 4 +++- .../torques/MemCachedTorqueProvider.java | 2 +- .../satellite/assembly/SatelliteBody.java | 23 ++++++++++++------- .../java/msp/simulator/user/Dashboard.java | 6 ++--- 4 files changed, 22 insertions(+), 13 deletions(-) diff --git a/simulator/src/main/java/msp/simulator/Main.java b/simulator/src/main/java/msp/simulator/Main.java index 3d2073f1..f19fbab5 100644 --- a/simulator/src/main/java/msp/simulator/Main.java +++ b/simulator/src/main/java/msp/simulator/Main.java @@ -44,10 +44,12 @@ public static void main(String[] args) { Dashboard.setStepDelay(0.1); Dashboard.setInitialAttitudeQuaternion(new Quaternion(1, 0, 0, 0)); - Dashboard.setInitialSpin(new Vector3D(0.5, 0.5, 0.5)); + Dashboard.setInitialSpin(new Vector3D(0.05, 0.05, 0.05)); Dashboard.setInitialRotAcceleration(new Vector3D(0,0,0)); Dashboard.setTorqueDisturbances(false); //Dashboard.setSatelliteInertiaMatrix(SatelliteBody.satInertiaMatrix); + Dashboard.setSatelliteInertiaMatrix(SatelliteBody.ACRUX1InertiaMatrix); + //Dashboard.setSatelliteInertiaMatrix(SatelliteBody.simpleBalancedInertiaMatrix); Dashboard.setCommandTorqueProvider(TorqueProviderEnum.MEMCACHED); Dashboard.setMemCachedConnection(true, "127.0.0.1:11211"); diff --git a/simulator/src/main/java/msp/simulator/dynamic/torques/MemCachedTorqueProvider.java b/simulator/src/main/java/msp/simulator/dynamic/torques/MemCachedTorqueProvider.java index c7a616b8..a58dc469 100644 --- a/simulator/src/main/java/msp/simulator/dynamic/torques/MemCachedTorqueProvider.java +++ b/simulator/src/main/java/msp/simulator/dynamic/torques/MemCachedTorqueProvider.java @@ -170,7 +170,7 @@ public Vector3D getTorque(AbsoluteDate date) { } /* Debug Information */ - logger.debug("Torque Provider (Acquisition): " + date.toString() +" - " + + logger.info("Torque Provider (Acquisition): " + date.toString() +" - " + this.stepTorque.toString()); } else { diff --git a/simulator/src/main/java/msp/simulator/satellite/assembly/SatelliteBody.java b/simulator/src/main/java/msp/simulator/satellite/assembly/SatelliteBody.java index 01995149..9b9e7a19 100644 --- a/simulator/src/main/java/msp/simulator/satellite/assembly/SatelliteBody.java +++ b/simulator/src/main/java/msp/simulator/satellite/assembly/SatelliteBody.java @@ -40,19 +40,26 @@ public class SatelliteBody extends BoxAndSolarArraySpacecraft { /** Mass of the satellite in kilogram. */ public static final double satelliteMass = 1.04; - /* TODO(rskew) update inertia matrix. */ - /** Inertia matrix of the satellite. */ - public static final double[][] satInertiaMatrix = /* kg.m^2 */ { + /** Default inertia matrix, set by the Dashboard. */ + public static double[][] satInertiaMatrix = /* kg.m^2 */ { {1191.648 * 1.3e-6, 0 , 0 }, { 0 , 1169.506 * 1.3e-6, 0 }, { 0 , 0 , 1203.969 * 1.3e-6 }, }; + /* TODO(rskew) update inertia matrix. */ + /** Inertia matrix of ACRUX1. */ + public static final double[][] ACRUX1InertiaMatrix = /* kg.m^2 */ { + {1191.648 * 1.3e-6, 0 , 0 }, + { 0 , 1169.506 * 1.3e-6, 0 }, + { 0 , 0 , 1203.969 * 1.3e-6 }, + }; + /** Simple balance inertia matrix (Unit matrix). */ public static final double[][] simpleBalancedInertiaMatrix = { - { 1, 0, 0 }, - { 0, 1, 0 }, - { 0, 0, 1 } + { 1e-3, 0 , 0 }, + { 0 , 1e-3, 0 }, + { 0 , 0 , 1e-3 } }; /* **************************************** */ @@ -101,8 +108,8 @@ public SatelliteBody(Environment environment) { /* Copy the user value into a protected variable. */ this.satBoxSize = SatelliteBody.satBoxSizeWithNoSolarPanel; this.satMass = SatelliteBody.satelliteMass; - //this.inertiaMatrix = SatelliteBody.satInertiaMatrix; - this.inertiaMatrix = SatelliteBody.simpleBalancedInertiaMatrix; + this.inertiaMatrix = SatelliteBody.satInertiaMatrix; + //this.inertiaMatrix = SatelliteBody.simpleBalancedInertiaMatrix; SatelliteBody.logger.info(CustomLoggingTools.indentMsg(SatelliteBody.logger, " -> Building the CubeSat body: Success.")); diff --git a/simulator/src/main/java/msp/simulator/user/Dashboard.java b/simulator/src/main/java/msp/simulator/user/Dashboard.java index 39468fdf..06941e72 100644 --- a/simulator/src/main/java/msp/simulator/user/Dashboard.java +++ b/simulator/src/main/java/msp/simulator/user/Dashboard.java @@ -314,9 +314,9 @@ public static void setTorqueDisturbances(boolean flag) { * Set the user-specified inertia matrix of the satellite. * @param iMatrix Inertia Matrix to be set */ - //public static void setSatelliteInertiaMatrix(double[][] iMatrix) { - // SatelliteBody.satInertiaMatrix = iMatrix; - //} + public static void setSatelliteInertiaMatrix(double[][] iMatrix) { + SatelliteBody.satInertiaMatrix = iMatrix; + } /** * Set the file path of the output ephemeris.