LiDAR

  1# coding: utf-8
  2from Element import Element
  3from enum import Enum
  4import json
  5
  6
  7class Beam:
  8    def __init__(self):
  9        self.axialDivision = 30
 10        self.maxOrder = 2
 11
 12    def to_json_object(self):
 13        jsonobj = {"axialDivision": self.axialDivision,
 14                   "maxOrder": self.maxOrder}
 15        return jsonobj
 16
 17    def init_from_json(self, jsondata):
 18        self.axialDivision = jsondata["beam"]["axialDivision"]
 19        self.maxOrder = jsondata["beam"]["maxOrder"]
 20
 21
 22class Device:
 23    def __init__(self):
 24        self.fractionAtRadius = 0.368
 25        self.footprintHalfAngle = 0.0012
 26        self.halfFov = 0.0015
 27        self.pulseEnergy = 1
 28        self.acquisitionPeriod = 1
 29        self.sensorArea = 0.1
 30        self.halfPulseDurationAtHalfPeak = 2
 31        self.halfDurationNumberOfSigma = 3
 32        self.deviceName = "unnamed"
 33
 34    def to_json_object(self):
 35        jsonobj = {
 36            "fractionAtRadius": self.fractionAtRadius,
 37            "footprintHalfAngle": self.footprintHalfAngle,
 38            "halfFov": self.halfFov,
 39            "pulseEnergy": self.pulseEnergy,
 40            "acquisitionPeriod": self.acquisitionPeriod,
 41            "sensorArea": self.sensorArea,
 42            "halfPulseDurationAtHalfPeak": self.halfPulseDurationAtHalfPeak,
 43            "halfDurationNumberOfSigma": self.halfDurationNumberOfSigma,
 44            "deviceName": self.deviceName
 45        }
 46        return jsonobj
 47
 48    def init_from_json(self, jsondata):
 49        self.fractionAtRadius = jsondata["device"]["fractionAtRadius"]
 50        self.footprintHalfAngle = jsondata["device"]["footprintHalfAngle"]
 51        self.halfFov = jsondata["device"]["halfFov"]
 52        self.pulseEnergy = jsondata["device"]["pulseEnergy"]
 53        self.acquisitionPeriod = jsondata["device"]["acquisitionPeriod"]
 54        self.sensorArea = jsondata["device"]["sensorArea"]
 55        self.halfPulseDurationAtHalfPeak = jsondata["device"]["halfPulseDurationAtHalfPeak"]
 56        self.halfDurationNumberOfSigma = jsondata["device"]["halfDurationNumberOfSigma"]
 57        self.deviceName = jsondata["device"]["deviceName"]
 58
 59
 60class TLSPlatform:
 61    def __init__(self):
 62        self.type = "TLS"
 63        self.echoDetectionMode = 1
 64        self.centerAzimuth = 45
 65        self.resolutionAzimuth = 1
 66        self.deltaAzimuth = 10
 67        self.centerZenith = 90
 68        self.deltaZenith = 10
 69        self.resolutionZenith = 1
 70        self.minRange = 10
 71        self.maxRange = 100
 72        self.x = 20
 73        self.y = 20
 74        self.z = 10
 75        self.pulseSpatialFile = ""
 76
 77    def to_json_object(self):
 78        json_obj = {"echoDetectionMode": self.echoDetectionMode,
 79                    "centerAzimuth": self.centerAzimuth,
 80                    "resolutionZenith": self.resolutionZenith,
 81                    "maxRange": self.maxRange,
 82                    "type": self.type,
 83                    "resolutionAzimuth": self.resolutionAzimuth,
 84                    "x": self.x,
 85                    "deltaZenith": self.deltaZenith,
 86                    "y": self.y,
 87                    "z": self.z,
 88                    "deltaAzimuth": self.deltaAzimuth,
 89                    "centerZenith": self.centerZenith,
 90                    "minRange": self.minRange,
 91                    "pulseSpatialFile": self.pulseSpatialFile
 92                    }
 93        return json_obj
 94
 95    def init_from_json(self, jsondata):
 96        self.type = jsondata["platform"]["type"]
 97        self.echoDetectionMode = jsondata["platform"]["echoDetectionMode"]
 98        self.centerAzimuth = jsondata["platform"]["centerAzimuth"]
 99        self.resolutionAzimuth = jsondata["platform"]["resolutionAzimuth"]
100        self.deltaAzimuth = jsondata["platform"]["deltaAzimuth"]
101        self.centerZenith = jsondata["platform"]["centerZenith"]
102        self.deltaZenith = jsondata["platform"]["deltaZenith"]
103        self.resolutionZenith = jsondata["platform"]["resolutionZenith"]
104        self.minRange = jsondata["platform"]["minRange"]
105        self.maxRange = jsondata["platform"]["maxRange"]
106        self.x = jsondata["platform"]["x"]
107        self.y = jsondata["platform"]["y"]
108        self.z = jsondata["platform"]["z"]
109        self.pulseSpatialFile = jsondata["platform"]["pulseSpatialFile"]
110
111
112class ALSPlatform:
113    def __init__(self):
114        self.type = "ALS"
115        self.swathWidth = 30
116        self.altitude = 50
117        self.endY = 20
118        self.endX = 35
119        self.yawResolution = 0.5
120        self.minRange = 20  # min range
121        self.maxRange = 80  # max range
122        self.platformAzimuth = 0
123        self.startY = 20
124        self.startX = 5
125        self.rangeResolution = 0.5
126        self.pulseSpatialFile = ""
127
128    def to_json_object(self):
129        json_obj = {
130            "swathWidth": self.swathWidth,
131            "altitude": self.altitude,
132            "endY": self.endY,
133            "endX": self.endX,
134            "azimuthResolution": self.yawResolution,
135            "savedUpper": self.minRange,
136            "savedLower": self.maxRange,
137            "platformAzimuth": self.platformAzimuth,
138            "startY": self.startY,
139            "startX": self.startX,
140            "rangeResolution": self.rangeResolution,
141            "type": self.type,
142            "pulseSpatialFile": self.pulseSpatialFile
143        }
144        return json_obj
145
146    def init_from_json(self, jsondata):
147        self.type = jsondata["platform"]["type"]
148        self.swathWidth = jsondata["platform"]["swathWidth"]
149        self.altitude = jsondata["platform"]["altitude"]
150        self.endY = jsondata["platform"]["endY"]
151        self.endX = jsondata["platform"]["endX"]
152        self.yawResolution = jsondata["platform"]["azimuthResolution"]
153        self.minRange = jsondata["platform"]["savedUpper"]  # min range
154        self.maxRange = jsondata["platform"]["savedLower"]  # max range
155        self.startY = jsondata["platform"]["startY"]
156        self.startX = jsondata["platform"]["startX"]
157        self.rangeResolution = jsondata["platform"]["rangeResolution"]
158        self.pulseSpatialFile = jsondata["platform"]["pulseSpatialFile"]
159
160
161class MonoPulsePlatform:
162    def __init__(self):
163        self.type = "Mono Pulse"
164        self.x = 20
165        self.y = 20
166        self.z = 800
167        self.zenith = 180
168        self.azimuth = 0.0
169        self.minRange = 750  # min range
170        self.maxRange = 800  # max range
171        self.pulseSpatialFile = ""
172
173    def to_json_object(self):
174        json_obj = {
175            "type": self.type,
176            "x": self.x,
177            "y": self.y,
178            "z": self.z,
179            "zenith": self.zenith,
180            "azimuth": self.azimuth,
181            "minRange": self.minRange,
182            "maxRange": self.maxRange,
183            "pulseSpatialFile": self.pulseSpatialFile
184        }
185        return json_obj
186
187    def init_from_json(self, jsondata):
188        self.type = jsondata["platform"]["type"]
189        self.x = jsondata["platform"]["x"]
190        self.y = jsondata["platform"]["y"]
191        self.z = jsondata["platform"]["z"]
192        self.zenith = jsondata["platform"]["zenith"]
193        self.azimuth = jsondata["platform"]["azimuth"]
194        self.minRange = jsondata["platform"]["minRange"]
195        self.maxRange = jsondata["platform"]["maxRange"]
196        self.pulseSpatialFile = jsondata["platform"]["pulseSpatialFile"]
197
198
199class LiDARSimMode(Enum):
200    SingleRayPointCloud = 1,
201    MultiRayPointCloud = 2,
202    MultiRayWaveform = 3,
203    MultiRayPointCloudIncident = 4
204
205
206class LiDAR(Element):
207    def __init__(self):
208        super().__init__()
209        self.beam = Beam()
210        self.device = Device()
211        self.sim_mode = LiDARSimMode.MultiRayPointCloud
212        self.platform = None
213
214    def set_lidar_sim_mode(self, sim_mode):
215        self.sim_mode = sim_mode
216
217    def get_lidar_sim_mode(self):
218        return self.sim_mode
219
220    def to_json_object(self):
221        json_obj = {
222            "beam": self.beam.to_json_object(),
223            "device": self.device.to_json_object(),
224            "platform": self.platform.to_json_object()
225        }
226        return json_obj
227
228    def init_from_json(self, json_file_path):
229        f = open(json_file_path)
230        jsondata = json.load(f)
231        f.close()
232        self.beam.init_from_json(jsondata)
233        self.device.init_from_json(jsondata)
234        self.platform.init_from_json(jsondata)
235
236
237class ALSLiDAR(LiDAR):
238    def __init__(self):
239        super().__init__()
240        self.platform = ALSPlatform()
241
242
243class TLSLiDAR(LiDAR):
244    def __init__(self):
245        super().__init__()
246        self.platform = TLSPlatform()
247
248
249class MonoPulseLiDAR(LiDAR):
250    def __init__(self):
251        super().__init__()
252        self.platform = MonoPulsePlatform()
253
254
255def create_lidar_from_file(json_file_path):
256    f = open(json_file_path)
257    jsondata = json.load(f)
258    f.close()
259    if jsondata["platform"]["type"] == "ALS":
260        als = ALSLiDAR()
261        als.init_from_json(json_file_path)
262        return als
263    elif jsondata["platform"]["type"] == "TLS":
264        tls = TLSLiDAR()
265        tls.init_from_json(json_file_path)
266        return tls
267    elif jsondata["platform"]["type"] == "Mono Pulse":
268        mono = MonoPulseLiDAR()
269        mono.init_from_json(json_file_path)
270        return mono
class Beam:
 8class Beam:
 9    def __init__(self):
10        self.axialDivision = 30
11        self.maxOrder = 2
12
13    def to_json_object(self):
14        jsonobj = {"axialDivision": self.axialDivision,
15                   "maxOrder": self.maxOrder}
16        return jsonobj
17
18    def init_from_json(self, jsondata):
19        self.axialDivision = jsondata["beam"]["axialDivision"]
20        self.maxOrder = jsondata["beam"]["maxOrder"]
axialDivision
maxOrder
def to_json_object(self):
13    def to_json_object(self):
14        jsonobj = {"axialDivision": self.axialDivision,
15                   "maxOrder": self.maxOrder}
16        return jsonobj
def init_from_json(self, jsondata):
18    def init_from_json(self, jsondata):
19        self.axialDivision = jsondata["beam"]["axialDivision"]
20        self.maxOrder = jsondata["beam"]["maxOrder"]
class Device:
23class Device:
24    def __init__(self):
25        self.fractionAtRadius = 0.368
26        self.footprintHalfAngle = 0.0012
27        self.halfFov = 0.0015
28        self.pulseEnergy = 1
29        self.acquisitionPeriod = 1
30        self.sensorArea = 0.1
31        self.halfPulseDurationAtHalfPeak = 2
32        self.halfDurationNumberOfSigma = 3
33        self.deviceName = "unnamed"
34
35    def to_json_object(self):
36        jsonobj = {
37            "fractionAtRadius": self.fractionAtRadius,
38            "footprintHalfAngle": self.footprintHalfAngle,
39            "halfFov": self.halfFov,
40            "pulseEnergy": self.pulseEnergy,
41            "acquisitionPeriod": self.acquisitionPeriod,
42            "sensorArea": self.sensorArea,
43            "halfPulseDurationAtHalfPeak": self.halfPulseDurationAtHalfPeak,
44            "halfDurationNumberOfSigma": self.halfDurationNumberOfSigma,
45            "deviceName": self.deviceName
46        }
47        return jsonobj
48
49    def init_from_json(self, jsondata):
50        self.fractionAtRadius = jsondata["device"]["fractionAtRadius"]
51        self.footprintHalfAngle = jsondata["device"]["footprintHalfAngle"]
52        self.halfFov = jsondata["device"]["halfFov"]
53        self.pulseEnergy = jsondata["device"]["pulseEnergy"]
54        self.acquisitionPeriod = jsondata["device"]["acquisitionPeriod"]
55        self.sensorArea = jsondata["device"]["sensorArea"]
56        self.halfPulseDurationAtHalfPeak = jsondata["device"]["halfPulseDurationAtHalfPeak"]
57        self.halfDurationNumberOfSigma = jsondata["device"]["halfDurationNumberOfSigma"]
58        self.deviceName = jsondata["device"]["deviceName"]
fractionAtRadius
footprintHalfAngle
halfFov
pulseEnergy
acquisitionPeriod
sensorArea
halfPulseDurationAtHalfPeak
halfDurationNumberOfSigma
deviceName
def to_json_object(self):
35    def to_json_object(self):
36        jsonobj = {
37            "fractionAtRadius": self.fractionAtRadius,
38            "footprintHalfAngle": self.footprintHalfAngle,
39            "halfFov": self.halfFov,
40            "pulseEnergy": self.pulseEnergy,
41            "acquisitionPeriod": self.acquisitionPeriod,
42            "sensorArea": self.sensorArea,
43            "halfPulseDurationAtHalfPeak": self.halfPulseDurationAtHalfPeak,
44            "halfDurationNumberOfSigma": self.halfDurationNumberOfSigma,
45            "deviceName": self.deviceName
46        }
47        return jsonobj
def init_from_json(self, jsondata):
49    def init_from_json(self, jsondata):
50        self.fractionAtRadius = jsondata["device"]["fractionAtRadius"]
51        self.footprintHalfAngle = jsondata["device"]["footprintHalfAngle"]
52        self.halfFov = jsondata["device"]["halfFov"]
53        self.pulseEnergy = jsondata["device"]["pulseEnergy"]
54        self.acquisitionPeriod = jsondata["device"]["acquisitionPeriod"]
55        self.sensorArea = jsondata["device"]["sensorArea"]
56        self.halfPulseDurationAtHalfPeak = jsondata["device"]["halfPulseDurationAtHalfPeak"]
57        self.halfDurationNumberOfSigma = jsondata["device"]["halfDurationNumberOfSigma"]
58        self.deviceName = jsondata["device"]["deviceName"]
class TLSPlatform:
 61class TLSPlatform:
 62    def __init__(self):
 63        self.type = "TLS"
 64        self.echoDetectionMode = 1
 65        self.centerAzimuth = 45
 66        self.resolutionAzimuth = 1
 67        self.deltaAzimuth = 10
 68        self.centerZenith = 90
 69        self.deltaZenith = 10
 70        self.resolutionZenith = 1
 71        self.minRange = 10
 72        self.maxRange = 100
 73        self.x = 20
 74        self.y = 20
 75        self.z = 10
 76        self.pulseSpatialFile = ""
 77
 78    def to_json_object(self):
 79        json_obj = {"echoDetectionMode": self.echoDetectionMode,
 80                    "centerAzimuth": self.centerAzimuth,
 81                    "resolutionZenith": self.resolutionZenith,
 82                    "maxRange": self.maxRange,
 83                    "type": self.type,
 84                    "resolutionAzimuth": self.resolutionAzimuth,
 85                    "x": self.x,
 86                    "deltaZenith": self.deltaZenith,
 87                    "y": self.y,
 88                    "z": self.z,
 89                    "deltaAzimuth": self.deltaAzimuth,
 90                    "centerZenith": self.centerZenith,
 91                    "minRange": self.minRange,
 92                    "pulseSpatialFile": self.pulseSpatialFile
 93                    }
 94        return json_obj
 95
 96    def init_from_json(self, jsondata):
 97        self.type = jsondata["platform"]["type"]
 98        self.echoDetectionMode = jsondata["platform"]["echoDetectionMode"]
 99        self.centerAzimuth = jsondata["platform"]["centerAzimuth"]
100        self.resolutionAzimuth = jsondata["platform"]["resolutionAzimuth"]
101        self.deltaAzimuth = jsondata["platform"]["deltaAzimuth"]
102        self.centerZenith = jsondata["platform"]["centerZenith"]
103        self.deltaZenith = jsondata["platform"]["deltaZenith"]
104        self.resolutionZenith = jsondata["platform"]["resolutionZenith"]
105        self.minRange = jsondata["platform"]["minRange"]
106        self.maxRange = jsondata["platform"]["maxRange"]
107        self.x = jsondata["platform"]["x"]
108        self.y = jsondata["platform"]["y"]
109        self.z = jsondata["platform"]["z"]
110        self.pulseSpatialFile = jsondata["platform"]["pulseSpatialFile"]
type
echoDetectionMode
centerAzimuth
resolutionAzimuth
deltaAzimuth
centerZenith
deltaZenith
resolutionZenith
minRange
maxRange
x
y
z
pulseSpatialFile
def to_json_object(self):
78    def to_json_object(self):
79        json_obj = {"echoDetectionMode": self.echoDetectionMode,
80                    "centerAzimuth": self.centerAzimuth,
81                    "resolutionZenith": self.resolutionZenith,
82                    "maxRange": self.maxRange,
83                    "type": self.type,
84                    "resolutionAzimuth": self.resolutionAzimuth,
85                    "x": self.x,
86                    "deltaZenith": self.deltaZenith,
87                    "y": self.y,
88                    "z": self.z,
89                    "deltaAzimuth": self.deltaAzimuth,
90                    "centerZenith": self.centerZenith,
91                    "minRange": self.minRange,
92                    "pulseSpatialFile": self.pulseSpatialFile
93                    }
94        return json_obj
def init_from_json(self, jsondata):
 96    def init_from_json(self, jsondata):
 97        self.type = jsondata["platform"]["type"]
 98        self.echoDetectionMode = jsondata["platform"]["echoDetectionMode"]
 99        self.centerAzimuth = jsondata["platform"]["centerAzimuth"]
100        self.resolutionAzimuth = jsondata["platform"]["resolutionAzimuth"]
101        self.deltaAzimuth = jsondata["platform"]["deltaAzimuth"]
102        self.centerZenith = jsondata["platform"]["centerZenith"]
103        self.deltaZenith = jsondata["platform"]["deltaZenith"]
104        self.resolutionZenith = jsondata["platform"]["resolutionZenith"]
105        self.minRange = jsondata["platform"]["minRange"]
106        self.maxRange = jsondata["platform"]["maxRange"]
107        self.x = jsondata["platform"]["x"]
108        self.y = jsondata["platform"]["y"]
109        self.z = jsondata["platform"]["z"]
110        self.pulseSpatialFile = jsondata["platform"]["pulseSpatialFile"]
class ALSPlatform:
113class ALSPlatform:
114    def __init__(self):
115        self.type = "ALS"
116        self.swathWidth = 30
117        self.altitude = 50
118        self.endY = 20
119        self.endX = 35
120        self.yawResolution = 0.5
121        self.minRange = 20  # min range
122        self.maxRange = 80  # max range
123        self.platformAzimuth = 0
124        self.startY = 20
125        self.startX = 5
126        self.rangeResolution = 0.5
127        self.pulseSpatialFile = ""
128
129    def to_json_object(self):
130        json_obj = {
131            "swathWidth": self.swathWidth,
132            "altitude": self.altitude,
133            "endY": self.endY,
134            "endX": self.endX,
135            "azimuthResolution": self.yawResolution,
136            "savedUpper": self.minRange,
137            "savedLower": self.maxRange,
138            "platformAzimuth": self.platformAzimuth,
139            "startY": self.startY,
140            "startX": self.startX,
141            "rangeResolution": self.rangeResolution,
142            "type": self.type,
143            "pulseSpatialFile": self.pulseSpatialFile
144        }
145        return json_obj
146
147    def init_from_json(self, jsondata):
148        self.type = jsondata["platform"]["type"]
149        self.swathWidth = jsondata["platform"]["swathWidth"]
150        self.altitude = jsondata["platform"]["altitude"]
151        self.endY = jsondata["platform"]["endY"]
152        self.endX = jsondata["platform"]["endX"]
153        self.yawResolution = jsondata["platform"]["azimuthResolution"]
154        self.minRange = jsondata["platform"]["savedUpper"]  # min range
155        self.maxRange = jsondata["platform"]["savedLower"]  # max range
156        self.startY = jsondata["platform"]["startY"]
157        self.startX = jsondata["platform"]["startX"]
158        self.rangeResolution = jsondata["platform"]["rangeResolution"]
159        self.pulseSpatialFile = jsondata["platform"]["pulseSpatialFile"]
type
swathWidth
altitude
endY
endX
yawResolution
minRange
maxRange
platformAzimuth
startY
startX
rangeResolution
pulseSpatialFile
def to_json_object(self):
129    def to_json_object(self):
130        json_obj = {
131            "swathWidth": self.swathWidth,
132            "altitude": self.altitude,
133            "endY": self.endY,
134            "endX": self.endX,
135            "azimuthResolution": self.yawResolution,
136            "savedUpper": self.minRange,
137            "savedLower": self.maxRange,
138            "platformAzimuth": self.platformAzimuth,
139            "startY": self.startY,
140            "startX": self.startX,
141            "rangeResolution": self.rangeResolution,
142            "type": self.type,
143            "pulseSpatialFile": self.pulseSpatialFile
144        }
145        return json_obj
def init_from_json(self, jsondata):
147    def init_from_json(self, jsondata):
148        self.type = jsondata["platform"]["type"]
149        self.swathWidth = jsondata["platform"]["swathWidth"]
150        self.altitude = jsondata["platform"]["altitude"]
151        self.endY = jsondata["platform"]["endY"]
152        self.endX = jsondata["platform"]["endX"]
153        self.yawResolution = jsondata["platform"]["azimuthResolution"]
154        self.minRange = jsondata["platform"]["savedUpper"]  # min range
155        self.maxRange = jsondata["platform"]["savedLower"]  # max range
156        self.startY = jsondata["platform"]["startY"]
157        self.startX = jsondata["platform"]["startX"]
158        self.rangeResolution = jsondata["platform"]["rangeResolution"]
159        self.pulseSpatialFile = jsondata["platform"]["pulseSpatialFile"]
class MonoPulsePlatform:
162class MonoPulsePlatform:
163    def __init__(self):
164        self.type = "Mono Pulse"
165        self.x = 20
166        self.y = 20
167        self.z = 800
168        self.zenith = 180
169        self.azimuth = 0.0
170        self.minRange = 750  # min range
171        self.maxRange = 800  # max range
172        self.pulseSpatialFile = ""
173
174    def to_json_object(self):
175        json_obj = {
176            "type": self.type,
177            "x": self.x,
178            "y": self.y,
179            "z": self.z,
180            "zenith": self.zenith,
181            "azimuth": self.azimuth,
182            "minRange": self.minRange,
183            "maxRange": self.maxRange,
184            "pulseSpatialFile": self.pulseSpatialFile
185        }
186        return json_obj
187
188    def init_from_json(self, jsondata):
189        self.type = jsondata["platform"]["type"]
190        self.x = jsondata["platform"]["x"]
191        self.y = jsondata["platform"]["y"]
192        self.z = jsondata["platform"]["z"]
193        self.zenith = jsondata["platform"]["zenith"]
194        self.azimuth = jsondata["platform"]["azimuth"]
195        self.minRange = jsondata["platform"]["minRange"]
196        self.maxRange = jsondata["platform"]["maxRange"]
197        self.pulseSpatialFile = jsondata["platform"]["pulseSpatialFile"]
type
x
y
z
zenith
azimuth
minRange
maxRange
pulseSpatialFile
def to_json_object(self):
174    def to_json_object(self):
175        json_obj = {
176            "type": self.type,
177            "x": self.x,
178            "y": self.y,
179            "z": self.z,
180            "zenith": self.zenith,
181            "azimuth": self.azimuth,
182            "minRange": self.minRange,
183            "maxRange": self.maxRange,
184            "pulseSpatialFile": self.pulseSpatialFile
185        }
186        return json_obj
def init_from_json(self, jsondata):
188    def init_from_json(self, jsondata):
189        self.type = jsondata["platform"]["type"]
190        self.x = jsondata["platform"]["x"]
191        self.y = jsondata["platform"]["y"]
192        self.z = jsondata["platform"]["z"]
193        self.zenith = jsondata["platform"]["zenith"]
194        self.azimuth = jsondata["platform"]["azimuth"]
195        self.minRange = jsondata["platform"]["minRange"]
196        self.maxRange = jsondata["platform"]["maxRange"]
197        self.pulseSpatialFile = jsondata["platform"]["pulseSpatialFile"]
class LiDARSimMode(enum.Enum):
200class LiDARSimMode(Enum):
201    SingleRayPointCloud = 1,
202    MultiRayPointCloud = 2,
203    MultiRayWaveform = 3,
204    MultiRayPointCloudIncident = 4

An enumeration.

SingleRayPointCloud = <LiDARSimMode.SingleRayPointCloud: (1,)>
MultiRayPointCloud = <LiDARSimMode.MultiRayPointCloud: (2,)>
MultiRayWaveform = <LiDARSimMode.MultiRayWaveform: (3,)>
MultiRayPointCloudIncident = <LiDARSimMode.MultiRayPointCloudIncident: 4>
Inherited Members
enum.Enum
name
value
class LiDAR(Element.Element):
207class LiDAR(Element):
208    def __init__(self):
209        super().__init__()
210        self.beam = Beam()
211        self.device = Device()
212        self.sim_mode = LiDARSimMode.MultiRayPointCloud
213        self.platform = None
214
215    def set_lidar_sim_mode(self, sim_mode):
216        self.sim_mode = sim_mode
217
218    def get_lidar_sim_mode(self):
219        return self.sim_mode
220
221    def to_json_object(self):
222        json_obj = {
223            "beam": self.beam.to_json_object(),
224            "device": self.device.to_json_object(),
225            "platform": self.platform.to_json_object()
226        }
227        return json_obj
228
229    def init_from_json(self, json_file_path):
230        f = open(json_file_path)
231        jsondata = json.load(f)
232        f.close()
233        self.beam.init_from_json(jsondata)
234        self.device.init_from_json(jsondata)
235        self.platform.init_from_json(jsondata)
beam
device
sim_mode
platform
def set_lidar_sim_mode(self, sim_mode):
215    def set_lidar_sim_mode(self, sim_mode):
216        self.sim_mode = sim_mode
def get_lidar_sim_mode(self):
218    def get_lidar_sim_mode(self):
219        return self.sim_mode
def to_json_object(self):
221    def to_json_object(self):
222        json_obj = {
223            "beam": self.beam.to_json_object(),
224            "device": self.device.to_json_object(),
225            "platform": self.platform.to_json_object()
226        }
227        return json_obj
def init_from_json(self, json_file_path):
229    def init_from_json(self, json_file_path):
230        f = open(json_file_path)
231        jsondata = json.load(f)
232        f.close()
233        self.beam.init_from_json(jsondata)
234        self.device.init_from_json(jsondata)
235        self.platform.init_from_json(jsondata)
Inherited Members
Element.Element
set_sim
get_sim
class ALSLiDAR(LiDAR):
238class ALSLiDAR(LiDAR):
239    def __init__(self):
240        super().__init__()
241        self.platform = ALSPlatform()
platform
Inherited Members
LiDAR
beam
device
sim_mode
set_lidar_sim_mode
get_lidar_sim_mode
to_json_object
init_from_json
Element.Element
set_sim
get_sim
class TLSLiDAR(LiDAR):
244class TLSLiDAR(LiDAR):
245    def __init__(self):
246        super().__init__()
247        self.platform = TLSPlatform()
platform
Inherited Members
LiDAR
beam
device
sim_mode
set_lidar_sim_mode
get_lidar_sim_mode
to_json_object
init_from_json
Element.Element
set_sim
get_sim
class MonoPulseLiDAR(LiDAR):
250class MonoPulseLiDAR(LiDAR):
251    def __init__(self):
252        super().__init__()
253        self.platform = MonoPulsePlatform()
platform
Inherited Members
LiDAR
beam
device
sim_mode
set_lidar_sim_mode
get_lidar_sim_mode
to_json_object
init_from_json
Element.Element
set_sim
get_sim
def create_lidar_from_file(json_file_path):
256def create_lidar_from_file(json_file_path):
257    f = open(json_file_path)
258    jsondata = json.load(f)
259    f.close()
260    if jsondata["platform"]["type"] == "ALS":
261        als = ALSLiDAR()
262        als.init_from_json(json_file_path)
263        return als
264    elif jsondata["platform"]["type"] == "TLS":
265        tls = TLSLiDAR()
266        tls.init_from_json(json_file_path)
267        return tls
268    elif jsondata["platform"]["type"] == "Mono Pulse":
269        mono = MonoPulseLiDAR()
270        mono.init_from_json(json_file_path)
271        return mono