autoverse-cli 0.5.0__py3-none-any.whl → 0.6.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.6.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=MRoy99DwudgXSSMa5eP0kVNc3PCETDrhmmPJC6NtIc8,855
3
3
  avrs/argparse_help.py,sha256=EoEaohGXZXqJvs1dFEzbo9vh47CYdHdSY2Im2Ps2iFo,945
4
- avrs/avrs.py,sha256=_lz9eYgDCEAk7atb-m5BofGWdi84MtZhiyGl4gHUKkI,2530
4
+ avrs/avrs.py,sha256=6fV-br7njgk1fOmv2G2gz0JDqBMpz_OhecZRojG4B-c,2685
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,28 @@ 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/change_camera.py,sha256=twqdE049DHwdjgKFZbindwpK7Oz-ivCjbI8WQj8QsxI,416
13
14
  avrs/requests/code_booz.py,sha256=5bzT8Ra6EIwI19TqXMxkHG_llnyFgqSzTSo7yLNV9Vc,2274
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
17
18
  avrs/requests/list_sim_objects.py,sha256=YWpqHdCHijerPxI5606_KjeFvezcLFN33wO4YOr9G3U,977
18
19
  avrs/requests/log_path.py,sha256=Ur24C9VqPVx78MfpicgQu2uOEe-0dXbGoWF_7dzMtZE,1326
19
20
  avrs/requests/move_to_landmark.py,sha256=cLRBKu9XEDsmCoftBJ8JwoBLqzb0IZsxFMBnus4T-kc,702
20
21
  avrs/requests/npc.py,sha256=Y_WovbcLomCCcOLAMMO_DHZtc1crAzWo97qEIGS3SvU,9691
21
- avrs/requests/request.py,sha256=qRSB54LC_UANf2kSbxI2zqQPOguoxg6O5_nUw4iW3dM,1607
22
+ avrs/requests/request.py,sha256=1g_0NLpKRRdHW10LAPa9N1jW3zZSdq8yUQFeAPyErtE,1595
22
23
  avrs/requests/reserve_mv_slot.py,sha256=p_jiTV7rcoyJU6u3UR9sqPBpSaq8-PWMEs0Ckm2Hf8w,3843
23
24
  avrs/requests/reset_to_track.py,sha256=lSd2YavBxDV_hQMhVoi08_TpTFEq7G2MA18xosFYa1g,450
24
25
  avrs/requests/restart.py,sha256=ih5mnWiU34q3-xhOth45CtOUXxKI0PoMDCnFJV0JbwE,415
25
26
  avrs/requests/scenario_control.py,sha256=u-KQx-mdCm6IE_c88a6iEgWUsZZVOayxBo58Ocjg0ZI,1502
26
27
  avrs/requests/teleport.py,sha256=WpnB2-Ii0FGI11EXTAHlaF5zqZIsgEyJnJ2j_w4rDFY,824
28
+ avrs/requests/toggle_hud.py,sha256=sV5t5QZc4uvRihPVk8jEKZiQNsyF9tsUwq5b4jjZplc,397
27
29
  avrs/requests/vd.py,sha256=at6oUAGY2h0OxYU6MLOi1gnxyUn6i24vL9DUAj0L880,1600
28
30
  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,,
31
+ avrs/requests/vehicle_replay.py,sha256=wlfkieaSrpXZCsyjtM6fociRXWpBLGZXhaJAS1sNS0o,7603
32
+ autoverse_cli-0.6.0.dist-info/LICENSE,sha256=d4eWXho-u18HkBsX4K21uHX_bBb2UXZSrJdsb7Z_JlM,2647
33
+ autoverse_cli-0.6.0.dist-info/METADATA,sha256=a4uddOOnI-EuiR0BH9prt_l7aLEPJXVjJ1CouGs5bdU,3341
34
+ autoverse_cli-0.6.0.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
35
+ autoverse_cli-0.6.0.dist-info/entry_points.txt,sha256=Cb9qsUyU5AKkklehCcvtfT0-N3SXbUEqvjze4iEU5kE,40
36
+ autoverse_cli-0.6.0.dist-info/top_level.txt,sha256=-AJO2e4MCVej6hY0U84pu5NfMeMW5qaAPSMisDT5rmA,5
37
+ autoverse_cli-0.6.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.2.0)
2
+ Generator: setuptools (75.3.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.6.0'
6
6
 
7
7
  def check_app_is_latest():
8
8
  pass
avrs/avrs.py CHANGED
@@ -25,6 +25,8 @@ 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 *
29
31
 
30
32
 
@@ -74,6 +76,8 @@ def main():
74
76
  AvrsScenarioRequests(sps, cfg)
75
77
  AvrsListSimObjectsRequest(sps, cfg)
76
78
  AvrsFaultInjectionRequests(sps, cfg)
79
+ AvrsChangeCameraRequest(sps, cfg)
80
+ AvrsToggleHudRequest(sps, cfg)
77
81
 
78
82
  if os.environ.get('AVRS_WITH_DEMO', '0') == '1':
79
83
  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
+ }
@@ -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
  }
avrs/requests/request.py CHANGED
@@ -14,7 +14,7 @@ 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,
@@ -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,12 @@ 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
+
74
82
  # psr.add_argument(
75
83
  # '--enable-sensors',
76
84
  # type=bool,
@@ -84,6 +92,9 @@ class SpawnReplayVehicle(AvrsApiRequest):
84
92
 
85
93
  psr.set_defaults(func=self.send_request)
86
94
 
95
+ def send_request(self, args):
96
+ for i in range(args.count):
97
+ self.send_http_request(args)
87
98
 
88
99
  def get_request_body(self, args):
89
100
 
@@ -139,8 +150,13 @@ class SpawnReplayVehicle(AvrsApiRequest):
139
150
  }
140
151
  })
141
152
 
153
+ # Create time based name if not specified
154
+ name = args.name
155
+ if name == '':
156
+ name = 'npc_{}'.format(random.randint(0, 100000))
157
+
142
158
  return {
143
- 'Name': args.name,
159
+ 'Name': name,
144
160
  'Type': args.vehicle_type,
145
161
  'Location': {},
146
162
  'Rotation': {},
@@ -189,3 +205,31 @@ class StopVehicleReplayRecording(AvrsApiRequest):
189
205
  return {
190
206
  'recordAction': 'stop',
191
207
  }
208
+
209
+ class DespawnReplayVehicle(AvrsApiRequest):
210
+ def __init__(self, parser, cfg):
211
+ AvrsApiRequest.__init__(self, parser, cfg, 'DespawnObject', 'Ego')
212
+ psr = parser.add_parser(
213
+ 'despawn', help='despawn a replay vehicle or all replay vehicles', formatter_class=RawTextHelpFormatter)
214
+
215
+ psr.add_argument(
216
+ '--name',
217
+ default='',
218
+ help='name of the replay vehicle to despawn')
219
+
220
+ psr.add_argument(
221
+ '--all',
222
+ action='store_true',
223
+ help='if set, will despawn all replay vehicles')
224
+
225
+ psr.set_defaults(func=self.send_request)
226
+
227
+
228
+ def get_request_body(self, args):
229
+ self.target_object_id = args.name
230
+ tags = ["Npc"] if args.all else []
231
+
232
+ return {
233
+ 'tags': tags,
234
+ 'bMatchAnyTag': True
235
+ }