diff --git a/data/scanners_tls.xml b/data/scanners_tls.xml
index 36c73de..ee004fd 100644
--- a/data/scanners_tls.xml
+++ b/data/scanners_tls.xml
@@ -1,183 +1,183 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- rotAxis_x="0"
- rotAxis_y="0"
- rotAxis_z="1"/>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ rotAxis_x="0"
+ rotAxis_y="0"
+ rotAxis_z="1"/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/data/scenes/test/barrier.xml b/data/scenes/test/barrier.xml
new file mode 100644
index 0000000..15636c4
--- /dev/null
+++ b/data/scenes/test/barrier.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/data/scenes/test/ground.xml b/data/scenes/test/ground.xml
new file mode 100644
index 0000000..c94fcb6
--- /dev/null
+++ b/data/scenes/test/ground.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/data/surveys/test/als_50II.xml b/data/surveys/test/als_50II.xml
new file mode 100644
index 0000000..f26ff76
--- /dev/null
+++ b/data/surveys/test/als_50II.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/data/surveys/test/als_q780.xml b/data/surveys/test/als_q780.xml
new file mode 100644
index 0000000..9413263
--- /dev/null
+++ b/data/surveys/test/als_q780.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/data/surveys/test/tls_vz1000.xml b/data/surveys/test/tls_vz1000.xml
new file mode 100644
index 0000000..a8b567d
--- /dev/null
+++ b/data/surveys/test/tls_vz1000.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/data/surveys/test/tls_vz400.xml b/data/surveys/test/tls_vz400.xml
new file mode 100644
index 0000000..99e8a63
--- /dev/null
+++ b/data/surveys/test/tls_vz400.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/java/de/uni_hd/giscience/helios/core/scanner/beamDeflector/AbstractBeamDeflector.java b/src/main/java/de/uni_hd/giscience/helios/core/scanner/beamDeflector/AbstractBeamDeflector.java
index b327bd9..d340953 100644
--- a/src/main/java/de/uni_hd/giscience/helios/core/scanner/beamDeflector/AbstractBeamDeflector.java
+++ b/src/main/java/de/uni_hd/giscience/helios/core/scanner/beamDeflector/AbstractBeamDeflector.java
@@ -10,17 +10,17 @@ public abstract class AbstractBeamDeflector {
// Device definition variables:
double cfg_device_scanFreqMax_Hz = 0;
double cfg_device_scanFreqMin_Hz = 0;
- double cfg_device_scanAngleRangeMax_rad = 0;
+ double cfg_device_scanAngleMax_rad = 0;
// Setting variables:
double cfg_setting_scanFreq_Hz = 0;
- double cfg_setting_scanAngleRange_rad = 0;
+ double cfg_setting_scanAngle_rad = 0;
// Stat variables:
double state_currentBeamAngle_rad = 0;
- public AbstractBeamDeflector(double scanAngleRangeMax_rad, double scanFreqMax_Hz, double scanFreqMin_Hz) {
- this.cfg_device_scanAngleRangeMax_rad = scanAngleRangeMax_rad;
+ public AbstractBeamDeflector(double scanAngleMax_rad, double scanFreqMax_Hz, double scanFreqMin_Hz) {
+ this.cfg_device_scanAngleMax_rad = scanAngleMax_rad;
this.cfg_device_scanFreqMax_Hz = scanFreqMax_Hz;
this.cfg_device_scanFreqMin_Hz = scanFreqMin_Hz;
@@ -40,8 +40,7 @@ public void applySettings(ScannerSettings settings) {
setScanFreq_Hz(settings.scanFreq_Hz);
state_currentBeamAngle_rad = 0;
- cached_angleBetweenPulses_rad = (double) (this.cfg_setting_scanFreq_Hz * this.cfg_setting_scanAngleRange_rad * 2) / settings.pulseFreq_Hz;
- System.out.println("Vertical resolution: " + (float) (this.cached_angleBetweenPulses_rad * 180 / Math.PI));
+ cached_angleBetweenPulses_rad = (double) (this.cfg_setting_scanFreq_Hz * this.cfg_setting_scanAngle_rad * 2) / settings.pulseFreq_Hz;
}
public Rotation getEmitterRelativeAttitude() {
@@ -55,12 +54,12 @@ public void setScanAngle_rad(double scanAngle_rad) {
if (scanAngle_rad < 0) {
scanAngle_rad = 0;
- } else if (scanAngle_rad > this.cfg_device_scanAngleRangeMax_rad) {
- System.out.println("Scan angle " + scanAngle_rad * (180.0 / Math.PI) + " higher than supported " + this.cfg_device_scanAngleRangeMax_rad * (180.0 / Math.PI) + ". Setting to max supported: " + this.cfg_device_scanAngleRangeMax_rad * (180.0 / Math.PI) );
- scanAngle_rad = this.cfg_device_scanAngleRangeMax_rad;
+ } else if (scanAngle_rad > this.cfg_device_scanAngleMax_rad) {
+ System.out.println("Scan angle " + scanAngle_rad * (180.0 / Math.PI) + " higher than supported " + this.cfg_device_scanAngleMax_rad * (180.0 / Math.PI) + ". Setting to max supported: " + this.cfg_device_scanAngleMax_rad * (180.0 / Math.PI) );
+ scanAngle_rad = this.cfg_device_scanAngleMax_rad;
}
- this.cfg_setting_scanAngleRange_rad = scanAngle_rad;
+ this.cfg_setting_scanAngle_rad = scanAngle_rad;
}
public boolean lastPulseLeftDevice() {
diff --git a/src/main/java/de/uni_hd/giscience/helios/core/scanner/beamDeflector/ConicBeamDeflector.java b/src/main/java/de/uni_hd/giscience/helios/core/scanner/beamDeflector/ConicBeamDeflector.java
index f046e4e..503d20e 100644
--- a/src/main/java/de/uni_hd/giscience/helios/core/scanner/beamDeflector/ConicBeamDeflector.java
+++ b/src/main/java/de/uni_hd/giscience/helios/core/scanner/beamDeflector/ConicBeamDeflector.java
@@ -1,48 +1,48 @@
-package de.uni_hd.giscience.helios.core.scanner.beamDeflector;
-
-import org.apache.commons.math3.geometry.euclidean.threed.Rotation;
-import org.apache.commons.math3.geometry.euclidean.threed.Vector3D;
-
-import de.uni_hd.giscience.helios.Directions;
-import de.uni_hd.giscience.helios.core.scanner.ScannerSettings;
-
-public class ConicBeamDeflector extends AbstractBeamDeflector {
-
- public ConicBeamDeflector(double scanAngleMax_rad, double scanFreqMax_Hz, double scanFreqMin_Hz) {
- super(scanAngleMax_rad, scanFreqMax_Hz, scanFreqMin_Hz);
- // TODO Auto-generated constructor stub
- }
-
-
- // r1 is the rotation that creates the radius of the cone
- Rotation r1 = null;
-
- @Override
- public void applySettings(ScannerSettings settings) {
-
- super.applySettings(settings);
-
- cached_angleBetweenPulses_rad = (double) (this.cfg_device_scanFreqMax_Hz * Math.PI * 2) / settings.pulseFreq_Hz;
-
- r1 = new Rotation(new Vector3D(1, 0, 0), this.cfg_setting_scanAngleRange_rad);
- }
-
-
- @Override
- public void doSimStep() {
-
- // ####### BEGIN Update mirror angle ########
- state_currentBeamAngle_rad += cached_angleBetweenPulses_rad;
-
- if (state_currentBeamAngle_rad >= Math.PI * 2) {
- state_currentBeamAngle_rad = state_currentBeamAngle_rad % (Math.PI * 2);
- }
- // ####### END Update mirror angle ########
-
- // Rotate to current position on the cone circle:
- Rotation r2 = new Rotation(Directions.forward, state_currentBeamAngle_rad);
-
- this.cached_emitterRelativeAttitude = r2.applyTo(r1);
- }
-
+package de.uni_hd.giscience.helios.core.scanner.beamDeflector;
+
+import org.apache.commons.math3.geometry.euclidean.threed.Rotation;
+import org.apache.commons.math3.geometry.euclidean.threed.Vector3D;
+
+import de.uni_hd.giscience.helios.Directions;
+import de.uni_hd.giscience.helios.core.scanner.ScannerSettings;
+
+public class ConicBeamDeflector extends AbstractBeamDeflector {
+
+ public ConicBeamDeflector(double scanAngleMax_rad, double scanFreqMax_Hz, double scanFreqMin_Hz) {
+ super(scanAngleMax_rad, scanFreqMax_Hz, scanFreqMin_Hz);
+ // TODO Auto-generated constructor stub
+ }
+
+
+ // r1 is the rotation that creates the radius of the cone
+ Rotation r1 = null;
+
+ @Override
+ public void applySettings(ScannerSettings settings) {
+
+ super.applySettings(settings);
+
+ cached_angleBetweenPulses_rad = (double) (this.cfg_device_scanFreqMax_Hz * Math.PI * 2) / settings.pulseFreq_Hz;
+
+ r1 = new Rotation(new Vector3D(1, 0, 0), this.cfg_setting_scanAngle_rad);
+ }
+
+
+ @Override
+ public void doSimStep() {
+
+ // ####### BEGIN Update mirror angle ########
+ state_currentBeamAngle_rad += cached_angleBetweenPulses_rad;
+
+ if (state_currentBeamAngle_rad >= Math.PI * 2) {
+ state_currentBeamAngle_rad = state_currentBeamAngle_rad % (Math.PI * 2);
+ }
+ // ####### END Update mirror angle ########
+
+ // Rotate to current position on the cone circle:
+ Rotation r2 = new Rotation(Directions.forward, state_currentBeamAngle_rad);
+
+ this.cached_emitterRelativeAttitude = r2.applyTo(r1);
+ }
+
}
\ No newline at end of file
diff --git a/src/main/java/de/uni_hd/giscience/helios/core/scanner/beamDeflector/FiberArrayBeamDeflector.java b/src/main/java/de/uni_hd/giscience/helios/core/scanner/beamDeflector/FiberArrayBeamDeflector.java
index c21c92e..0f8c7c4 100644
--- a/src/main/java/de/uni_hd/giscience/helios/core/scanner/beamDeflector/FiberArrayBeamDeflector.java
+++ b/src/main/java/de/uni_hd/giscience/helios/core/scanner/beamDeflector/FiberArrayBeamDeflector.java
@@ -1,49 +1,50 @@
-package de.uni_hd.giscience.helios.core.scanner.beamDeflector;
-
-import org.apache.commons.math3.geometry.euclidean.threed.Rotation;
-
-import de.uni_hd.giscience.helios.Directions;
-import de.uni_hd.giscience.helios.core.scanner.ScannerSettings;
-
-public class FiberArrayBeamDeflector extends AbstractBeamDeflector {
-
- int cfg_device_numFibers = 32;
- int state_currentFiber = 0;
-
-
- public FiberArrayBeamDeflector(double scanAngleMax_rad, double scanFreqMax_Hz, double scanFreqMin_Hz, int numFibers) {
-
- super(scanAngleMax_rad, scanFreqMax_Hz, scanFreqMin_Hz);
-
- cfg_device_numFibers = numFibers;
- }
-
- @Override
- public void applySettings(ScannerSettings settings) {
- super.applySettings(settings);
-
- state_currentBeamAngle_rad = -this.cfg_setting_scanAngleRange_rad;
- setNumFibers(cfg_device_numFibers);
- }
-
-
- public void setNumFibers(int numFibers) {
- this.cfg_device_numFibers = numFibers;
-
- cached_angleBetweenPulses_rad = (this.cfg_setting_scanAngleRange_rad * 2) / cfg_device_numFibers;
- }
-
- @Override
- public void doSimStep() {
-
- state_currentBeamAngle_rad = -this.cfg_setting_scanAngleRange_rad + cached_angleBetweenPulses_rad * state_currentFiber;
-
- state_currentFiber++;
- if (state_currentFiber >= cfg_device_numFibers) {
- state_currentFiber = 0;
- }
-
- // Compute relative beam direction:
- this.cached_emitterRelativeAttitude = new Rotation(Directions.right, state_currentBeamAngle_rad);
- }
-}
+package de.uni_hd.giscience.helios.core.scanner.beamDeflector;
+
+import org.apache.commons.math3.geometry.euclidean.threed.Rotation;
+
+import de.uni_hd.giscience.helios.Directions;
+import de.uni_hd.giscience.helios.core.scanner.ScannerSettings;
+
+public class FiberArrayBeamDeflector extends AbstractBeamDeflector {
+
+ int cfg_device_numFibers = 32;
+ int state_currentFiber = 0;
+
+
+ public FiberArrayBeamDeflector(double scanAngleMax_rad, double scanFreqMax_Hz, double scanFreqMin_Hz, int numFibers) {
+
+ super(scanAngleMax_rad, scanFreqMax_Hz, scanFreqMin_Hz);
+
+ cfg_device_numFibers = numFibers;
+ }
+
+ @Override
+ public void applySettings(ScannerSettings settings) {
+ super.applySettings(settings);
+
+ state_currentBeamAngle_rad = -this.cfg_setting_scanAngle_rad;
+ setNumFibers(cfg_device_numFibers);
+ }
+
+
+ public void setNumFibers(int numFibers) {
+ this.cfg_device_numFibers = numFibers;
+
+ cached_angleBetweenPulses_rad = (this.cfg_setting_scanAngle_rad * 2) / cfg_device_numFibers;
+ System.out.println("Vertical resolution: " + (float) (this.cached_angleBetweenPulses_rad * 180 / Math.PI));
+ }
+
+ @Override
+ public void doSimStep() {
+
+ state_currentBeamAngle_rad = -this.cfg_setting_scanAngle_rad + cached_angleBetweenPulses_rad * state_currentFiber;
+
+ state_currentFiber++;
+ if (state_currentFiber >= cfg_device_numFibers) {
+ state_currentFiber = 0;
+ }
+
+ // Compute relative beam direction:
+ this.cached_emitterRelativeAttitude = new Rotation(Directions.right, state_currentBeamAngle_rad);
+ }
+}
diff --git a/src/main/java/de/uni_hd/giscience/helios/core/scanner/beamDeflector/OscillatingMirrorBeamDeflector.java b/src/main/java/de/uni_hd/giscience/helios/core/scanner/beamDeflector/OscillatingMirrorBeamDeflector.java
index fcd7e67..9211f5a 100644
--- a/src/main/java/de/uni_hd/giscience/helios/core/scanner/beamDeflector/OscillatingMirrorBeamDeflector.java
+++ b/src/main/java/de/uni_hd/giscience/helios/core/scanner/beamDeflector/OscillatingMirrorBeamDeflector.java
@@ -1,78 +1,79 @@
-package de.uni_hd.giscience.helios.core.scanner.beamDeflector;
-
-import org.apache.commons.math3.geometry.euclidean.threed.Rotation;
-
-import de.uni_hd.giscience.helios.Directions;
-import de.uni_hd.giscience.helios.core.scanner.ScannerSettings;
-
-public class OscillatingMirrorBeamDeflector extends AbstractBeamDeflector {
-
- public OscillatingMirrorBeamDeflector(double scanAngleMax_rad, double scanFreqMax_Hz, double scanFreqMin_Hz, int scanProduct) {
- super(scanAngleMax_rad, scanFreqMax_Hz, scanFreqMin_Hz);
-
- this.cfg_device_scanProduct = scanProduct;
- }
-
- int cfg_device_scanProduct = 1000000;
-
- int currentScanLinePulse = 0;
-
- int cached_pulsesPerScanline = 0;
-
- @Override
- public void applySettings(ScannerSettings settings) {
- super.applySettings(settings);
-
- cached_angleBetweenPulses_rad = (double) (this.cfg_setting_scanFreq_Hz * this.cfg_setting_scanAngleRange_rad * 4) / settings.pulseFreq_Hz;
- cached_pulsesPerScanline = (int) (((double) settings.pulseFreq_Hz) / this.cfg_setting_scanFreq_Hz);
- }
-
-
- @Override
- public void doSimStep() {
-
- currentScanLinePulse++;
-
- if (currentScanLinePulse == cached_pulsesPerScanline) {
- currentScanLinePulse = 0;
- }
-
- // Update beam angle:
- int bla = Math.min(currentScanLinePulse, cached_pulsesPerScanline / 2) - Math.max(0, currentScanLinePulse - cached_pulsesPerScanline / 2);
-
- state_currentBeamAngle_rad = -this.cfg_setting_scanAngleRange_rad + cached_angleBetweenPulses_rad * bla;
-
- // Rotate to current position:
- this.cached_emitterRelativeAttitude = new Rotation(Directions.right, state_currentBeamAngle_rad);
- }
-
- @Override
- public void setScanAngle_rad(double scanAngle_rad) {
-
- double scanAngle_deg = scanAngle_rad * (180.0 / Math.PI);
-
- // Max. scan angle is limited by scan product:
- if (scanAngle_deg * this.cfg_setting_scanFreq_Hz > this.cfg_device_scanProduct) {
- System.out.println("ERROR: Requested scan angle exceeds device limitations as defined by scan product. Will set it to maximal possible value.");
- scanAngle_deg = ((double) this.cfg_device_scanProduct) / this.cfg_setting_scanFreq_Hz;
- }
-
- this.cfg_setting_scanAngleRange_rad = scanAngle_deg * (Math.PI / 180);
-
- System.out.println("Scan angle set to " + scanAngle_deg + " degrees.");
- }
-
- @Override
- public void setScanFreq_Hz(double scanFreq_Hz) {
-
- // Max. scan frequency is limited by scan product:
- if (this.cfg_setting_scanAngleRange_rad * (180.0 / Math.PI) * scanFreq_Hz > this.cfg_device_scanProduct) {
- System.out.println("ERROR: Requested scan frequency exceeds device limitations as defined by scan product. Will set it to maximal possible value.");
- scanFreq_Hz = ((double) this.cfg_device_scanProduct) / (this.cfg_setting_scanAngleRange_rad * (180.0 / Math.PI));
- }
-
- this.cfg_setting_scanFreq_Hz = scanFreq_Hz;
-
- System.out.println("Scan frequency set to " + this.cfg_setting_scanFreq_Hz + " Hz.");
- }
-}
+package de.uni_hd.giscience.helios.core.scanner.beamDeflector;
+
+import org.apache.commons.math3.geometry.euclidean.threed.Rotation;
+
+import de.uni_hd.giscience.helios.Directions;
+import de.uni_hd.giscience.helios.core.scanner.ScannerSettings;
+
+public class OscillatingMirrorBeamDeflector extends AbstractBeamDeflector {
+
+ public OscillatingMirrorBeamDeflector(double scanAngleMax_rad, double scanFreqMax_Hz, double scanFreqMin_Hz, int scanProduct) {
+ super(scanAngleMax_rad, scanFreqMax_Hz, scanFreqMin_Hz);
+
+ this.cfg_device_scanProduct = scanProduct;
+ }
+
+ int cfg_device_scanProduct = 1000000;
+
+ int currentScanLinePulse = 0;
+
+ int cached_pulsesPerScanline = 0;
+
+ @Override
+ public void applySettings(ScannerSettings settings) {
+ super.applySettings(settings);
+
+ cached_angleBetweenPulses_rad = (double) (this.cfg_setting_scanFreq_Hz * this.cfg_setting_scanAngle_rad * 4) / settings.pulseFreq_Hz;
+ cached_pulsesPerScanline = (int) (((double) settings.pulseFreq_Hz) / this.cfg_setting_scanFreq_Hz);
+ System.out.println("Vertical resolution: " + (float) (this.cached_angleBetweenPulses_rad * 180 / Math.PI));
+ }
+
+
+ @Override
+ public void doSimStep() {
+
+ currentScanLinePulse++;
+
+ if (currentScanLinePulse == cached_pulsesPerScanline) {
+ currentScanLinePulse = 0;
+ }
+
+ // Update beam angle:
+ int bla = Math.min(currentScanLinePulse, cached_pulsesPerScanline / 2) - Math.max(0, currentScanLinePulse - cached_pulsesPerScanline / 2);
+
+ state_currentBeamAngle_rad = -this.cfg_setting_scanAngle_rad + cached_angleBetweenPulses_rad * bla;
+
+ // Rotate to current position:
+ this.cached_emitterRelativeAttitude = new Rotation(Directions.right, state_currentBeamAngle_rad);
+ }
+
+ @Override
+ public void setScanAngle_rad(double scanAngle_rad) {
+
+ double scanAngle_deg = scanAngle_rad * (180.0 / Math.PI);
+
+ // Max. scan angle is limited by scan product:
+ if (scanAngle_deg * this.cfg_setting_scanFreq_Hz > this.cfg_device_scanProduct) {
+ System.out.println("ERROR: Requested scan angle exceeds device limitations as defined by scan product. Will set it to maximal possible value.");
+ scanAngle_deg = ((double) this.cfg_device_scanProduct) / this.cfg_setting_scanFreq_Hz;
+ }
+
+ this.cfg_setting_scanAngle_rad = scanAngle_deg * (Math.PI / 180);
+
+ System.out.println("Scan angle set to " + scanAngle_deg + " degrees.");
+ }
+
+ @Override
+ public void setScanFreq_Hz(double scanFreq_Hz) {
+
+ // Max. scan frequency is limited by scan product:
+ if (this.cfg_setting_scanAngle_rad * (180.0 / Math.PI) * scanFreq_Hz > this.cfg_device_scanProduct) {
+ System.out.println("ERROR: Requested scan frequency exceeds device limitations as defined by scan product. Will set it to maximal possible value.");
+ scanFreq_Hz = ((double) this.cfg_device_scanProduct) / (this.cfg_setting_scanAngle_rad * (180.0 / Math.PI));
+ }
+
+ this.cfg_setting_scanFreq_Hz = scanFreq_Hz;
+
+ System.out.println("Scan frequency set to " + this.cfg_setting_scanFreq_Hz + " Hz.");
+ }
+}
diff --git a/src/main/java/de/uni_hd/giscience/helios/core/scanner/beamDeflector/PolygonMirrorBeamDeflector.java b/src/main/java/de/uni_hd/giscience/helios/core/scanner/beamDeflector/PolygonMirrorBeamDeflector.java
index 4ebed4f..9738f01 100644
--- a/src/main/java/de/uni_hd/giscience/helios/core/scanner/beamDeflector/PolygonMirrorBeamDeflector.java
+++ b/src/main/java/de/uni_hd/giscience/helios/core/scanner/beamDeflector/PolygonMirrorBeamDeflector.java
@@ -29,37 +29,38 @@ public PolygonMirrorBeamDeflector(
}
// Set the vertical scan angle settings within the scanner specifications
- protected void setScanAngleMinMax_rad(double scanAngleMin_rad, double scanAngleMax_rad) {
+ protected void setScanAngleMinMax_rad(ScannerSettings settings) {
- if(scanAngleMin_rad == scanAngleMax_rad) { // Not set
- scanAngleMin_rad = cfg_device_scanAngleMin_rad;
- scanAngleMax_rad = cfg_device_scanAngleMax_rad;
+ if(Math.abs(settings.verticalAngleMin_rad - settings.verticalAngleMax_rad) < 0.01) { // Not set
+ settings.verticalAngleMin_rad = -settings.scanAngle_rad;
+ settings.verticalAngleMax_rad = settings.scanAngle_rad;
}
- else {
- if (scanAngleMin_rad < cfg_device_scanAngleMin_rad) {
- scanAngleMin_rad = cfg_device_scanAngleMin_rad;
- System.out.println("Warning: Min vertical FOV has been modified to fit the scanner specifications.");
- }
-
- if (scanAngleMax_rad > cfg_device_scanAngleMax_rad) {
- scanAngleMax_rad = cfg_device_scanAngleMin_rad;
- System.out.println("Warning: Max vertical FOV has been modified to fit the scanner specifications.");
- }
- }
+ else {
+ settings.scanAngle_rad = (settings.verticalAngleMax_rad - settings.verticalAngleMin_rad) / 2.0;
+ }
+
+ if (settings.verticalAngleMin_rad < cfg_device_scanAngleMin_rad) {
+ System.out.println("Error: Min vertical angle smaller than the supported by the scanner.");
+ System.exit(-1);
+ }
+ if (settings.verticalAngleMax_rad > cfg_device_scanAngleMax_rad) {
+ System.out.println("Error: Max vertical angle larger than the supported by the scanner.");
+ System.exit(-1);
+ }
- cfg_device_scanAngleMin_rad = scanAngleMin_rad;
- cfg_device_scanAngleMax_rad = scanAngleMax_rad;
- super.cfg_device_scanAngleRangeMax_rad = (cfg_device_scanAngleMax_rad - cfg_device_scanAngleMin_rad) / 2;
+ cfg_device_scanAngleMin_rad = settings.verticalAngleMin_rad;
+ cfg_device_scanAngleMax_rad = settings.verticalAngleMax_rad;
}
@Override
public void applySettings(ScannerSettings settings) {
- setScanAngleMinMax_rad(settings.verticalAngleMin_rad, settings.verticalAngleMax_rad);
+ setScanAngleMinMax_rad(settings);
super.applySettings(settings);
super.state_currentBeamAngle_rad = cfg_device_scanAngleMin_rad;
+ System.out.println("Vertical resolution: " + (float) (cached_angleBetweenPulses_rad * 180 / Math.PI));
System.out.println("Vertical angle settings: " +
- "Total Range: " + super.cfg_setting_scanAngleRange_rad * (180.0 / Math.PI) * 2 + "º " +
+ "FOV: " + super.cfg_setting_scanAngle_rad * (180.0 / Math.PI) * 2 + "º " +
"Min: " + cfg_device_scanAngleMin_rad * (180.0 / Math.PI) + "º " +
"Max: " + cfg_device_scanAngleMax_rad * (180.0 / Math.PI) + "º ");
}
@@ -70,7 +71,7 @@ public void doSimStep() {
// Update beam angle:
super.state_currentBeamAngle_rad += super.cached_angleBetweenPulses_rad;
- if (super.state_currentBeamAngle_rad >= cfg_device_scanAngleRangeMax_rad) {
+ if (super.state_currentBeamAngle_rad >= cfg_device_scanAngleMax_rad) {
super.state_currentBeamAngle_rad = cfg_device_scanAngleMin_rad;
}