autoverse-cli 0.5.0__py3-none-any.whl → 0.7.0__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: autoverse-cli
3
- Version: 0.5.0
3
+ Version: 0.7.0
4
4
  Summary: The Autoverse CLI
5
5
  Author-email: Dan Kamrath <dan.kamrath@autonomalabs.com>
6
6
  License: # End-User License Agreement (EULA) of the Autonoma AutoVerse CLI
@@ -1,7 +1,7 @@
1
1
  avrs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- avrs/app_version.py,sha256=BSr1FCeH2yZvQPWvXc3T_L0B_fSZK5ZDJ6bTWkdYClY,855
2
+ avrs/app_version.py,sha256=bO0-qxfSWvkZgYy9nV11HSq5gNRuKteUi2-YrsSoTwM,855
3
3
  avrs/argparse_help.py,sha256=EoEaohGXZXqJvs1dFEzbo9vh47CYdHdSY2Im2Ps2iFo,945
4
- avrs/avrs.py,sha256=_lz9eYgDCEAk7atb-m5BofGWdi84MtZhiyGl4gHUKkI,2530
4
+ avrs/avrs.py,sha256=9DfUzBn3yuCUTVs2Mx_hYgznEAHbErHqGXShCIO4Iqg,2844
5
5
  avrs/can_tool.py,sha256=IBoctKobBJ3wCq4ZdtuXuXH4AMEUxazCfYT6YP0Luw8,7161
6
6
  avrs/can_tool_util.py,sha256=G3q21dTGMLc09SDq_RieoW7kSn-kXPkXxPDjavPh4hQ,7710
7
7
  avrs/cfg.py,sha256=kMn08Z4Ms1PAu2-U1QI8weEJeIVEppP4A4_tFfwnjtg,2924
@@ -10,26 +10,30 @@ avrs/launcher_util.py,sha256=y_F2YvIe81l3B1_lCjpoOgkbE4hAr2C9eaPio0es34o,5236
10
10
  avrs/simconfig.py,sha256=CtpIeU32Lfsek37Z4XR4mjSKwF27IlYvC92184VOuuQ,2389
11
11
  avrs/simconfig_util.py,sha256=R3ggjx1fIdOAHpUroNLjH6gg0G07PbFTI4PfwUOWtdw,2277
12
12
  avrs/tests.py,sha256=3JeYBjn0tRqHXERDROfzmYuW1KXeCcKur5Bw-EIegto,153
13
- avrs/requests/code_booz.py,sha256=5bzT8Ra6EIwI19TqXMxkHG_llnyFgqSzTSo7yLNV9Vc,2274
13
+ avrs/requests/change_camera.py,sha256=twqdE049DHwdjgKFZbindwpK7Oz-ivCjbI8WQj8QsxI,416
14
+ avrs/requests/code_booz.py,sha256=SXaEAMTqID4lf1o_4Cc1wY9609X-dNcfNa-UZv3FWF4,2471
14
15
  avrs/requests/demo.py,sha256=cbGQJK-OfeFUkQwVzafHgoWP15xoKL-ZgYkQ7moEt2A,872
15
16
  avrs/requests/environment.py,sha256=ORwOBxhXPcatn_W8aY5pgIy4f2paUbqIYii5oE540xA,1305
16
- avrs/requests/fault_injection.py,sha256=BwGywvvwpHM0Q06u65GDd79XFd3bgDJkrSoX-nGIFZc,4965
17
+ avrs/requests/fault_injection.py,sha256=EkpjPCx-UtrNbAR_vQS1zaGKN49UDCyYOoVcdlP1T0M,5948
18
+ avrs/requests/get_object_config.py,sha256=Mkwp32lfskQERsqfmAgHi4vf4C0hfjg6Ru8UjyMt3cw,654
17
19
  avrs/requests/list_sim_objects.py,sha256=YWpqHdCHijerPxI5606_KjeFvezcLFN33wO4YOr9G3U,977
18
20
  avrs/requests/log_path.py,sha256=Ur24C9VqPVx78MfpicgQu2uOEe-0dXbGoWF_7dzMtZE,1326
21
+ avrs/requests/misc.py,sha256=PpoyCsFID7PyoW1M6wjDQ7Mcf-dyCtJwIuiWu0tWFQg,431
19
22
  avrs/requests/move_to_landmark.py,sha256=cLRBKu9XEDsmCoftBJ8JwoBLqzb0IZsxFMBnus4T-kc,702
20
23
  avrs/requests/npc.py,sha256=Y_WovbcLomCCcOLAMMO_DHZtc1crAzWo97qEIGS3SvU,9691
21
- avrs/requests/request.py,sha256=qRSB54LC_UANf2kSbxI2zqQPOguoxg6O5_nUw4iW3dM,1607
22
- avrs/requests/reserve_mv_slot.py,sha256=p_jiTV7rcoyJU6u3UR9sqPBpSaq8-PWMEs0Ckm2Hf8w,3843
24
+ avrs/requests/request.py,sha256=eUorvMKuKn7OuxjLCty40CX_uE0v1o6xfqsNO5cGvt8,1611
25
+ avrs/requests/reserve_mv_slot.py,sha256=ejB_RSZBXCpxY7B_2f66Or8twKdMI1gn9nEQgZ2YYEY,3843
23
26
  avrs/requests/reset_to_track.py,sha256=lSd2YavBxDV_hQMhVoi08_TpTFEq7G2MA18xosFYa1g,450
24
27
  avrs/requests/restart.py,sha256=ih5mnWiU34q3-xhOth45CtOUXxKI0PoMDCnFJV0JbwE,415
25
28
  avrs/requests/scenario_control.py,sha256=u-KQx-mdCm6IE_c88a6iEgWUsZZVOayxBo58Ocjg0ZI,1502
26
- avrs/requests/teleport.py,sha256=WpnB2-Ii0FGI11EXTAHlaF5zqZIsgEyJnJ2j_w4rDFY,824
29
+ avrs/requests/teleport.py,sha256=X4OfUOWXiAaG9d6iRxb5xL9XpFXYG8waQRp0Ar8BR48,863
30
+ avrs/requests/toggle_hud.py,sha256=sV5t5QZc4uvRihPVk8jEKZiQNsyF9tsUwq5b4jjZplc,397
27
31
  avrs/requests/vd.py,sha256=at6oUAGY2h0OxYU6MLOi1gnxyUn6i24vL9DUAj0L880,1600
28
32
  avrs/requests/vehicle_input.py,sha256=R1b1xkRtOBkwyU6OSN4bWVlYsIUroZG0WKbYbc4pEH8,729
29
- avrs/requests/vehicle_replay.py,sha256=U2zIQO-V63nQ1KZAnb8Bg2BAHl4aaEone6JwoEfNfDg,6265
30
- autoverse_cli-0.5.0.dist-info/LICENSE,sha256=d4eWXho-u18HkBsX4K21uHX_bBb2UXZSrJdsb7Z_JlM,2647
31
- autoverse_cli-0.5.0.dist-info/METADATA,sha256=gqt-z3KopUJcBAiR2yIngNDjCh8kORk9bVNFW3VC76I,3341
32
- autoverse_cli-0.5.0.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
33
- autoverse_cli-0.5.0.dist-info/entry_points.txt,sha256=Cb9qsUyU5AKkklehCcvtfT0-N3SXbUEqvjze4iEU5kE,40
34
- autoverse_cli-0.5.0.dist-info/top_level.txt,sha256=-AJO2e4MCVej6hY0U84pu5NfMeMW5qaAPSMisDT5rmA,5
35
- autoverse_cli-0.5.0.dist-info/RECORD,,
33
+ avrs/requests/vehicle_replay.py,sha256=nCAE21VNyKoeIjjXBGAihgOLO7zYHcu-HWvPZYxdQ2c,11099
34
+ autoverse_cli-0.7.0.dist-info/LICENSE,sha256=d4eWXho-u18HkBsX4K21uHX_bBb2UXZSrJdsb7Z_JlM,2647
35
+ autoverse_cli-0.7.0.dist-info/METADATA,sha256=Lc7liX7GMeXqWbvB9DdD0keiyI_KJhC27P-rXq8w7PQ,3341
36
+ autoverse_cli-0.7.0.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
37
+ autoverse_cli-0.7.0.dist-info/entry_points.txt,sha256=Cb9qsUyU5AKkklehCcvtfT0-N3SXbUEqvjze4iEU5kE,40
38
+ autoverse_cli-0.7.0.dist-info/top_level.txt,sha256=-AJO2e4MCVej6hY0U84pu5NfMeMW5qaAPSMisDT5rmA,5
39
+ autoverse_cli-0.7.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.2.0)
2
+ Generator: setuptools (75.5.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
avrs/app_version.py CHANGED
@@ -2,7 +2,7 @@ import http.client
2
2
  import json
3
3
 
4
4
  def get_app_version():
5
- return '0.5.0'
5
+ return '0.7.0'
6
6
 
7
7
  def check_app_is_latest():
8
8
  pass
avrs/avrs.py CHANGED
@@ -25,7 +25,11 @@ from avrs.requests.vehicle_replay import *
25
25
  from avrs.requests.scenario_control import *
26
26
  from avrs.requests.list_sim_objects import *
27
27
  from avrs.requests.fault_injection import *
28
+ from avrs.requests.change_camera import *
29
+ from avrs.requests.toggle_hud import *
28
30
  from avrs.simconfig import *
31
+ from avrs.requests.get_object_config import *
32
+ from avrs.requests.misc import *
29
33
 
30
34
 
31
35
  def get_version():
@@ -74,6 +78,10 @@ def main():
74
78
  AvrsScenarioRequests(sps, cfg)
75
79
  AvrsListSimObjectsRequest(sps, cfg)
76
80
  AvrsFaultInjectionRequests(sps, cfg)
81
+ AvrsChangeCameraRequest(sps, cfg)
82
+ AvrsToggleHudRequest(sps, cfg)
83
+ AvrsGetObjectConfigRequest(sps, cfg)
84
+ AvrsGetSimVersionRequest(sps, cfg)
77
85
 
78
86
  if os.environ.get('AVRS_WITH_DEMO', '0') == '1':
79
87
  AvrsDemoRequest(sps, cfg)
@@ -0,0 +1,11 @@
1
+ from avrs.requests.request import AvrsApiRequest
2
+
3
+ class AvrsChangeCameraRequest(AvrsApiRequest):
4
+ def __init__(self, parser, cfg):
5
+ AvrsApiRequest.__init__(self, parser, cfg, 'ChangeCamera', '')
6
+ psr = parser.add_parser('change-camera', help='changes the active camera on an object')
7
+ psr.set_defaults(func=self.send_request)
8
+
9
+ def get_request_body(self, args):
10
+ return {
11
+ }
@@ -28,6 +28,9 @@ class AvrsCodeBoozStartLogging(AvrsApiRequest):
28
28
  psr.add_argument(
29
29
  '--rate-hz', type=float, default=100.0, help='the rate in hz to log data')
30
30
 
31
+ psr.add_argument(
32
+ '--csv-only-xyv', action='store_true', help='if true, will only record the x, y and velocity magnitude to csv')
33
+
31
34
  psr.set_defaults(func=self.send_request)
32
35
 
33
36
  def get_request_body(self, args):
@@ -35,7 +38,8 @@ class AvrsCodeBoozStartLogging(AvrsApiRequest):
35
38
  'Action': 'Start',
36
39
  'FileName': args.out_file,
37
40
  'RateHz': args.rate_hz,
38
- 'Format': args.format
41
+ 'Format': args.format,
42
+ 'bCsvOnlyXyv': args.csv_only_xyv
39
43
  }
40
44
 
41
45
  class AvrsCodeBoozStopLogging(AvrsApiRequest):
@@ -9,6 +9,7 @@ class AvrsFaultInjectionRequests():
9
9
  AvrsGnssFaultRequest(sps, cfg)
10
10
  AvrsLidarFaultRequest(sps, cfg)
11
11
  AvrsImuFaultRequest(sps, cfg)
12
+ AvrsCanFaultRequest(sps, cfg)
12
13
 
13
14
  def add_base_injection_args(psr):
14
15
 
@@ -152,4 +153,34 @@ class AvrsLidarFaultRequest(AvrsApiRequest):
152
153
  'JsonBody': {
153
154
  'pointDensityReduction': args.point_density_reduction
154
155
  }
156
+ }
157
+
158
+ class AvrsCanFaultRequest(AvrsApiRequest):
159
+ def __init__(self, parser, cfg):
160
+ AvrsApiRequest.__init__(self, parser, cfg, 'FaultInjection', '')
161
+
162
+ psr = parser.add_parser(
163
+ 'can',
164
+ help='inject a can',
165
+ formatter_class=RawTextHelpFormatter)
166
+
167
+ psr.add_argument(
168
+ 'can_type',
169
+ choices = ['bsu', 'badenia', 'kistler', 'all'],
170
+ help='what type of the can interface you wish to apply the fault to')
171
+
172
+ add_base_injection_args(psr)
173
+ psr.set_defaults(func=self.send_request)
174
+
175
+ def get_request_body(self, args):
176
+ self.target_object_id = args.target
177
+ self.verbose = args.verbose
178
+ return {
179
+ 'faultType': 'CanFault',
180
+ 'duration': args.duration,
181
+ 'bIsDropout': True,
182
+ 'bIsFreeze': args.freeze,
183
+ 'JsonBody': {
184
+ 'canType': args.can_type
185
+ }
155
186
  }
@@ -0,0 +1,18 @@
1
+ from avrs.requests.request import AvrsApiRequest
2
+
3
+ class AvrsGetObjectConfigRequest(AvrsApiRequest):
4
+ def __init__(self, parser, cfg):
5
+ AvrsApiRequest.__init__(self, parser, cfg, 'GetObjectConfig', '')
6
+ psr = parser.add_parser('get-object-config', help='returns the JSON structure of an objects configuration')
7
+
8
+ psr.add_argument(
9
+ '--target',
10
+ default='ego',
11
+ help='the simulated object to return config for')
12
+
13
+ psr.set_defaults(func=self.send_request)
14
+
15
+ def get_request_body(self, args):
16
+ self.target_object_id = args.target
17
+ return {
18
+ }
avrs/requests/misc.py ADDED
@@ -0,0 +1,11 @@
1
+ from avrs.requests.request import AvrsApiRequest
2
+
3
+ class AvrsGetSimVersionRequest(AvrsApiRequest):
4
+ def __init__(self, parser, cfg):
5
+ AvrsApiRequest.__init__(self, parser, cfg, 'GetVersion', 0)
6
+ psr = parser.add_parser('get-sim-version', help='get the version of the currently running simulator')
7
+ psr.set_defaults(func=self.send_request)
8
+
9
+ def get_request_body(self, args):
10
+ return {
11
+ }
avrs/requests/request.py CHANGED
@@ -14,11 +14,11 @@ class AvrsApiRequest:
14
14
  self.verbose = False
15
15
 
16
16
  def get_request(self, args):
17
- body = json.dumps(self.get_request_body(args))
17
+ body = self.get_request_body(args)
18
18
  return {
19
19
  'TargetObjectId': self.target_object_id,
20
20
  'RequestType': self.request_type,
21
- 'bVerboseResponse': self.verbose,
21
+ 'bVerboseResponse': args.verbose or self.verbose,
22
22
  'RequestBody': body
23
23
  }
24
24
 
@@ -44,7 +44,7 @@ class ReserveMvSlot(AvrsApiRequest):
44
44
 
45
45
  psr.add_argument(
46
46
  '--badenia-can-name',
47
- default='vcan1',
47
+ default='vcan2',
48
48
  help='the name of the CAN interface to use for the bandanania CAN bus on the new vehicle')
49
49
 
50
50
  psr.add_argument(
@@ -75,9 +75,9 @@ class ReserveMvSlot(AvrsApiRequest):
75
75
  eav_init_pld = {
76
76
  'TypeName': 'Eav24Initializer',
77
77
  'Body': {
78
- 'BsuCanName': args.bsu_can_name,
79
- 'KistlerCanNam': args.kistler_can_name,
80
- 'BadeniaCanName': args.badenia_can_name,
78
+ 'bsuCanName': args.bsu_can_name,
79
+ 'kistlerCanNam': args.kistler_can_name,
80
+ 'badeniaCanName': args.badenia_can_name,
81
81
  'bHudEnabled': not args.disable_hud,
82
82
  'bEnableLidar': args.enable_lidar,
83
83
  'bEnableCameraSensor': args.enable_camera_sensor
avrs/requests/teleport.py CHANGED
@@ -4,9 +4,9 @@ class Teleport(AvrsApiRequest):
4
4
  def __init__(self, parser, cfg):
5
5
  AvrsApiRequest.__init__(self, parser, cfg, 'Teleport', "Ego")
6
6
  psr = parser.add_parser('teleport', help='Teleports the car to the given x,y,z in either enu or lla.')
7
- psr.add_argument('x', type=float, help='new x position')
8
- psr.add_argument('y', type=float, help='new y position')
9
- psr.add_argument('z', type=float, help='new z position')
7
+ psr.add_argument('x', type=float, help='new x position (NED meters)')
8
+ psr.add_argument('y', type=float, help='new y position (NED meters)')
9
+ psr.add_argument('z', type=float, help='new z position (NED meters)')
10
10
  #psr.add_argument('nav', help='lla or enu coordinate system.', nargs=1, choices=('lla', 'enu'))
11
11
  psr.set_defaults(func=self.send_request)
12
12
 
@@ -0,0 +1,11 @@
1
+ from avrs.requests.request import AvrsApiRequest
2
+
3
+ class AvrsToggleHudRequest(AvrsApiRequest):
4
+ def __init__(self, parser, cfg):
5
+ AvrsApiRequest.__init__(self, parser, cfg, 'ToggleHud', 'Ego')
6
+ psr = parser.add_parser('toggle-hud', help='toggles the HUD on or off')
7
+ psr.set_defaults(func=self.send_request)
8
+
9
+ def get_request_body(self, args):
10
+ return {
11
+ }
@@ -1,3 +1,4 @@
1
+ import random
1
2
  from avrs.requests.request import AvrsApiRequest
2
3
  from argparse import RawDescriptionHelpFormatter
3
4
  from argparse import RawTextHelpFormatter
@@ -9,6 +10,7 @@ class AvrsVehicleReplayRequests():
9
10
  SpawnReplayVehicle(sps, cfg)
10
11
  StartVehicleReplayRecording(sps, cfg)
11
12
  StopVehicleReplayRecording(sps, cfg)
13
+ DespawnReplayVehicle(sps, cfg)
12
14
 
13
15
  class SpawnReplayVehicle(AvrsApiRequest):
14
16
  def __init__(self, parser, cfg):
@@ -23,7 +25,7 @@ class SpawnReplayVehicle(AvrsApiRequest):
23
25
 
24
26
  psr.add_argument(
25
27
  '--name',
26
- default='npc0',
28
+ default='',
27
29
  help='name of the replay vehicle to spawn')
28
30
 
29
31
  psr.add_argument(
@@ -71,6 +73,27 @@ class SpawnReplayVehicle(AvrsApiRequest):
71
73
  action='store_true',
72
74
  help='if set, the npc will begin moving immediately')
73
75
 
76
+ psr.add_argument(
77
+ '--count',
78
+ type=int,
79
+ default=1,
80
+ help='the number of npcs to spawn (only works with automatic name)')
81
+
82
+ psr.add_argument(
83
+ '--enable-front-lidar',
84
+ action='store_true',
85
+ help='if set, will enable the front lidar on the replay vehicle')
86
+
87
+ psr.add_argument(
88
+ '--enable-left-lidar',
89
+ action='store_true',
90
+ help='if set, will enable the left lidar on the replay vehicle')
91
+
92
+ psr.add_argument(
93
+ '--enable-right-lidar',
94
+ action='store_true',
95
+ help='if set, will enable the right lidar on the replay vehicle')
96
+
74
97
  # psr.add_argument(
75
98
  # '--enable-sensors',
76
99
  # type=bool,
@@ -84,6 +107,9 @@ class SpawnReplayVehicle(AvrsApiRequest):
84
107
 
85
108
  psr.set_defaults(func=self.send_request)
86
109
 
110
+ def send_request(self, args):
111
+ for i in range(args.count):
112
+ self.send_http_request(args)
87
113
 
88
114
  def get_request_body(self, args):
89
115
 
@@ -108,39 +134,140 @@ class SpawnReplayVehicle(AvrsApiRequest):
108
134
  "bEnableKistlerCan": False,
109
135
  "bEnableBadeniaCan": False,
110
136
  "bHudEnabled": False,
111
- "bLidarEnabled": False,
137
+ "bLidarEnabled": True,
112
138
  "bCameraEnabled": False,
113
139
  "bPublishInputs": False,
114
140
  "bPublishGroundTruth": False
115
141
  }
116
142
 
143
+ lidar_front_pld = {
144
+ 'componentConfig': {
145
+ 'instanceName': 'lidar_front'
146
+ },
147
+ 'sensorDesc': {
148
+ 'frame': 'lidar_front',
149
+ 'leverarm': {
150
+ 'translation': {
151
+ 'x': 85,
152
+ 'y': 0,
153
+ 'z': 73
154
+ },
155
+ 'translationUnits': 'centimeters',
156
+ 'rotation': {
157
+ 'pitch': 0,
158
+ 'yaw': 0,
159
+ 'roll': 0
160
+ },
161
+ 'rotationUnits': 'degrees'
162
+ },
163
+ 'dataStream': {
164
+ 'streamName': 'lidar_front/points',
165
+ 'rateHz': 15
166
+ }
167
+ }
168
+ }
169
+
170
+ lidar_left_pld = {
171
+ 'componentConfig': {
172
+ 'instanceName': 'lidar_left'
173
+ },
174
+ 'sensorDesc': {
175
+ 'frame': 'lidar_left',
176
+ 'leverarm': {
177
+ 'translation': {
178
+ 'x': 15,
179
+ 'y': -20,
180
+ 'z': 82
181
+ },
182
+ 'translationUnits': 'centimeters',
183
+ 'rotation': {
184
+ 'pitch': 0,
185
+ 'yaw': 240,
186
+ 'roll': 0
187
+ },
188
+ 'rotationUnits': 'degrees'
189
+ },
190
+ 'dataStream': {
191
+ 'streamName': 'lidar_left/points',
192
+ 'rateHz': 15
193
+ }
194
+ }
195
+ }
196
+
197
+ lidar_right_pld = {
198
+ 'componentConfig': {
199
+ 'instanceName': 'lidar_right'
200
+ },
201
+ 'sensorDesc': {
202
+ 'frame': 'lidar_right',
203
+ 'leverarm': {
204
+ 'translation': {
205
+ 'x': 15,
206
+ 'y': 20,
207
+ 'z': 82
208
+ },
209
+ 'translationUnits': 'centimeters',
210
+ 'rotation': {
211
+ 'pitch': 0,
212
+ 'yaw': 120,
213
+ 'roll': 0
214
+ },
215
+ 'rotationUnits': 'degrees'
216
+ },
217
+ 'dataStream': {
218
+ 'streamName': 'lidar_right/points',
219
+ 'rateHz': 15
220
+ }
221
+ }
222
+ }
223
+
117
224
  plds = [
118
225
  {
119
- 'TypeName': 'WheeledVehicleReplayIpd',
120
- 'Body': replay_ipd
226
+ 'typeName': 'WheeledVehicleReplayIpd',
227
+ 'body': replay_ipd
121
228
  },
122
229
  {
123
- 'TypeName': 'Eav24Initializer',
124
- 'Body': eav_init_pld
230
+ 'typeName': 'Eav24Initializer',
231
+ 'body': eav_init_pld
232
+ },
233
+ {
234
+ 'typeName': 'GenericLidarIpd',
235
+ 'bEnabled': args.enable_front_lidar,
236
+ 'body': lidar_front_pld
237
+ },
238
+ {
239
+ 'typeName': 'GenericLidarIpd',
240
+ 'bEnabled': args.enable_left_lidar,
241
+ 'body': lidar_left_pld
242
+ },
243
+ {
244
+ 'typeName': 'GenericLidarIpd',
245
+ 'bEnabled': args.enable_right_lidar,
246
+ 'body': lidar_right_pld
125
247
  }
126
248
  ]
127
249
 
128
250
  if args.with_view_cameras:
129
251
  plds.append(
130
252
  {
131
- 'TypeName': 'InitializerTemplates',
132
- 'Body': {
133
- 'Templates': [
253
+ 'typeName': 'InitializerTemplates',
254
+ 'body': {
255
+ 'templates': [
134
256
  {
135
- 'PayloadType': 'SimViewTargetIpd',
136
- 'PayloadSpec': 'DefaultCarCams'
257
+ 'payloadType': 'SimViewTargetIpd',
258
+ 'payloadSpec': 'DefaultCarCams'
137
259
  }
138
260
  ]
139
261
  }
140
262
  })
141
263
 
264
+ # Create time based name if not specified
265
+ name = args.name
266
+ if name == '':
267
+ name = 'npc_{}'.format(random.randint(0, 100000))
268
+
142
269
  return {
143
- 'Name': args.name,
270
+ 'Name': name,
144
271
  'Type': args.vehicle_type,
145
272
  'Location': {},
146
273
  'Rotation': {},
@@ -189,3 +316,31 @@ class StopVehicleReplayRecording(AvrsApiRequest):
189
316
  return {
190
317
  'recordAction': 'stop',
191
318
  }
319
+
320
+ class DespawnReplayVehicle(AvrsApiRequest):
321
+ def __init__(self, parser, cfg):
322
+ AvrsApiRequest.__init__(self, parser, cfg, 'DespawnObject', 'Ego')
323
+ psr = parser.add_parser(
324
+ 'despawn', help='despawn a replay vehicle or all replay vehicles', formatter_class=RawTextHelpFormatter)
325
+
326
+ psr.add_argument(
327
+ '--name',
328
+ default='',
329
+ help='name of the replay vehicle to despawn')
330
+
331
+ psr.add_argument(
332
+ '--all',
333
+ action='store_true',
334
+ help='if set, will despawn all replay vehicles')
335
+
336
+ psr.set_defaults(func=self.send_request)
337
+
338
+
339
+ def get_request_body(self, args):
340
+ self.target_object_id = args.name
341
+ tags = ["Npc"] if args.all else []
342
+
343
+ return {
344
+ 'tags': tags,
345
+ 'bMatchAnyTag': True
346
+ }