autoverse-cli 0.2.2__py3-none-any.whl → 0.4.0__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- {autoverse_cli-0.2.2.dist-info → autoverse_cli-0.4.0.dist-info}/METADATA +1 -1
- autoverse_cli-0.4.0.dist-info/RECORD +28 -0
- {autoverse_cli-0.2.2.dist-info → autoverse_cli-0.4.0.dist-info}/WHEEL +1 -1
- avrs/app_version.py +1 -1
- avrs/argparse_help.py +30 -0
- avrs/avrs.py +11 -3
- avrs/launcher.py +1 -1
- avrs/requests/code_booz.py +65 -0
- avrs/requests/edit_environment.py +21 -0
- avrs/requests/request.py +1 -1
- avrs/requests/reserve_mv_slot.py +2 -1
- avrs/requests/teleport.py +1 -1
- avrs/requests/vd.py +17 -14
- autoverse_cli-0.2.2.dist-info/RECORD +0 -25
- {autoverse_cli-0.2.2.dist-info → autoverse_cli-0.4.0.dist-info}/LICENSE +0 -0
- {autoverse_cli-0.2.2.dist-info → autoverse_cli-0.4.0.dist-info}/entry_points.txt +0 -0
- {autoverse_cli-0.2.2.dist-info → autoverse_cli-0.4.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,28 @@
|
|
1
|
+
avrs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
+
avrs/app_version.py,sha256=U9S11DYP1oLycncpvTmnWvqUunUHaEDl_O6Elho4iEw,855
|
3
|
+
avrs/argparse_help.py,sha256=EoEaohGXZXqJvs1dFEzbo9vh47CYdHdSY2Im2Ps2iFo,945
|
4
|
+
avrs/avrs.py,sha256=3dP6YE8aB2IGN0wu_FUcRW4fch6h-b97sFcUeF0vfC0,1953
|
5
|
+
avrs/cfg.py,sha256=9NBtPrJjVN7gj_vxlvO4wOEx3OFw4d2qQgLIVLiccD0,701
|
6
|
+
avrs/launcher.py,sha256=OWwIQDgeIwGLgmLnCxv7RbzVfRNLxSbg3eaZLJ2K64s,7467
|
7
|
+
avrs/launcher_util.py,sha256=X60Jd2JUXr1MmdEF0lwjUBC5gHZte9uLlSgLWOLofXc,5121
|
8
|
+
avrs/tests.py,sha256=3JeYBjn0tRqHXERDROfzmYuW1KXeCcKur5Bw-EIegto,153
|
9
|
+
avrs/requests/can.py,sha256=iL2Dsk-V4tm37D-F1QoauaxeQtLAbg5br7zJcoR9h0o,5295
|
10
|
+
avrs/requests/code_booz.py,sha256=5bzT8Ra6EIwI19TqXMxkHG_llnyFgqSzTSo7yLNV9Vc,2274
|
11
|
+
avrs/requests/demo.py,sha256=TksvKX5YmL8-FQ4h7MWwjyIwcaZQrF9vCQ20PdfgS3Q,1138
|
12
|
+
avrs/requests/edit_environment.py,sha256=iITvLHJ4N6m-RE8dC_KnFxoTNKSjQu7ydERfQvVtb58,828
|
13
|
+
avrs/requests/input.py,sha256=SkfVjk3LsOhYNXEwn0rcSS6kZK3g8DXoMPX8Zc9LnCo,1855
|
14
|
+
avrs/requests/log_path.py,sha256=Ur24C9VqPVx78MfpicgQu2uOEe-0dXbGoWF_7dzMtZE,1326
|
15
|
+
avrs/requests/move_to_landmark.py,sha256=cLRBKu9XEDsmCoftBJ8JwoBLqzb0IZsxFMBnus4T-kc,702
|
16
|
+
avrs/requests/npc.py,sha256=Y_WovbcLomCCcOLAMMO_DHZtc1crAzWo97qEIGS3SvU,9691
|
17
|
+
avrs/requests/request.py,sha256=3hbBAt_Kd9n-HuggIbziJ3xs-VcRfLBc2GEFSOQ-LJ4,1512
|
18
|
+
avrs/requests/reserve_mv_slot.py,sha256=p_jiTV7rcoyJU6u3UR9sqPBpSaq8-PWMEs0Ckm2Hf8w,3843
|
19
|
+
avrs/requests/reset_to_track.py,sha256=lSd2YavBxDV_hQMhVoi08_TpTFEq7G2MA18xosFYa1g,450
|
20
|
+
avrs/requests/restart.py,sha256=ih5mnWiU34q3-xhOth45CtOUXxKI0PoMDCnFJV0JbwE,415
|
21
|
+
avrs/requests/teleport.py,sha256=WpnB2-Ii0FGI11EXTAHlaF5zqZIsgEyJnJ2j_w4rDFY,824
|
22
|
+
avrs/requests/vd.py,sha256=at6oUAGY2h0OxYU6MLOi1gnxyUn6i24vL9DUAj0L880,1600
|
23
|
+
autoverse_cli-0.4.0.dist-info/LICENSE,sha256=d4eWXho-u18HkBsX4K21uHX_bBb2UXZSrJdsb7Z_JlM,2647
|
24
|
+
autoverse_cli-0.4.0.dist-info/METADATA,sha256=1ekzIvDf6Hwm5gthZcMYVCzcjFKRC7DIETN7cOCD4ng,3296
|
25
|
+
autoverse_cli-0.4.0.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
26
|
+
autoverse_cli-0.4.0.dist-info/entry_points.txt,sha256=Cb9qsUyU5AKkklehCcvtfT0-N3SXbUEqvjze4iEU5kE,40
|
27
|
+
autoverse_cli-0.4.0.dist-info/top_level.txt,sha256=-AJO2e4MCVej6hY0U84pu5NfMeMW5qaAPSMisDT5rmA,5
|
28
|
+
autoverse_cli-0.4.0.dist-info/RECORD,,
|
avrs/app_version.py
CHANGED
avrs/argparse_help.py
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
import argparse
|
2
|
+
|
3
|
+
def generate_argparse_docs(parser):
|
4
|
+
"""
|
5
|
+
Try to generate a nice markdown with all help from a parser
|
6
|
+
"""
|
7
|
+
s = recursive_get_argparse_help(parser, 'avrs', True)
|
8
|
+
#print(s)
|
9
|
+
|
10
|
+
with open('out.txt', 'w', encoding='utf-8') as f:
|
11
|
+
f.write(s)
|
12
|
+
|
13
|
+
def recursive_get_argparse_help(parser, parent_name, is_root):
|
14
|
+
|
15
|
+
s = ''
|
16
|
+
if not is_root:
|
17
|
+
s += '\n' + '_' * 72 + '\n\n'
|
18
|
+
|
19
|
+
s += '{}\n'.format(parent_name)
|
20
|
+
s += '{}\n'.format(parser.format_help())
|
21
|
+
|
22
|
+
for action in parser._actions:
|
23
|
+
if isinstance(action, argparse._SubParsersAction):
|
24
|
+
#s += '{}\n'.format(dir(action))
|
25
|
+
#s += '{}\n'.format(action._choices_actions)
|
26
|
+
#for a in action._choices_actions:
|
27
|
+
# s += '{}\n'.format(a.dest)
|
28
|
+
for subcmd, subpsr in action.choices.items():
|
29
|
+
s += recursive_get_argparse_help(subpsr, parent_name + ' ' + subcmd, False)
|
30
|
+
return s
|
avrs/avrs.py
CHANGED
@@ -6,6 +6,7 @@ from argparse import RawTextHelpFormatter
|
|
6
6
|
from avrs.app_version import *
|
7
7
|
from avrs.cfg import *
|
8
8
|
from avrs.launcher import *
|
9
|
+
from avrs.argparse_help import *
|
9
10
|
|
10
11
|
from avrs.requests.move_to_landmark import MoveToLandmarkRequest
|
11
12
|
from avrs.requests.restart import Restart
|
@@ -18,6 +19,8 @@ from avrs.requests.vd import Vd
|
|
18
19
|
from avrs.requests.input import InputRequest
|
19
20
|
from avrs.requests.log_path import LogPath
|
20
21
|
from avrs.requests.demo import AvrsDemoRequest
|
22
|
+
from avrs.requests.edit_environment import AvrsEditEnvironmentRequests
|
23
|
+
from avrs.requests.code_booz import *
|
21
24
|
|
22
25
|
|
23
26
|
def get_version():
|
@@ -28,7 +31,7 @@ def main():
|
|
28
31
|
prog='avrs',
|
29
32
|
description='Autoverse CLI',
|
30
33
|
epilog='',
|
31
|
-
formatter_class=
|
34
|
+
formatter_class=RawTextHelpFormatter)
|
32
35
|
|
33
36
|
version_psr = parser.add_argument(
|
34
37
|
'--version',
|
@@ -54,11 +57,16 @@ def main():
|
|
54
57
|
Vd(sps, cfg)
|
55
58
|
#InputRequest(sps, cfg)
|
56
59
|
LogPath(sps, cfg)
|
57
|
-
|
58
|
-
|
60
|
+
AvrsEditEnvironmentRequests(sps, cfg)
|
61
|
+
AvrsCodeBoozRequest(sps, cfg)
|
62
|
+
AvrsDemoRequest(sps, cfg)
|
63
|
+
|
64
|
+
if os.environ.get('AVRS_GEN_DOCS', '0') == '1':
|
65
|
+
generate_argparse_docs(parser)
|
59
66
|
|
60
67
|
args = parser.parse_args()
|
61
68
|
args.func(args)
|
62
69
|
|
70
|
+
|
63
71
|
if __name__ == '__main__':
|
64
72
|
main()
|
avrs/launcher.py
CHANGED
@@ -11,7 +11,7 @@ class AvrsLauncher:
|
|
11
11
|
self.cfg = cfg
|
12
12
|
provision_parser = parent_parser.add_parser(
|
13
13
|
'launcher',
|
14
|
-
help='launcher operations, such as license registration or updating a sim install')
|
14
|
+
help='launcher operations, such as license registration or updating a sim install\n\n')
|
15
15
|
sps = provision_parser.add_subparsers(required=True, help='launcher options')
|
16
16
|
|
17
17
|
register_license_psr = sps.add_parser(
|
@@ -0,0 +1,65 @@
|
|
1
|
+
from avrs.requests.request import AvrsApiRequest
|
2
|
+
from argparse import RawTextHelpFormatter
|
3
|
+
|
4
|
+
class AvrsCodeBoozRequest():
|
5
|
+
def __init__(self, parent_parser, cfg):
|
6
|
+
psr = parent_parser.add_parser(
|
7
|
+
'lwi',
|
8
|
+
help='light-weight interface logging options\n\n')
|
9
|
+
sps = psr.add_subparsers(required=True, help='light-wieght interface logging options')
|
10
|
+
|
11
|
+
AvrsCodeBoozStartLogging(sps, cfg)
|
12
|
+
AvrsCodeBoozStopLogging(sps, cfg)
|
13
|
+
AvrsCodeBoozGetTimes(sps, cfg)
|
14
|
+
|
15
|
+
class AvrsCodeBoozStartLogging(AvrsApiRequest):
|
16
|
+
def __init__(self, parser, cfg):
|
17
|
+
AvrsApiRequest.__init__(self, parser, cfg, 'CodeBoozLog', 'Ego')
|
18
|
+
psr = parser.add_parser(
|
19
|
+
'start-log', help='starts logging', formatter_class=RawTextHelpFormatter)
|
20
|
+
|
21
|
+
psr.add_argument(
|
22
|
+
'out_file',
|
23
|
+
help='the name of the log file to create (within the \"Saved\" directory)')
|
24
|
+
|
25
|
+
psr.add_argument(
|
26
|
+
'--format', choices=('binary', 'csv'), default='binary', help='the format to save logged data')
|
27
|
+
|
28
|
+
psr.add_argument(
|
29
|
+
'--rate-hz', type=float, default=100.0, help='the rate in hz to log data')
|
30
|
+
|
31
|
+
psr.set_defaults(func=self.send_request)
|
32
|
+
|
33
|
+
def get_request_body(self, args):
|
34
|
+
return {
|
35
|
+
'Action': 'Start',
|
36
|
+
'FileName': args.out_file,
|
37
|
+
'RateHz': args.rate_hz,
|
38
|
+
'Format': args.format
|
39
|
+
}
|
40
|
+
|
41
|
+
class AvrsCodeBoozStopLogging(AvrsApiRequest):
|
42
|
+
def __init__(self, parser, cfg):
|
43
|
+
AvrsApiRequest.__init__(self, parser, cfg, 'CodeBoozLog', 'Ego')
|
44
|
+
psr = parser.add_parser(
|
45
|
+
'stop-log', help='starts logging', formatter_class=RawTextHelpFormatter)
|
46
|
+
|
47
|
+
psr.set_defaults(func=self.send_request)
|
48
|
+
|
49
|
+
def get_request_body(self, args):
|
50
|
+
return {
|
51
|
+
'Action': 'Stop'
|
52
|
+
}
|
53
|
+
|
54
|
+
class AvrsCodeBoozGetTimes(AvrsApiRequest):
|
55
|
+
def __init__(self, parser, cfg):
|
56
|
+
AvrsApiRequest.__init__(self, parser, cfg, 'CodeBoozLog', 'Ego')
|
57
|
+
psr = parser.add_parser(
|
58
|
+
'get-times', help='starts logging', formatter_class=RawTextHelpFormatter)
|
59
|
+
|
60
|
+
psr.set_defaults(func=self.send_request)
|
61
|
+
|
62
|
+
def get_request_body(self, args):
|
63
|
+
return {
|
64
|
+
'Action': 'GetTimes'
|
65
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
from avrs.requests.request import AvrsApiRequest
|
2
|
+
|
3
|
+
class AvrsEditEnvironmentRequests():
|
4
|
+
def __init__(self, parser, cfg):
|
5
|
+
psr = parser.add_parser('edit-environment', help='Edits the environment')
|
6
|
+
sps = psr.add_subparsers(required= True, help='')
|
7
|
+
AvrsSetTimeOfDayRequest(sps, cfg)
|
8
|
+
|
9
|
+
|
10
|
+
class AvrsSetTimeOfDayRequest(AvrsApiRequest):
|
11
|
+
def __init__(self, parser, cfg):
|
12
|
+
AvrsApiRequest.__init__(self, parser, cfg, 'SetTimeOfDay', '')
|
13
|
+
psr = parser.add_parser('set-time-of-day', help='sets the current time of day')
|
14
|
+
psr.add_argument('tod', type=float, help='The time of day (0-24) to set')
|
15
|
+
psr.set_defaults(func=self.send_request)
|
16
|
+
|
17
|
+
def get_request_body(self, args):
|
18
|
+
self.target_object_id = ''
|
19
|
+
return {
|
20
|
+
'TimeOfDay': args.tod
|
21
|
+
}
|
avrs/requests/request.py
CHANGED
@@ -35,7 +35,7 @@ class AvrsApiRequest:
|
|
35
35
|
# print('{}'.format(response))
|
36
36
|
|
37
37
|
def send_http_request(self, args):
|
38
|
-
connection = http.client.HTTPConnection("localhost", 30313, timeout=
|
38
|
+
connection = http.client.HTTPConnection("localhost", 30313, timeout=10)
|
39
39
|
headers = {'Content-type': 'application/json'}
|
40
40
|
body = json.dumps(self.get_request(args)).encode('utf-8')
|
41
41
|
connection.request('POST', '/post', body, headers)
|
avrs/requests/reserve_mv_slot.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
from avrs.requests.request import AvrsApiRequest
|
2
|
+
from argparse import RawTextHelpFormatter
|
2
3
|
|
3
4
|
RESERVE_MV_SLOT_HELP = '''
|
4
5
|
slot (if an open slot exists, there are 4 total) using the given name to add a new vehicle and the appropriate topics.
|
@@ -19,7 +20,7 @@ MV_LANDMARKS = [
|
|
19
20
|
class ReserveMvSlot(AvrsApiRequest):
|
20
21
|
def __init__(self, parser, cfg):
|
21
22
|
AvrsApiRequest.__init__(self, parser, cfg, 'SpawnObject', 0)
|
22
|
-
psr = parser.add_parser('reserve-mv-slot', help=RESERVE_MV_SLOT_HELP)
|
23
|
+
psr = parser.add_parser('reserve-mv-slot', help=RESERVE_MV_SLOT_HELP, formatter_class=RawTextHelpFormatter)
|
23
24
|
|
24
25
|
psr.add_argument(
|
25
26
|
'slot_name',
|
avrs/requests/teleport.py
CHANGED
@@ -2,7 +2,7 @@ from avrs.requests.request import AvrsApiRequest
|
|
2
2
|
|
3
3
|
class Teleport(AvrsApiRequest):
|
4
4
|
def __init__(self, parser, cfg):
|
5
|
-
AvrsApiRequest.__init__(self, parser, cfg, 'Teleport', "
|
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
7
|
psr.add_argument('x', type=float, help='new x position')
|
8
8
|
psr.add_argument('y', type=float, help='new y position')
|
avrs/requests/vd.py
CHANGED
@@ -5,29 +5,32 @@ class Vd():
|
|
5
5
|
psr = parser.add_parser('vd', help='Vehicle dynamic options')
|
6
6
|
sps = psr.add_subparsers(required= True, help='sub-command of vd')
|
7
7
|
SetFrictionModifier(sps, cfg)
|
8
|
-
SlipModel(sps, cfg)
|
8
|
+
#SlipModel(sps, cfg)
|
9
9
|
|
10
10
|
class SetFrictionModifier(AvrsApiRequest):
|
11
11
|
def __init__(self, parser, cfg):
|
12
|
-
AvrsApiRequest.__init__(self, parser, cfg, 'SetFrictionModifiers',
|
12
|
+
AvrsApiRequest.__init__(self, parser, cfg, 'SetFrictionModifiers', 'Ego')
|
13
13
|
psr = parser.add_parser('set-friction-modifier', help='Change the amount of grip the car has.'
|
14
14
|
+ '0 is no grip and higher values will prevent spinning')
|
15
|
-
psr.add_argument('modifier
|
15
|
+
psr.add_argument('modifier', type = float, help = "Modified grip value")
|
16
|
+
psr.add_argument('tires', help = "Tires to apply the modifier to",
|
17
|
+
choices=("FL", "FR", "RL", "RR", "F", "R", "All"))
|
16
18
|
psr.set_defaults(func=self.send_request)
|
17
19
|
|
18
20
|
def get_request_body(self, args):
|
19
21
|
return {
|
20
|
-
'
|
22
|
+
'NewModifier': args.modifier,
|
23
|
+
'Tires': args.tires
|
21
24
|
}
|
22
25
|
|
23
|
-
class SlipModel(AvrsApiRequest):
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
26
|
+
# class SlipModel(AvrsApiRequest):
|
27
|
+
# def __init__(self, parser, cfg):
|
28
|
+
# AvrsApiRequest.__init__(self, parser, cfg, 'SlipModel', 'Ego')
|
29
|
+
# psr = parser.add_parser('slip-model', help='Change the tire slip model to be pure slip only or combined slip')
|
30
|
+
# psr.add_argument('slip', choices = ['pure-slip, combined-slip'], help = 'type of slip')
|
31
|
+
# psr.set_defaults(func=self.send_request)
|
29
32
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
33
|
+
# def get_request_body(self, args):
|
34
|
+
# return {
|
35
|
+
# 'Modifier Value': args.slip
|
36
|
+
# }
|
@@ -1,25 +0,0 @@
|
|
1
|
-
avrs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
avrs/app_version.py,sha256=U9hQoruuiDrNwt2W27Djpg9aArBcECPkxFYceXjs0O8,855
|
3
|
-
avrs/avrs.py,sha256=zkpQRKRFdhN6rmdRGQDPIU6vA5DSH8GZmmEm_w1y3Ro,1655
|
4
|
-
avrs/cfg.py,sha256=9NBtPrJjVN7gj_vxlvO4wOEx3OFw4d2qQgLIVLiccD0,701
|
5
|
-
avrs/launcher.py,sha256=tysm0CHZQ_l5Etj-PtfQoG6VYIWFHSdASBmE6api-_g,7463
|
6
|
-
avrs/launcher_util.py,sha256=X60Jd2JUXr1MmdEF0lwjUBC5gHZte9uLlSgLWOLofXc,5121
|
7
|
-
avrs/tests.py,sha256=3JeYBjn0tRqHXERDROfzmYuW1KXeCcKur5Bw-EIegto,153
|
8
|
-
avrs/requests/can.py,sha256=iL2Dsk-V4tm37D-F1QoauaxeQtLAbg5br7zJcoR9h0o,5295
|
9
|
-
avrs/requests/demo.py,sha256=TksvKX5YmL8-FQ4h7MWwjyIwcaZQrF9vCQ20PdfgS3Q,1138
|
10
|
-
avrs/requests/input.py,sha256=SkfVjk3LsOhYNXEwn0rcSS6kZK3g8DXoMPX8Zc9LnCo,1855
|
11
|
-
avrs/requests/log_path.py,sha256=Ur24C9VqPVx78MfpicgQu2uOEe-0dXbGoWF_7dzMtZE,1326
|
12
|
-
avrs/requests/move_to_landmark.py,sha256=cLRBKu9XEDsmCoftBJ8JwoBLqzb0IZsxFMBnus4T-kc,702
|
13
|
-
avrs/requests/npc.py,sha256=Y_WovbcLomCCcOLAMMO_DHZtc1crAzWo97qEIGS3SvU,9691
|
14
|
-
avrs/requests/request.py,sha256=d0DB8tXXK9iQI-j5WmCNWA0f_8B6zU6gWeTLNHpwh_w,1511
|
15
|
-
avrs/requests/reserve_mv_slot.py,sha256=51MuiQgu22NF4wl-Y-0wjvozIpe1GPBBk_QfvG7FS4k,3763
|
16
|
-
avrs/requests/reset_to_track.py,sha256=lSd2YavBxDV_hQMhVoi08_TpTFEq7G2MA18xosFYa1g,450
|
17
|
-
avrs/requests/restart.py,sha256=ih5mnWiU34q3-xhOth45CtOUXxKI0PoMDCnFJV0JbwE,415
|
18
|
-
avrs/requests/teleport.py,sha256=Y0pAQ4DjqtWTkr_E1QDvvl22EiTpoA4u69dhks0qcZw,825
|
19
|
-
avrs/requests/vd.py,sha256=ZF00jJ0VUVPwnLABp_LiDg3UDC4kvxeLg1dqh7wJrzQ,1414
|
20
|
-
autoverse_cli-0.2.2.dist-info/LICENSE,sha256=d4eWXho-u18HkBsX4K21uHX_bBb2UXZSrJdsb7Z_JlM,2647
|
21
|
-
autoverse_cli-0.2.2.dist-info/METADATA,sha256=UjxxLOrJR4OdjhDow-dLGzbjEgrZQxvauA87bxbiNq4,3296
|
22
|
-
autoverse_cli-0.2.2.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
|
23
|
-
autoverse_cli-0.2.2.dist-info/entry_points.txt,sha256=Cb9qsUyU5AKkklehCcvtfT0-N3SXbUEqvjze4iEU5kE,40
|
24
|
-
autoverse_cli-0.2.2.dist-info/top_level.txt,sha256=-AJO2e4MCVej6hY0U84pu5NfMeMW5qaAPSMisDT5rmA,5
|
25
|
-
autoverse_cli-0.2.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|