Notebook: Lukas Winiwarter, 2023
In this demo, we present how an existing or external trajectory can be used to model platform location and attitude in a HELIOS++ simulation.
import sys, os
from pathlib import Path
from IPython.display import Code
current_folder = globals()["_dh"][0]
helios_path = str(Path(current_folder).parent)
sys.path.append(helios_path) # add helios-plusplus directory to PATH
import pyhelios
from pyhelios.util.xmldisplayer import display_xml, find_playback_dir
In this example, we simulate an airborne laser scanner acquisition flying inside of a box of 100 m side length. This allows us to see the full point pattern. We set the platform
to interpolated
, and define a trajectory file in the <platformSettings >
tag. This is provided by a filename and a column order. By setting syncGPSTime
, we ensure that the output point cloud is in the same time system as the input trajectory.
os.chdir(helios_path)
Code(display_xml('data/surveys/demo/box_survey_interp.xml'))
<document>
<scannerSettings id="scaset" active="true" pulseFreq_hz="180000" scanFreq_hz="100" />
<survey name="box_interpolation" scene="data/scenes/demo/box_scene.xml#box_scene" platform="interpolated" basePlatform="data\platforms.xml#sr22" scanner="data/scanners_als.xml#riegl_lms-q560">
<leg>
<platformSettings trajectory="data/trajectories/flyandrotate.trj" tIndex="0" xIndex="4" yIndex="5" zIndex="6" rollIndex="1" pitchIndex="2" yawIndex="3" slopeFilterThreshold="0.0" toRadians="true" syncGPSTime="true" tStart="0" tEnd="5" teleportToStart="true" />
<scannerSettings template="scaset" trajectoryTimeInterval_s="0.01" />
</leg>
<leg>
<platformSettings trajectory="data/trajectories/flyandrotate.trj" tStart="5" tEnd="10" teleportToStart="true" />
<scannerSettings template="scaset" trajectoryTimeInterval_s="0.01" />
</leg>
</survey>
</document>
The contents of the trajectory file are simple: For the first 2.5 seconds, we move from (0, -40, 0)
to (0, 0, 0)
, with a constant attitude of (0,0,0)
(roll, pitch, yaw). In the next 2.5 seconds, we continue to move to (0, 40, 0)
, but rotate (roll) until we have an attitude of (90, 0, 0)
. HELIOS++ linearly interpolates between these values.
The second half of the file show a movement from (-40, 0, 0)
to (40, 0, 0)
. Note how, for the interpolated
platform, the yaw
angle has to be set explicitely, in this case to 90
degrees (i.e., due east). Apart from these changes, the
Code(open('data/trajectories/flyandrotate.trj').read())
#TIME_COLUMN: 0
#HEADER: "t", "roll", "pitch", "yaw", "x", "y", "z"
0, 0, 0, 0, 0, -40, 0
2.5, 0, 0, 0, 0, 0, 0
5, 90, 0, 0, 0, 40, 0
5, 0, 0, 90, -40, 0, 0
7.5, 0, 0, 90, 0, 0, 0
10, 90, 0, 90, 40, 0, 0
!"run/helios" data/surveys/demo/box_survey_interp.xml
HELIOS++ VERSION 1.2.0 CWD: "H:\helios4pyhelios\helios" seed: AUTO surveyPath: "data/surveys/demo/box_survey_interp.xml" assetsPath: "assets/" outputPath: "output/" writeWaveform: 0 calcEchowidth: 0 fullWaveNoise: 0 splitByChannel: 0 parallelization: 1 njobs: 0 chunkSize: 32 warehouseFactor: 4 platformNoiseDisabled: 0 legNoiseDisabled: 0 rebuildScene: 0 lasOutput: 0 las10: 0 fixedIncidenceAngle: 0 gpsStartTime: kdtType: 4 kdtJobs: 0 kdtGeomJobs: 0 sahLossNodes: 32 xmlDocFilename: box_survey_interp.xml xmlDocFilePath: data/surveys/demo xmlDocFilename: scanners_als.xml xmlDocFilePath: data Using default value for attribute 'averagePower_w' : 4 Using default value for attribute 'beamQualityFactor' : 1 Using default value for attribute 'opticalEfficiency' : 0.99 Using default value for attribute 'receiverDiameter_m' : 0.15 Using default value for attribute 'atmosphericVisibility_km' : 23 Using default value for attribute 'wavelength_nm' : 1064 Scanner: riegl_lms-q560 Device[0]: riegl_lms-q560 Average Power: 4 W Beam Divergence: 0.5 mrad Wavelength: 1064 nm Visibility: 23 km Using default value for attribute 'maxNOR' : 0 Using default value for attribute 'rangeMax_m' : 1.79769e+308 Using default value for attribute 'headRotatePerSecMax_deg' : 0 Number of subsampling rays (riegl_lms-q560): 19 Using default value for attribute 'trajectory_separator' : , Using default value for attribute 'trajectory_separator' : , xmlDocFilename: platforms.xml xmlDocFilePath: data Using default value for attribute 'y' : 0 Using default value for attribute 'x' : 0 Number of subsampling rays (riegl_lms-q560): 19 Using default value for attribute 'numRuns' : 1 Using default value for attribute 'simSpeed' : 1 Using default value for attribute 'stripId' : NULL_STRIP_ID Using platform default value for attribute 'x' : 0 Using platform default value for attribute 'y' : 0 Using platform default value for attribute 'z' : 0 Using platform default value for attribute 'onGround' : 0 Using platform default value for attribute 'stopAndTurn' : 1 Using platform default value for attribute 'smoothTurn' : 0 Using platform default value for attribute 'slowdownEnabled' : 1 Using platform default value for attribute 'movePerSec_m' : 70 Using scanner default value for attribute 'beamDivergence_rad' : 0.003 Using scanner default value for attribute 'trajectoryTimeInterval_s' : 0 Using default value for attribute 'name' : Unnamed scannerSettings asset Using scanner default value for attribute 'active' : 1 Using scanner default value for attribute 'pulseFreq_hz' : 180000 Using scanner default value for attribute 'scanFreq_hz' : 100 Using scanner default value for attribute 'beamDivergence_rad' : 0.003 Using default value for attribute 'stripId' : NULL_STRIP_ID Using platform default value for attribute 'x' : 0 Using platform default value for attribute 'y' : 0 Using platform default value for attribute 'z' : 0 Using platform default value for attribute 'onGround' : 0 Using platform default value for attribute 'stopAndTurn' : 1 Using platform default value for attribute 'smoothTurn' : 0 Using platform default value for attribute 'slowdownEnabled' : 1 Using platform default value for attribute 'movePerSec_m' : 70 Using scanner default value for attribute 'active' : 1 Using scanner default value for attribute 'pulseFreq_hz' : 180000 Using scanner default value for attribute 'scanFreq_hz' : 100 Using scanner default value for attribute 'beamDivergence_rad' : 0.003 Loading Scene... Reading serial scene wrapper object from data/scenes/demo/box_scene.scene ... Building KD-Grove... KDTree (num. primitives 12) : Max. # primitives in leaf: 6 Min. # primitives in leaf: 4 Max. depth reached: 14 KDTree axis-aligned surface area: 60000 Interior nodes: 78 Leaf nodes: 79 Total tree cost: 9.03226 KDGrove stats: Number of trees: 1 Number of static trees: 1 Number of dynamic trees: 0 Statistics (min, max, total, mean, stdev): Building time: (0.0180, 0.0180, 0.0180, 0.0180, 0.0000) Tree primitives: (12, 12, 12, 12.0000, 0.0000) Max primitives in leaf: (6, 6, 6, 6.0000, 0.0000) Min primitives in leaf: (4, 4, 4, 4.0000, 0.0000) Maximum depth: (14, 14, 14, 14.0000, 0.0000) Axis-aligned surface area: (60000.0000, 60000.0000, 60000.0000, 60000.0000, 0.0000) Number of interior nodes: (78, 78, 78, 78.0000, 0.0000) Number of leaf nodes: (79, 79, 79, 79.0000, 0.0000) Tree cost: (9.0323, 9.0323, 9.0323, 9.0323, 0.0000) KDG built in 0.018s Scene loaded in 0.019s Reading Spectral Library... Using default value for attribute 'seed' : AUTO Output directory: "output/\box_interpolation\2023-02-27_09-21-28\" Simulation: Scanner changed! Starting leg 0 Pulse frequency set to 180000 Scan angle set to 45 Applying settings for PolygonMirrorBeamDeflector... Vertical angle min/max -nan(ind)/-nan(ind) -- verticalAngleMin not set, using the value of -22.5 degrees -- verticalAngleMax not set, using the value of 22.5 degrees Leg0 waypoints: Origin: (50, 10, 50) Target: (50, 10, 50) Next: (10, 50, 50) Running simulation... Starting leg 1 Pulse frequency set to 180000 Scan angle set to 45 Applying settings for PolygonMirrorBeamDeflector... Vertical angle min/max -nan(ind)/-nan(ind) -- verticalAngleMin not set, using the value of -22.5 degrees -- verticalAngleMax not set, using the value of 22.5 degrees Leg1 waypoints: Origin: (50, 10, 50) Target: (10, 50, 50) Next: (10, 50, 50) Clearing point cloud: "output/\box_interpolation\2023-02-27_09-21-28\leg000_points.xyz" Survey 20.20% Elapsed 00 00:00:00 Remaining 00 00:00:00 Leg2/5 1.00% Elapsed 00 00:00:00 Remaining 00 00:00:00 Survey 20.40% Elapsed 00 00:00:00 Remaining 00 00:00:00 Leg2/5 2.00% Elapsed 00 00:00:00 Remaining 00 00:00:00 Survey 20.60% Elapsed 00 00:00:00 Remaining 00 00:00:00 Leg2/5 3.00% Elapsed 00 00:00:00 Remaining 00 00:00:00 Survey 20.80% Elapsed 00 00:00:00 Remaining 00 00:00:00 Leg2/5 4.00% Elapsed 00 00:00:00 Remaining 00 00:00:02 Survey 21.00% Elapsed 00 00:00:00 Remaining 00 00:00:00 Leg2/5 5.00% Elapsed 00 00:00:00 Remaining 00 00:00:02 Survey 21.20% Elapsed 00 00:00:00 Remaining 00 00:00:00 Leg2/5 6.00% Elapsed 00 00:00:00 Remaining 00 00:00:02 Survey 21.40% Elapsed 00 00:00:00 Remaining 00 00:00:00 Leg2/5 7.00% Elapsed 00 00:00:00 Remaining 00 00:00:02 Survey 21.60% Elapsed 00 00:00:00 Remaining 00 00:00:00 Leg2/5 8.00% Elapsed 00 00:00:00 Remaining 00 00:00:02 Survey 21.80% Elapsed 00 00:00:00 Remaining 00 00:00:00 Leg2/5 9.00% Elapsed 00 00:00:00 Remaining 00 00:00:02 Survey 22.00% Elapsed 00 00:00:00 Remaining 00 00:00:00 Leg2/5 10.00% Elapsed 00 00:00:00 Remaining 00 00:00:02 Survey 22.20% Elapsed 00 00:00:00 Remaining 00 00:00:01 Leg2/5 11.00% Elapsed 00 00:00:00 Remaining 00 00:00:02 Survey 22.40% Elapsed 00 00:00:00 Remaining 00 00:00:01 Leg2/5 12.00% Elapsed 00 00:00:00 Remaining 00 00:00:02 Survey 22.60% Elapsed 00 00:00:00 Remaining 00 00:00:01 Leg2/5 13.00% Elapsed 00 00:00:00 Remaining 00 00:00:02 Survey 22.80% Elapsed 00 00:00:00 Remaining 00 00:00:01 Leg2/5 14.00% Elapsed 00 00:00:00 Remaining 00 00:00:02 Survey 23.00% Elapsed 00 00:00:00 Remaining 00 00:00:01 Leg2/5 15.00% Elapsed 00 00:00:00 Remaining 00 00:00:02 Survey 23.20% Elapsed 00 00:00:00 Remaining 00 00:00:01 Leg2/5 16.00% Elapsed 00 00:00:00 Remaining 00 00:00:02 Survey 23.40% Elapsed 00 00:00:00 Remaining 00 00:00:01 Leg2/5 17.00% Elapsed 00 00:00:00 Remaining 00 00:00:02 Survey 23.60% Elapsed 00 00:00:00 Remaining 00 00:00:01 Leg2/5 18.00% Elapsed 00 00:00:00 Remaining 00 00:00:02 Survey 23.80% Elapsed 00 00:00:00 Remaining 00 00:00:01 Leg2/5 19.00% Elapsed 00 00:00:00 Remaining 00 00:00:02 Survey 24.00% Elapsed 00 00:00:00 Remaining 00 00:00:01 Leg2/5 20.00% Elapsed 00 00:00:00 Remaining 00 00:00:02 Survey 24.20% Elapsed 00 00:00:00 Remaining 00 00:00:01 Leg2/5 21.00% Elapsed 00 00:00:00 Remaining 00 00:00:02 Survey 24.40% Elapsed 00 00:00:00 Remaining 00 00:00:02 Leg2/5 22.00% Elapsed 00 00:00:00 Remaining 00 00:00:02 Survey 24.60% Elapsed 00 00:00:00 Remaining 00 00:00:02 Leg2/5 23.00% Elapsed 00 00:00:00 Remaining 00 00:00:02 Survey 24.80% Elapsed 00 00:00:00 Remaining 00 00:00:02 Leg2/5 24.00% Elapsed 00 00:00:00 Remaining 00 00:00:02 Survey 25.00% Elapsed 00 00:00:00 Remaining 00 00:00:02 Leg2/5 25.00% Elapsed 00 00:00:00 Remaining 00 00:00:02 Survey 25.20% Elapsed 00 00:00:00 Remaining 00 00:00:02 Leg2/5 26.00% Elapsed 00 00:00:00 Remaining 00 00:00:02 Survey 25.40% Elapsed 00 00:00:00 Remaining 00 00:00:02 Leg2/5 27.00% Elapsed 00 00:00:00 Remaining 00 00:00:02 Survey 25.60% Elapsed 00 00:00:00 Remaining 00 00:00:02 Leg2/5 28.00% Elapsed 00 00:00:00 Remaining 00 00:00:02 Survey 25.80% Elapsed 00 00:00:00 Remaining 00 00:00:02 Leg2/5 29.00% Elapsed 00 00:00:00 Remaining 00 00:00:02 Survey 26.00% Elapsed 00 00:00:00 Remaining 00 00:00:02 Leg2/5 30.00% Elapsed 00 00:00:00 Remaining 00 00:00:02 Survey 26.20% Elapsed 00 00:00:00 Remaining 00 00:00:02 Leg2/5 31.00% Elapsed 00 00:00:00 Remaining 00 00:00:02 Survey 26.40% Elapsed 00 00:00:00 Remaining 00 00:00:02 Leg2/5 32.00% Elapsed 00 00:00:00 Remaining 00 00:00:02 Survey 26.60% Elapsed 00 00:00:01 Remaining 00 00:00:02 Leg2/5 33.00% Elapsed 00 00:00:01 Remaining 00 00:00:02 Survey 26.80% Elapsed 00 00:00:01 Remaining 00 00:00:02 Leg2/5 34.00% Elapsed 00 00:00:01 Remaining 00 00:00:01 Survey 27.00% Elapsed 00 00:00:01 Remaining 00 00:00:02 Leg2/5 35.00% Elapsed 00 00:00:01 Remaining 00 00:00:01 Survey 27.20% Elapsed 00 00:00:01 Remaining 00 00:00:02 Leg2/5 36.00% Elapsed 00 00:00:01 Remaining 00 00:00:01 Survey 27.40% Elapsed 00 00:00:01 Remaining 00 00:00:03 Leg2/5 37.00% Elapsed 00 00:00:01 Remaining 00 00:00:01 Survey 27.60% Elapsed 00 00:00:01 Remaining 00 00:00:03 Leg2/5 38.00% Elapsed 00 00:00:01 Remaining 00 00:00:01 Survey 27.80% Elapsed 00 00:00:01 Remaining 00 00:00:03 Leg2/5 39.00% Elapsed 00 00:00:01 Remaining 00 00:00:01 Survey 28.00% Elapsed 00 00:00:01 Remaining 00 00:00:03 Leg2/5 40.00% Elapsed 00 00:00:01 Remaining 00 00:00:01 Survey 28.20% Elapsed 00 00:00:01 Remaining 00 00:00:03 Leg2/5 41.00% Elapsed 00 00:00:01 Remaining 00 00:00:01 Survey 28.40% Elapsed 00 00:00:01 Remaining 00 00:00:03 Leg2/5 42.00% Elapsed 00 00:00:01 Remaining 00 00:00:01 Survey 28.60% Elapsed 00 00:00:01 Remaining 00 00:00:03 Leg2/5 43.00% Elapsed 00 00:00:01 Remaining 00 00:00:01 Survey 28.80% Elapsed 00 00:00:01 Remaining 00 00:00:03 Leg2/5 44.00% Elapsed 00 00:00:01 Remaining 00 00:00:01 Survey 29.00% Elapsed 00 00:00:01 Remaining 00 00:00:03 Leg2/5 45.00% Elapsed 00 00:00:01 Remaining 00 00:00:01 Survey 29.20% Elapsed 00 00:00:01 Remaining 00 00:00:03 Leg2/5 46.00% Elapsed 00 00:00:01 Remaining 00 00:00:01 Survey 29.40% Elapsed 00 00:00:01 Remaining 00 00:00:03 Leg2/5 47.00% Elapsed 00 00:00:01 Remaining 00 00:00:01 Survey 29.60% Elapsed 00 00:00:01 Remaining 00 00:00:03 Leg2/5 48.00% Elapsed 00 00:00:01 Remaining 00 00:00:01 Survey 29.80% Elapsed 00 00:00:01 Remaining 00 00:00:03 Leg2/5 49.00% Elapsed 00 00:00:01 Remaining 00 00:00:01 Survey 30.00% Elapsed 00 00:00:01 Remaining 00 00:00:03 Leg2/5 50.00% Elapsed 00 00:00:01 Remaining 00 00:00:01 Survey 30.20% Elapsed 00 00:00:01 Remaining 00 00:00:03 Leg2/5 51.00% Elapsed 00 00:00:01 Remaining 00 00:00:01 Survey 30.40% Elapsed 00 00:00:01 Remaining 00 00:00:03 Leg2/5 52.00% Elapsed 00 00:00:01 Remaining 00 00:00:01 Survey 30.60% Elapsed 00 00:00:01 Remaining 00 00:00:03 Leg2/5 53.00% Elapsed 00 00:00:01 Remaining 00 00:00:01 Survey 30.80% Elapsed 00 00:00:01 Remaining 00 00:00:03 Leg2/5 54.00% Elapsed 00 00:00:01 Remaining 00 00:00:01 Survey 31.00% Elapsed 00 00:00:01 Remaining 00 00:00:03 Leg2/5 55.00% Elapsed 00 00:00:01 Remaining 00 00:00:01 Survey 31.20% Elapsed 00 00:00:01 Remaining 00 00:00:03 Leg2/5 56.00% Elapsed 00 00:00:01 Remaining 00 00:00:01 Survey 31.40% Elapsed 00 00:00:01 Remaining 00 00:00:03 Leg2/5 57.00% Elapsed 00 00:00:01 Remaining 00 00:00:01 Survey 31.60% Elapsed 00 00:00:01 Remaining 00 00:00:03 Leg2/5 58.00% Elapsed 00 00:00:01 Remaining 00 00:00:01 Survey 31.80% Elapsed 00 00:00:01 Remaining 00 00:00:03 Leg2/5 59.00% Elapsed 00 00:00:01 Remaining 00 00:00:01 Survey 32.00% Elapsed 00 00:00:01 Remaining 00 00:00:04 Leg2/5 60.00% Elapsed 00 00:00:01 Remaining 00 00:00:01 Survey 32.20% Elapsed 00 00:00:01 Remaining 00 00:00:04 Leg2/5 61.00% Elapsed 00 00:00:01 Remaining 00 00:00:01 Survey 32.40% Elapsed 00 00:00:01 Remaining 00 00:00:04 Leg2/5 62.00% Elapsed 00 00:00:01 Remaining 00 00:00:01 Survey 32.60% Elapsed 00 00:00:01 Remaining 00 00:00:04 Leg2/5 63.00% Elapsed 00 00:00:01 Remaining 00 00:00:01 Survey 32.80% Elapsed 00 00:00:02 Remaining 00 00:00:04 Leg2/5 64.00% Elapsed 00 00:00:02 Remaining 00 00:00:01 Survey 33.00% Elapsed 00 00:00:02 Remaining 00 00:00:04 Leg2/5 65.00% Elapsed 00 00:00:02 Remaining 00 00:00:01 Survey 33.20% Elapsed 00 00:00:02 Remaining 00 00:00:04 Leg2/5 66.00% Elapsed 00 00:00:02 Remaining 00 00:00:01 Survey 33.40% Elapsed 00 00:00:02 Remaining 00 00:00:04 Leg2/5 67.00% Elapsed 00 00:00:02 Remaining 00 00:00:01 Survey 33.60% Elapsed 00 00:00:02 Remaining 00 00:00:04 Leg2/5 68.00% Elapsed 00 00:00:02 Remaining 00 00:00:01 Survey 33.80% Elapsed 00 00:00:02 Remaining 00 00:00:04 Leg2/5 69.00% Elapsed 00 00:00:02 Remaining 00 00:00:00 Survey 34.00% Elapsed 00 00:00:02 Remaining 00 00:00:04 Leg2/5 70.00% Elapsed 00 00:00:02 Remaining 00 00:00:00 Survey 34.20% Elapsed 00 00:00:02 Remaining 00 00:00:04 Leg2/5 71.00% Elapsed 00 00:00:02 Remaining 00 00:00:00 Survey 34.40% Elapsed 00 00:00:02 Remaining 00 00:00:04 Leg2/5 72.00% Elapsed 00 00:00:02 Remaining 00 00:00:00 Survey 34.60% Elapsed 00 00:00:02 Remaining 00 00:00:04 Leg2/5 73.00% Elapsed 00 00:00:02 Remaining 00 00:00:00 Survey 34.80% Elapsed 00 00:00:02 Remaining 00 00:00:04 Leg2/5 74.00% Elapsed 00 00:00:02 Remaining 00 00:00:00 Survey 35.00% Elapsed 00 00:00:02 Remaining 00 00:00:04 Leg2/5 75.00% Elapsed 00 00:00:02 Remaining 00 00:00:00 Survey 35.20% Elapsed 00 00:00:02 Remaining 00 00:00:04 Leg2/5 76.00% Elapsed 00 00:00:02 Remaining 00 00:00:00 Survey 35.40% Elapsed 00 00:00:02 Remaining 00 00:00:04 Leg2/5 77.00% Elapsed 00 00:00:02 Remaining 00 00:00:00 Survey 35.60% Elapsed 00 00:00:02 Remaining 00 00:00:04 Leg2/5 78.00% Elapsed 00 00:00:02 Remaining 00 00:00:00 Survey 35.80% Elapsed 00 00:00:02 Remaining 00 00:00:04 Leg2/5 79.00% Elapsed 00 00:00:02 Remaining 00 00:00:00 Survey 36.00% Elapsed 00 00:00:02 Remaining 00 00:00:04 Leg2/5 80.00% Elapsed 00 00:00:02 Remaining 00 00:00:00 Survey 36.20% Elapsed 00 00:00:02 Remaining 00 00:00:04 Leg2/5 81.00% Elapsed 00 00:00:02 Remaining 00 00:00:00 Survey 36.40% Elapsed 00 00:00:02 Remaining 00 00:00:04 Leg2/5 82.00% Elapsed 00 00:00:02 Remaining 00 00:00:00 Survey 36.60% Elapsed 00 00:00:02 Remaining 00 00:00:04 Leg2/5 83.00% Elapsed 00 00:00:02 Remaining 00 00:00:00 Survey 36.80% Elapsed 00 00:00:02 Remaining 00 00:00:04 Leg2/5 84.00% Elapsed 00 00:00:02 Remaining 00 00:00:00 Survey 37.00% Elapsed 00 00:00:02 Remaining 00 00:00:04 Leg2/5 85.00% Elapsed 00 00:00:02 Remaining 00 00:00:00 Survey 37.20% Elapsed 00 00:00:02 Remaining 00 00:00:04 Leg2/5 86.00% Elapsed 00 00:00:02 Remaining 00 00:00:00 Survey 37.40% Elapsed 00 00:00:02 Remaining 00 00:00:04 Leg2/5 87.00% Elapsed 00 00:00:02 Remaining 00 00:00:00 Survey 37.60% Elapsed 00 00:00:02 Remaining 00 00:00:04 Leg2/5 88.00% Elapsed 00 00:00:02 Remaining 00 00:00:00 Survey 37.80% Elapsed 00 00:00:02 Remaining 00 00:00:04 Leg2/5 89.00% Elapsed 00 00:00:02 Remaining 00 00:00:00 Survey 38.00% Elapsed 00 00:00:02 Remaining 00 00:00:04 Leg2/5 90.00% Elapsed 00 00:00:02 Remaining 00 00:00:00 Survey 38.20% Elapsed 00 00:00:02 Remaining 00 00:00:04 Leg2/5 91.00% Elapsed 00 00:00:02 Remaining 00 00:00:00 Survey 38.40% Elapsed 00 00:00:02 Remaining 00 00:00:04 Leg2/5 92.00% Elapsed 00 00:00:02 Remaining 00 00:00:00 Survey 38.60% Elapsed 00 00:00:02 Remaining 00 00:00:04 Leg2/5 93.00% Elapsed 00 00:00:02 Remaining 00 00:00:00 Survey 38.80% Elapsed 00 00:00:02 Remaining 00 00:00:04 Leg2/5 94.00% Elapsed 00 00:00:02 Remaining 00 00:00:00 Survey 39.00% Elapsed 00 00:00:03 Remaining 00 00:00:04 Leg2/5 95.00% Elapsed 00 00:00:03 Remaining 00 00:00:00 Survey 39.20% Elapsed 00 00:00:03 Remaining 00 00:00:04 Leg2/5 96.00% Elapsed 00 00:00:03 Remaining 00 00:00:00 Survey 39.40% Elapsed 00 00:00:03 Remaining 00 00:00:04 Leg2/5 97.00% Elapsed 00 00:00:03 Remaining 00 00:00:00 Survey 39.60% Elapsed 00 00:00:03 Remaining 00 00:00:04 Leg2/5 98.00% Elapsed 00 00:00:03 Remaining 00 00:00:00 Survey 39.80% Elapsed 00 00:00:03 Remaining 00 00:00:04 Leg2/5 99.00% Elapsed 00 00:00:03 Remaining 00 00:00:00 Survey 40.00% Elapsed 00 00:00:03 Remaining 00 00:00:04 Leg2/5 100.00% Elapsed 00 00:00:03 Remaining 00 00:00:00 Starting leg 2 Pulse frequency set to 180000 Scan angle set to 45 Applying settings for PolygonMirrorBeamDeflector... Vertical angle min/max -nan(ind)/-nan(ind) -- verticalAngleMin not set, using the value of -22.5 degrees -- verticalAngleMax not set, using the value of 22.5 degrees Leg2 waypoints: Origin: (10, 50, 50) Target: (10, 50, 50) Next: (10, 50, 50) Survey 60.00% Elapsed 00 00:00:03 Remaining 00 00:00:02 Leg3/5 100.00% Elapsed 00 00:00:00 Remaining 00 00:00:00 Starting leg 3 Pulse frequency set to 180000 Scan angle set to 45 Applying settings for PolygonMirrorBeamDeflector... Vertical angle min/max -nan(ind)/-nan(ind) -- verticalAngleMin not set, using the value of -22.5 degrees -- verticalAngleMax not set, using the value of 22.5 degrees Leg3 waypoints: Origin: (10, 50, 50) Target: (10, 50, 50) Next: (90, 50, 50) Survey 80.00% Elapsed 00 00:00:03 Remaining 00 00:00:00 Leg4/5 100.00% Elapsed 00 00:00:00 Remaining 00 00:00:00 Starting leg 4 Pulse frequency set to 180000 Scan angle set to 45 Applying settings for PolygonMirrorBeamDeflector... Vertical angle min/max -nan(ind)/-nan(ind) -- verticalAngleMin not set, using the value of -22.5 degrees -- verticalAngleMax not set, using the value of 22.5 degrees Leg4 waypoints: Origin: (10, 50, 50) Target: (90, 50, 50) Next: (90, 50, 50) Clearing point cloud: "output/\box_interpolation\2023-02-27_09-21-28\leg001_points.xyz" Survey 90.00% Elapsed 00 00:00:03 Remaining 00 00:00:00 Leg5/5 50.00% Elapsed 00 00:00:00 Remaining 00 00:00:00 Survey 90.20% Elapsed 00 00:00:03 Remaining 00 00:00:00 Leg5/5 51.00% Elapsed 00 00:00:00 Remaining 00 00:00:00 Survey 90.40% Elapsed 00 00:00:03 Remaining 00 00:00:00 Leg5/5 52.00% Elapsed 00 00:00:00 Remaining 00 00:00:00 Survey 90.60% Elapsed 00 00:00:03 Remaining 00 00:00:00 Leg5/5 53.00% Elapsed 00 00:00:00 Remaining 00 00:00:00 Survey 90.80% Elapsed 00 00:00:03 Remaining 00 00:00:00 Leg5/5 54.00% Elapsed 00 00:00:00 Remaining 00 00:00:00 Survey 91.00% Elapsed 00 00:00:03 Remaining 00 00:00:00 Leg5/5 55.00% Elapsed 00 00:00:00 Remaining 00 00:00:00 Survey 91.20% Elapsed 00 00:00:03 Remaining 00 00:00:00 Leg5/5 56.00% Elapsed 00 00:00:00 Remaining 00 00:00:00 Survey 91.40% Elapsed 00 00:00:03 Remaining 00 00:00:00 Leg5/5 57.00% Elapsed 00 00:00:00 Remaining 00 00:00:00 Survey 91.60% Elapsed 00 00:00:03 Remaining 00 00:00:00 Leg5/5 58.00% Elapsed 00 00:00:00 Remaining 00 00:00:00 Survey 91.80% Elapsed 00 00:00:03 Remaining 00 00:00:00 Leg5/5 59.00% Elapsed 00 00:00:00 Remaining 00 00:00:00 Survey 92.00% Elapsed 00 00:00:03 Remaining 00 00:00:00 Leg5/5 60.00% Elapsed 00 00:00:00 Remaining 00 00:00:00 Survey 92.20% Elapsed 00 00:00:03 Remaining 00 00:00:00 Leg5/5 61.00% Elapsed 00 00:00:00 Remaining 00 00:00:00 Survey 92.40% Elapsed 00 00:00:04 Remaining 00 00:00:00 Leg5/5 62.00% Elapsed 00 00:00:00 Remaining 00 00:00:00 Survey 92.60% Elapsed 00 00:00:04 Remaining 00 00:00:00 Leg5/5 63.00% Elapsed 00 00:00:00 Remaining 00 00:00:00 Survey 92.80% Elapsed 00 00:00:04 Remaining 00 00:00:00 Leg5/5 64.00% Elapsed 00 00:00:00 Remaining 00 00:00:00 Survey 93.00% Elapsed 00 00:00:04 Remaining 00 00:00:00 Leg5/5 65.00% Elapsed 00 00:00:00 Remaining 00 00:00:00 Survey 93.20% Elapsed 00 00:00:04 Remaining 00 00:00:00 Leg5/5 66.00% Elapsed 00 00:00:01 Remaining 00 00:00:00 Survey 93.40% Elapsed 00 00:00:04 Remaining 00 00:00:00 Leg5/5 67.00% Elapsed 00 00:00:01 Remaining 00 00:00:00 Survey 93.60% Elapsed 00 00:00:04 Remaining 00 00:00:00 Leg5/5 68.00% Elapsed 00 00:00:01 Remaining 00 00:00:00 Survey 93.80% Elapsed 00 00:00:04 Remaining 00 00:00:00 Leg5/5 69.00% Elapsed 00 00:00:01 Remaining 00 00:00:00 Survey 94.00% Elapsed 00 00:00:04 Remaining 00 00:00:00 Leg5/5 70.00% Elapsed 00 00:00:01 Remaining 00 00:00:00 Survey 94.20% Elapsed 00 00:00:04 Remaining 00 00:00:00 Leg5/5 71.00% Elapsed 00 00:00:01 Remaining 00 00:00:00 Survey 94.40% Elapsed 00 00:00:04 Remaining 00 00:00:00 Leg5/5 72.00% Elapsed 00 00:00:01 Remaining 00 00:00:00 Survey 94.60% Elapsed 00 00:00:04 Remaining 00 00:00:00 Leg5/5 73.00% Elapsed 00 00:00:01 Remaining 00 00:00:00 Survey 94.80% Elapsed 00 00:00:04 Remaining 00 00:00:00 Leg5/5 74.00% Elapsed 00 00:00:01 Remaining 00 00:00:00 Survey 95.00% Elapsed 00 00:00:04 Remaining 00 00:00:00 Leg5/5 75.00% Elapsed 00 00:00:01 Remaining 00 00:00:00 Survey 95.20% Elapsed 00 00:00:04 Remaining 00 00:00:00 Leg5/5 76.00% Elapsed 00 00:00:01 Remaining 00 00:00:00 Survey 95.40% Elapsed 00 00:00:04 Remaining 00 00:00:00 Leg5/5 77.00% Elapsed 00 00:00:01 Remaining 00 00:00:00 Survey 95.60% Elapsed 00 00:00:05 Remaining 00 00:00:00 Leg5/5 78.00% Elapsed 00 00:00:01 Remaining 00 00:00:00 Survey 95.80% Elapsed 00 00:00:05 Remaining 00 00:00:00 Leg5/5 79.00% Elapsed 00 00:00:01 Remaining 00 00:00:00 Survey 96.00% Elapsed 00 00:00:05 Remaining 00 00:00:00 Leg5/5 80.00% Elapsed 00 00:00:01 Remaining 00 00:00:00 Survey 96.20% Elapsed 00 00:00:05 Remaining 00 00:00:00 Leg5/5 81.00% Elapsed 00 00:00:01 Remaining 00 00:00:00 Survey 96.40% Elapsed 00 00:00:05 Remaining 00 00:00:00 Leg5/5 82.00% Elapsed 00 00:00:02 Remaining 00 00:00:00 Survey 96.60% Elapsed 00 00:00:05 Remaining 00 00:00:00 Leg5/5 83.00% Elapsed 00 00:00:02 Remaining 00 00:00:00 Survey 96.80% Elapsed 00 00:00:05 Remaining 00 00:00:00 Leg5/5 84.00% Elapsed 00 00:00:02 Remaining 00 00:00:00 Survey 97.00% Elapsed 00 00:00:05 Remaining 00 00:00:00 Leg5/5 85.00% Elapsed 00 00:00:02 Remaining 00 00:00:00 Survey 97.20% Elapsed 00 00:00:05 Remaining 00 00:00:00 Leg5/5 86.00% Elapsed 00 00:00:02 Remaining 00 00:00:00 Survey 97.40% Elapsed 00 00:00:05 Remaining 00 00:00:00 Leg5/5 87.00% Elapsed 00 00:00:02 Remaining 00 00:00:00 Survey 97.60% Elapsed 00 00:00:05 Remaining 00 00:00:00 Leg5/5 88.00% Elapsed 00 00:00:02 Remaining 00 00:00:00 Survey 97.80% Elapsed 00 00:00:05 Remaining 00 00:00:00 Leg5/5 89.00% Elapsed 00 00:00:02 Remaining 00 00:00:00 Survey 98.00% Elapsed 00 00:00:05 Remaining 00 00:00:00 Leg5/5 90.00% Elapsed 00 00:00:02 Remaining 00 00:00:00 Survey 98.20% Elapsed 00 00:00:05 Remaining 00 00:00:00 Leg5/5 91.00% Elapsed 00 00:00:02 Remaining 00 00:00:00 Survey 98.40% Elapsed 00 00:00:05 Remaining 00 00:00:00 Leg5/5 92.00% Elapsed 00 00:00:02 Remaining 00 00:00:00 Survey 98.60% Elapsed 00 00:00:06 Remaining 00 00:00:00 Leg5/5 93.00% Elapsed 00 00:00:02 Remaining 00 00:00:00 Survey 98.80% Elapsed 00 00:00:06 Remaining 00 00:00:00 Leg5/5 94.00% Elapsed 00 00:00:02 Remaining 00 00:00:00 Survey 99.00% Elapsed 00 00:00:06 Remaining 00 00:00:00 Leg5/5 95.00% Elapsed 00 00:00:02 Remaining 00 00:00:00 Survey 99.20% Elapsed 00 00:00:06 Remaining 00 00:00:00 Leg5/5 96.00% Elapsed 00 00:00:02 Remaining 00 00:00:00 Survey 99.40% Elapsed 00 00:00:06 Remaining 00 00:00:00 Leg5/5 97.00% Elapsed 00 00:00:02 Remaining 00 00:00:00 Survey 99.60% Elapsed 00 00:00:06 Remaining 00 00:00:00 Leg5/5 98.00% Elapsed 00 00:00:03 Remaining 00 00:00:00 Survey 99.80% Elapsed 00 00:00:06 Remaining 00 00:00:00 Leg5/5 99.00% Elapsed 00 00:00:03 Remaining 00 00:00:00 Survey 100.00% Elapsed 00 00:00:06 Remaining 00 00:00:00 Leg5/5 100.00% Elapsed 00 00:00:03 Remaining 00 00:00:00 Starting leg 5 Pulse frequency set to 180000 Scan angle set to 45 Applying settings for PolygonMirrorBeamDeflector... Vertical angle min/max -nan(ind)/-nan(ind) -- verticalAngleMin not set, using the value of -22.5 degrees -- verticalAngleMax not set, using the value of 22.5 degrees Elapsed simulation steps = 1800004 Elapsed virtual time = 10 sec. Main thread simulation loop finished in 6.50423 sec. Waiting for completion of pulse computation tasks... Pulse computation tasks finished in 6.5045 sec. Total simulation time: 0:00:6
Now let's find the output files and display a 3D plot.
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib as mpl
output_path = find_playback_dir("data/surveys/demo/box_survey_interp.xml")
print("Loading points from", output_path)
PC = pd.read_csv(Path(output_path) / 'leg000_points.xyz',
names="X Y Z intensity echoWidth returnNumber numberOfReturns fullwaveIndex hitObjectId class gpsTime".split(' '),
delimiter=' ')
trj = pd.read_csv(Path(output_path) / 'leg000_trajectory.txt',
names="X Y Z gpsTime roll pitch yaw".split(' '),
delimiter=' ')
PC1 = PC[PC['gpsTime'] <= 2.5] # select all points recorded in the first half
PC2 = PC[PC['gpsTime'] > 2.5] # select all points recorded in the second half
fig = plt.figure(figsize=(15,10))
ax = fig.add_subplot(projection='3d')
ax.scatter(PC1['X'], PC1['Y'], PC1['Z'], s=0.001, c=PC1['gpsTime'])
ax.scatter(PC2['X'], PC2['Y'], PC2['Z'], s=0.001, c=PC2['gpsTime'])
ax.scatter(trj['X'], trj['Y'], trj['Z'], s=10, c='red')
ax.set_xlabel('X')
ax.set_ylabel('Y')
ax.set_zlabel('Z')
ax.tick_params(labelsize=16)
plt.show()
Loading points from H:\helios4pyhelios\helios\output\box_interpolation\2023-02-27_09-21-28
In the first plot, we see the platform travelling along th y-axis. After 2.5 seconds, it reaches (0,0,0), and starts rolling (right wing downwards). In consequence, the laser swath travels left and upwards on the face of the cube.
In the second plot (below), the same thing happens, but with a different orientation (yaw angle).
PC = pd.read_csv(Path(output_path) / 'leg001_points.xyz',
names="X Y Z intensity echoWidth returnNumber numberOfReturns fullwaveIndex hitObjectId class gpsTime".split(' '),
delimiter=' ')
trj = pd.read_csv(Path(output_path) / 'leg001_trajectory.txt',
names="X Y Z gpsTime roll pitch yaw".split(' '),
delimiter=' ')
PC1 = PC[PC['gpsTime'] <= 7.5] # select all points recorded in the first half
PC2 = PC[PC['gpsTime'] > 7.5] # select all points recorded in the second half
fig = plt.figure(figsize=(15,10))
ax = fig.add_subplot(projection='3d')
ax.scatter(PC1['X'], PC1['Y'], PC1['Z'], s=0.001, c=PC1['gpsTime'])
ax.scatter(PC2['X'], PC2['Y'], PC2['Z'], s=0.001, c=PC2['gpsTime'])
ax.scatter(trj['X'], trj['Y'], trj['Z'], s=10, c='red')
ax.set_xlabel('X')
ax.set_ylabel('Y')
ax.set_zlabel('Z')
ax.tick_params(labelsize=16)
plt.show()