autoverse-cli 0.7.0__py3-none-any.whl → 0.8.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.7.0
3
+ Version: 0.8.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,14 +1,14 @@
1
1
  avrs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- avrs/app_version.py,sha256=bO0-qxfSWvkZgYy9nV11HSq5gNRuKteUi2-YrsSoTwM,855
2
+ avrs/app_version.py,sha256=VfRTIcA5zw19bJnPtFiKisskuTewdBFE9HveNWqihT8,855
3
3
  avrs/argparse_help.py,sha256=EoEaohGXZXqJvs1dFEzbo9vh47CYdHdSY2Im2Ps2iFo,945
4
- avrs/avrs.py,sha256=9DfUzBn3yuCUTVs2Mx_hYgznEAHbErHqGXShCIO4Iqg,2844
4
+ avrs/avrs.py,sha256=M1DMvsUirNYZpIsiPH50ZhMwuZVefB4NjErLjkYbFbQ,2915
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
8
8
  avrs/launcher.py,sha256=u7COEMvvkqxeGyW0kd2m6KK4375nWY5ONO4TxKJ2Xt4,7710
9
9
  avrs/launcher_util.py,sha256=y_F2YvIe81l3B1_lCjpoOgkbE4hAr2C9eaPio0es34o,5236
10
- avrs/simconfig.py,sha256=CtpIeU32Lfsek37Z4XR4mjSKwF27IlYvC92184VOuuQ,2389
11
- avrs/simconfig_util.py,sha256=R3ggjx1fIdOAHpUroNLjH6gg0G07PbFTI4PfwUOWtdw,2277
10
+ avrs/simconfig.py,sha256=UZc4FrxVHUkk2e9IglSpuojXkaL_nPrJW7trbEGgOOo,2907
11
+ avrs/simconfig_util.py,sha256=0LKYr6pS1CAHQq0esIWEEvhAa6-BB5-jQ9mnVBY5eq4,4839
12
12
  avrs/tests.py,sha256=3JeYBjn0tRqHXERDROfzmYuW1KXeCcKur5Bw-EIegto,153
13
13
  avrs/requests/change_camera.py,sha256=twqdE049DHwdjgKFZbindwpK7Oz-ivCjbI8WQj8QsxI,416
14
14
  avrs/requests/code_booz.py,sha256=SXaEAMTqID4lf1o_4Cc1wY9609X-dNcfNa-UZv3FWF4,2471
@@ -18,7 +18,7 @@ avrs/requests/fault_injection.py,sha256=EkpjPCx-UtrNbAR_vQS1zaGKN49UDCyYOoVcdlP1
18
18
  avrs/requests/get_object_config.py,sha256=Mkwp32lfskQERsqfmAgHi4vf4C0hfjg6Ru8UjyMt3cw,654
19
19
  avrs/requests/list_sim_objects.py,sha256=YWpqHdCHijerPxI5606_KjeFvezcLFN33wO4YOr9G3U,977
20
20
  avrs/requests/log_path.py,sha256=Ur24C9VqPVx78MfpicgQu2uOEe-0dXbGoWF_7dzMtZE,1326
21
- avrs/requests/misc.py,sha256=PpoyCsFID7PyoW1M6wjDQ7Mcf-dyCtJwIuiWu0tWFQg,431
21
+ avrs/requests/misc.py,sha256=lejEFt5aB6tbfKXHI1DGwP4fsntFIv16NXO23R6Bfhw,1423
22
22
  avrs/requests/move_to_landmark.py,sha256=cLRBKu9XEDsmCoftBJ8JwoBLqzb0IZsxFMBnus4T-kc,702
23
23
  avrs/requests/npc.py,sha256=Y_WovbcLomCCcOLAMMO_DHZtc1crAzWo97qEIGS3SvU,9691
24
24
  avrs/requests/request.py,sha256=eUorvMKuKn7OuxjLCty40CX_uE0v1o6xfqsNO5cGvt8,1611
@@ -26,14 +26,14 @@ avrs/requests/reserve_mv_slot.py,sha256=ejB_RSZBXCpxY7B_2f66Or8twKdMI1gn9nEQgZ2Y
26
26
  avrs/requests/reset_to_track.py,sha256=lSd2YavBxDV_hQMhVoi08_TpTFEq7G2MA18xosFYa1g,450
27
27
  avrs/requests/restart.py,sha256=ih5mnWiU34q3-xhOth45CtOUXxKI0PoMDCnFJV0JbwE,415
28
28
  avrs/requests/scenario_control.py,sha256=u-KQx-mdCm6IE_c88a6iEgWUsZZVOayxBo58Ocjg0ZI,1502
29
- avrs/requests/teleport.py,sha256=X4OfUOWXiAaG9d6iRxb5xL9XpFXYG8waQRp0Ar8BR48,863
29
+ avrs/requests/teleport.py,sha256=fzBmlqaCuV6-R79co__Q8Wpu4ozmEXFh8EGZKs8l8Io,1140
30
30
  avrs/requests/toggle_hud.py,sha256=sV5t5QZc4uvRihPVk8jEKZiQNsyF9tsUwq5b4jjZplc,397
31
31
  avrs/requests/vd.py,sha256=at6oUAGY2h0OxYU6MLOi1gnxyUn6i24vL9DUAj0L880,1600
32
32
  avrs/requests/vehicle_input.py,sha256=R1b1xkRtOBkwyU6OSN4bWVlYsIUroZG0WKbYbc4pEH8,729
33
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,,
34
+ autoverse_cli-0.8.0.dist-info/LICENSE,sha256=d4eWXho-u18HkBsX4K21uHX_bBb2UXZSrJdsb7Z_JlM,2647
35
+ autoverse_cli-0.8.0.dist-info/METADATA,sha256=vdZQYRfoWOavizoc0npEuZ90biZxStbIdERPpxmt88E,3341
36
+ autoverse_cli-0.8.0.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
37
+ autoverse_cli-0.8.0.dist-info/entry_points.txt,sha256=Cb9qsUyU5AKkklehCcvtfT0-N3SXbUEqvjze4iEU5kE,40
38
+ autoverse_cli-0.8.0.dist-info/top_level.txt,sha256=-AJO2e4MCVej6hY0U84pu5NfMeMW5qaAPSMisDT5rmA,5
39
+ autoverse_cli-0.8.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.5.0)
2
+ Generator: setuptools (75.6.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.7.0'
5
+ return '0.8.0'
6
6
 
7
7
  def check_app_is_latest():
8
8
  pass
avrs/avrs.py CHANGED
@@ -82,6 +82,8 @@ def main():
82
82
  AvrsToggleHudRequest(sps, cfg)
83
83
  AvrsGetObjectConfigRequest(sps, cfg)
84
84
  AvrsGetSimVersionRequest(sps, cfg)
85
+ AvrsPingRequest(sps, cfg)
86
+ AvrsConfigureSimLodRequest(sps, cfg)
85
87
 
86
88
  if os.environ.get('AVRS_WITH_DEMO', '0') == '1':
87
89
  AvrsDemoRequest(sps, cfg)
avrs/requests/misc.py CHANGED
@@ -8,4 +8,33 @@ class AvrsGetSimVersionRequest(AvrsApiRequest):
8
8
 
9
9
  def get_request_body(self, args):
10
10
  return {
11
+ }
12
+
13
+ class AvrsPingRequest(AvrsApiRequest):
14
+ def __init__(self, parser, cfg):
15
+ AvrsApiRequest.__init__(self, parser, cfg, 'GetVersion', 0)
16
+ psr = parser.add_parser('ping', help='ping the simulator to see if it is running and responsive')
17
+ psr.set_defaults(func=self.send_ping)
18
+
19
+ def send_ping(self, args):
20
+ try:
21
+ self.send_http_request(args)
22
+ except:
23
+ print('no')
24
+
25
+ class AvrsConfigureSimLodRequest(AvrsApiRequest):
26
+ def __init__(self, parser, cfg):
27
+ AvrsApiRequest.__init__(self, parser, cfg, 'ConfigureSimLod', 'lodctrl')
28
+ psr = parser.add_parser('set-lod', help='set the LOD of the sim, possibly reducing GPU overhead')
29
+
30
+ psr.add_argument(
31
+ 'lod',
32
+ type=int,
33
+ help='the new lod level to set. 0 is max lod, 1 is min lod')
34
+
35
+ psr.set_defaults(func=self.send_request)
36
+
37
+ def get_request_body(self, args):
38
+ return {
39
+ 'newLod': args.lod
11
40
  }
avrs/requests/teleport.py CHANGED
@@ -4,10 +4,11 @@ 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 (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
- #psr.add_argument('nav', help='lla or enu coordinate system.', nargs=1, choices=('lla', 'enu'))
7
+ psr.add_argument('x', type=float, help='new x position (NED meters) or latitude (if frame is set to lla)')
8
+ psr.add_argument('y', type=float, help='new y position (NED meters) or longitude (if frame is set to lla)')
9
+ psr.add_argument('z', type=float, help='new z position (NED meters) or altitude (if frame is set to lla)')
10
+ psr.add_argument('--yaw', type=float, default=0.0, help='the yaw in degrees (0 north, + CW) to apply post teleport')
11
+ psr.add_argument('--frame', choices=['lla', 'ned'], default='ned', help='LLA or NED coordinate system.')
11
12
  psr.set_defaults(func=self.send_request)
12
13
 
13
14
 
@@ -15,6 +16,7 @@ class Teleport(AvrsApiRequest):
15
16
  return {
16
17
  "X": args.x,
17
18
  "Y": args.y,
18
- "Z": args.z
19
- #'NavFrame': args.nav
19
+ "Z": args.z,
20
+ "yaw": args.yaw,
21
+ "NavFrame": args.frame
20
22
  }
avrs/simconfig.py CHANGED
@@ -15,6 +15,17 @@ class AvrsSimConfig:
15
15
 
16
16
  sps = sim_config_parser.add_subparsers(required=True, help='sim-config options')
17
17
 
18
+ compare_parser = sps.add_parser(
19
+ 'compare-configs',
20
+ help='compare two sets of configuration files')
21
+ compare_parser.add_argument(
22
+ 'a',
23
+ help='the path to the first set of config files')
24
+ compare_parser.add_argument(
25
+ 'b',
26
+ help='the path to the second set of config files')
27
+ compare_parser.set_defaults(func=self.compare_configs)
28
+
18
29
  apply_preset_parser = sps.add_parser(
19
30
  'apply-preset',
20
31
  help='apply a preset configuration for a certain use-case')
@@ -58,4 +69,7 @@ the target
58
69
  return
59
70
 
60
71
  print('applying preset {} to sim install at {}'.format(args.preset_name, sim_path))
61
- apply_simconfig_preset(get_sim_saved_dir(sim_path), args.preset_name)
72
+ apply_simconfig_preset(get_sim_saved_dir(sim_path), args.preset_name)
73
+
74
+ def compare_configs(self, args):
75
+ compare_simconfig_defaults(args.a, args.b)
avrs/simconfig_util.py CHANGED
@@ -28,6 +28,82 @@ class SimConfigFiles():
28
28
  with open(path, 'w', encoding='utf-8') as f:
29
29
  json.dump(self.files[name], f, ensure_ascii=False, indent=4)
30
30
 
31
+ def compare_simconfig_defaults(sim_saved_dir, new_defaults_dir):
32
+ old_cfg_files = SimConfigFiles(sim_saved_dir)
33
+ new_cfg_files = SimConfigFiles(new_defaults_dir)
34
+
35
+ ok, status = old_cfg_files.valdiate()
36
+ if not ok:
37
+ print(status)
38
+ return
39
+ ok, status = new_cfg_files.valdiate()
40
+ if not ok:
41
+ print(status)
42
+ return
43
+
44
+ print('comparing config files at {} with those at {}'.format(
45
+ sim_saved_dir, new_defaults_dir))
46
+
47
+ out_cpr = {}
48
+ compare_dicts(old_cfg_files.files['main'], new_cfg_files.files['main'], 'main', out_cpr)
49
+
50
+ #print('{}'.format(out_cpr))
51
+ print_simconfig_compare(out_cpr['main'])
52
+
53
+ def print_simconfig_compare(cpr):
54
+ for i in cpr['only_a']:
55
+ print('{} in a ({}) but not b'.format(i[0], i[1]))
56
+ for i in cpr['only_b']:
57
+ print('{} in b ({}) but not a'.format(i[0], i[1]))
58
+ for i in cpr['type_mismatch']:
59
+ print('{} ({}) does not match type {} ({})'.format(i[0], i[1], i[0], i[2]))
60
+ for i in cpr['value_mismatch']:
61
+ print('{} ({}) value does not match ({})'.format(i[0], i[1], i[2]))
62
+
63
+ for key, value in cpr['sub'].items():
64
+ print_simconfig_compare(value)
65
+
66
+ def compare_dicts(a, b, parent_key, out_checks):
67
+
68
+ only_a = []
69
+ only_b = []
70
+ type_mismatch = []
71
+ value_mismatch = []
72
+
73
+ out_checks[parent_key] = {}
74
+ out_checks[parent_key]['sub'] = {}
75
+
76
+
77
+ for key, value in a.items():
78
+ key_chain = '{}.{}'.format(parent_key, key)
79
+ if key not in b:
80
+ only_a.append((key_chain, value))
81
+ else:
82
+ if type(value) != type(b[key]):
83
+ type_mismatch.append((key_chain, type(value), type(b[key])))
84
+ elif isinstance(value, dict):
85
+ compare_dicts(value, b[key], key_chain, out_checks[parent_key]['sub'])
86
+ elif value != b[key]:
87
+ value_mismatch.append((key_chain, value, b[key]))
88
+
89
+ for key, value in b.items():
90
+ key_chain = '{}.{}'.format(parent_key, key)
91
+ if key not in a:
92
+ only_b.append((key_chain, value))
93
+
94
+ out_checks[parent_key]['only_a'] = only_a
95
+ out_checks[parent_key]['only_b'] = only_b
96
+ out_checks[parent_key]['type_mismatch'] = type_mismatch
97
+ out_checks[parent_key]['value_mismatch'] = value_mismatch
98
+
99
+ #print('only a \n {} \n\n'.format(only_a))
100
+ #print('only b \n {} \n\n'.format(only_b))
101
+ #print('type mismatch \n {} \n\n'.format(type_mismatch))
102
+ #print('value mismatch \n {} \n\n'.format(value_mismatch))
103
+ #print('sub_checks')
104
+
105
+
106
+
31
107
  def apply_simconfig_preset(sim_saved_dir, preset_name):
32
108
  cfg_files = SimConfigFiles(sim_saved_dir)
33
109
  ok, status = cfg_files.valdiate()