autoverse-cli 0.28.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- autoverse_cli-0.28.1.dist-info/METADATA +91 -0
- autoverse_cli-0.28.1.dist-info/RECORD +51 -0
- autoverse_cli-0.28.1.dist-info/WHEEL +5 -0
- autoverse_cli-0.28.1.dist-info/entry_points.txt +2 -0
- autoverse_cli-0.28.1.dist-info/licenses/LICENSE +33 -0
- autoverse_cli-0.28.1.dist-info/top_level.txt +1 -0
- avrs/__init__.py +0 -0
- avrs/app_version.py +24 -0
- avrs/argparse_help.py +30 -0
- avrs/avrs.py +183 -0
- avrs/can_tool.py +192 -0
- avrs/can_tool_util.py +190 -0
- avrs/cfg.py +78 -0
- avrs/launcher.py +256 -0
- avrs/launcher_util.py +203 -0
- avrs/race_cloud.py +506 -0
- avrs/race_cloud_bridge_can.py +100 -0
- avrs/race_cloud_cfg_util.py +310 -0
- avrs/race_cloud_fwd_api.py +49 -0
- avrs/race_cloud_util.py +384 -0
- avrs/requests/change_camera.py +24 -0
- avrs/requests/code_booz.py +69 -0
- avrs/requests/demo.py +19 -0
- avrs/requests/dump_sim_config.py +14 -0
- avrs/requests/environment.py +46 -0
- avrs/requests/fault_injection.py +186 -0
- avrs/requests/get_object_config.py +18 -0
- avrs/requests/get_web_viz_meta.py +11 -0
- avrs/requests/leaderboard.py +74 -0
- avrs/requests/list_sim_objects.py +26 -0
- avrs/requests/log_path.py +28 -0
- avrs/requests/misc.py +70 -0
- avrs/requests/move_to_landmark.py +16 -0
- avrs/requests/npc.py +289 -0
- avrs/requests/race_control.py +48 -0
- avrs/requests/request.py +61 -0
- avrs/requests/reset_to_track.py +21 -0
- avrs/requests/rest_request.py +45 -0
- avrs/requests/restart.py +12 -0
- avrs/requests/scenario_control.py +43 -0
- avrs/requests/spawn_object.py +44 -0
- avrs/requests/teleport.py +40 -0
- avrs/requests/toggle_hud.py +11 -0
- avrs/requests/vd.py +64 -0
- avrs/requests/vehicle_input.py +21 -0
- avrs/requests/vehicle_replay.py +454 -0
- avrs/shell_completion.py +121 -0
- avrs/simconfig.py +75 -0
- avrs/simconfig_util.py +170 -0
- avrs/tests.py +9 -0
- avrs/util.py +13 -0
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
from avrs.requests.request import AvrsApiRequest
|
|
2
|
+
from argparse import RawDescriptionHelpFormatter
|
|
3
|
+
from argparse import RawTextHelpFormatter
|
|
4
|
+
|
|
5
|
+
class AvrsFaultInjectionRequests():
|
|
6
|
+
def __init__(self, parser, cfg):
|
|
7
|
+
psr = parser.add_parser('inject-fault', help='utilty to inject faults into components (sensors, actuators, etc)')
|
|
8
|
+
sps = psr.add_subparsers(required= True, help='sub-command inject-fault')
|
|
9
|
+
AvrsGnssFaultRequest(sps, cfg)
|
|
10
|
+
AvrsLidarFaultRequest(sps, cfg)
|
|
11
|
+
AvrsImuFaultRequest(sps, cfg)
|
|
12
|
+
AvrsCanFaultRequest(sps, cfg)
|
|
13
|
+
|
|
14
|
+
def add_base_injection_args(psr):
|
|
15
|
+
|
|
16
|
+
psr.add_argument(
|
|
17
|
+
'--target',
|
|
18
|
+
default='ego',
|
|
19
|
+
help='the simulated object to apply the command to')
|
|
20
|
+
|
|
21
|
+
psr.add_argument(
|
|
22
|
+
'--duration',
|
|
23
|
+
type=float,
|
|
24
|
+
default=1.0,
|
|
25
|
+
help='how long to apply the fault (0.0 is infinite)')
|
|
26
|
+
|
|
27
|
+
psr.add_argument(
|
|
28
|
+
'--dropout',
|
|
29
|
+
action='store_true',
|
|
30
|
+
help='if specified, will apply a complete dropout fault')
|
|
31
|
+
|
|
32
|
+
psr.add_argument(
|
|
33
|
+
'--freeze',
|
|
34
|
+
action='store_true',
|
|
35
|
+
help='if specified, will freeze the data (values will not change)')
|
|
36
|
+
|
|
37
|
+
class AvrsGnssFaultRequest(AvrsApiRequest):
|
|
38
|
+
def __init__(self, parser, cfg):
|
|
39
|
+
AvrsApiRequest.__init__(self, parser, cfg, 'FaultInjection', '')
|
|
40
|
+
|
|
41
|
+
psr = parser.add_parser(
|
|
42
|
+
'gnss',
|
|
43
|
+
help='inject a gnss fault',
|
|
44
|
+
formatter_class=RawTextHelpFormatter)
|
|
45
|
+
|
|
46
|
+
psr.add_argument(
|
|
47
|
+
'--horizontal-bias',
|
|
48
|
+
type=float,
|
|
49
|
+
default=0.0,
|
|
50
|
+
help='horizontal bias to apply to the sensor as a fault')
|
|
51
|
+
|
|
52
|
+
psr.add_argument(
|
|
53
|
+
'--vertical-bias',
|
|
54
|
+
type=float,
|
|
55
|
+
default=0.0,
|
|
56
|
+
help='vertical bias to apply to the sensor as a fault')
|
|
57
|
+
|
|
58
|
+
psr.add_argument(
|
|
59
|
+
'--horizontal-stdev',
|
|
60
|
+
type=float,
|
|
61
|
+
default=0.0,
|
|
62
|
+
help='horizontal standard deviation to apply to the sensor')
|
|
63
|
+
|
|
64
|
+
psr.add_argument(
|
|
65
|
+
'--vertical-stdev',
|
|
66
|
+
type=float,
|
|
67
|
+
default=0.0,
|
|
68
|
+
help='vertical standard deviation to apply to the sensor')
|
|
69
|
+
|
|
70
|
+
add_base_injection_args(psr)
|
|
71
|
+
psr.set_defaults(func=self.send_request)
|
|
72
|
+
|
|
73
|
+
def get_request_body(self, args):
|
|
74
|
+
self.target_object_id = args.target
|
|
75
|
+
self.verbose = args.verbose
|
|
76
|
+
return {
|
|
77
|
+
'faultType': 'GnssFault',
|
|
78
|
+
'duration': args.duration,
|
|
79
|
+
'bIsDropout': args.dropout,
|
|
80
|
+
'bIsFreeze': args.freeze,
|
|
81
|
+
'JsonBody': {
|
|
82
|
+
'verticalBias': args.vertical_bias,
|
|
83
|
+
'verticalStdev': args.vertical_stdev,
|
|
84
|
+
'horizontalBias': args.horizontal_bias,
|
|
85
|
+
'horizontalStdev': args.horizontal_stdev
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
class AvrsImuFaultRequest(AvrsApiRequest):
|
|
90
|
+
def __init__(self, parser, cfg):
|
|
91
|
+
AvrsApiRequest.__init__(self, parser, cfg, 'FaultInjection', '')
|
|
92
|
+
|
|
93
|
+
psr = parser.add_parser(
|
|
94
|
+
'imu',
|
|
95
|
+
help='inject an imu fault',
|
|
96
|
+
formatter_class=RawTextHelpFormatter)
|
|
97
|
+
|
|
98
|
+
psr.add_argument(
|
|
99
|
+
'--bias',
|
|
100
|
+
type=float,
|
|
101
|
+
default=0.0,
|
|
102
|
+
help='horizontal bias to apply to the sensor as a fault')
|
|
103
|
+
|
|
104
|
+
psr.add_argument(
|
|
105
|
+
'--stdev',
|
|
106
|
+
type=float,
|
|
107
|
+
default=0.0,
|
|
108
|
+
help='horizontal standard deviation to apply to the sensor')
|
|
109
|
+
|
|
110
|
+
add_base_injection_args(psr)
|
|
111
|
+
psr.set_defaults(func=self.send_request)
|
|
112
|
+
|
|
113
|
+
def get_request_body(self, args):
|
|
114
|
+
self.target_object_id = args.target
|
|
115
|
+
self.verbose = args.verbose
|
|
116
|
+
return {
|
|
117
|
+
'faultType': 'ImuFault',
|
|
118
|
+
'duration': args.duration,
|
|
119
|
+
'bIsDropout': args.dropout,
|
|
120
|
+
'bIsFreeze': args.freeze,
|
|
121
|
+
'JsonBody': {
|
|
122
|
+
'bias': args.bias,
|
|
123
|
+
'stdev': args.stdev
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
class AvrsLidarFaultRequest(AvrsApiRequest):
|
|
128
|
+
def __init__(self, parser, cfg):
|
|
129
|
+
AvrsApiRequest.__init__(self, parser, cfg, 'FaultInjection', '')
|
|
130
|
+
|
|
131
|
+
psr = parser.add_parser(
|
|
132
|
+
'lidar',
|
|
133
|
+
help='inject a lidar fault',
|
|
134
|
+
formatter_class=RawTextHelpFormatter)
|
|
135
|
+
|
|
136
|
+
psr.add_argument(
|
|
137
|
+
'--point-density-reduction',
|
|
138
|
+
type=float,
|
|
139
|
+
default=0.5,
|
|
140
|
+
help='the percent of point density reduction, where 1.0 drops all points')
|
|
141
|
+
|
|
142
|
+
add_base_injection_args(psr)
|
|
143
|
+
psr.set_defaults(func=self.send_request)
|
|
144
|
+
|
|
145
|
+
def get_request_body(self, args):
|
|
146
|
+
self.target_object_id = args.target
|
|
147
|
+
self.verbose = args.verbose
|
|
148
|
+
return {
|
|
149
|
+
'faultType': 'LidarFault',
|
|
150
|
+
'duration': args.duration,
|
|
151
|
+
'bIsDropout': args.dropout,
|
|
152
|
+
'bIsFreeze': args.freeze,
|
|
153
|
+
'JsonBody': {
|
|
154
|
+
'pointDensityReduction': args.point_density_reduction
|
|
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
|
+
}
|
|
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
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
from avrs.requests.rest_request import AvrsRestApiRequest
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class AvrsGetWebVizMetaRequest(AvrsRestApiRequest):
|
|
5
|
+
def __init__(self, parser, cfg):
|
|
6
|
+
AvrsRestApiRequest.__init__(self, parser, cfg, '/api/v1.0/get-web-viz-meta', 'GET')
|
|
7
|
+
psr = parser.add_parser('get-web-viz-meta', help='get metadata from the simulator needed by the web frontend')
|
|
8
|
+
psr.set_defaults(func=self.send_request)
|
|
9
|
+
|
|
10
|
+
def get_request_params(self, args):
|
|
11
|
+
return {}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
from avrs.requests.request import AvrsApiRequest
|
|
2
|
+
|
|
3
|
+
class AvrsLeaderboardRequest():
|
|
4
|
+
def __init__(self, parser, cfg):
|
|
5
|
+
psr = parser.add_parser('leaderboard', help='utilities for leaderboard management')
|
|
6
|
+
sps = psr.add_subparsers(required= True, help='sub-command of leaderboard')
|
|
7
|
+
ToggleLeaderboard(sps, cfg)
|
|
8
|
+
ChronoLeaderboard(sps, cfg)
|
|
9
|
+
LapsLeaderboard(sps, cfg)
|
|
10
|
+
ResetLeaderboard(sps, cfg)
|
|
11
|
+
|
|
12
|
+
class ToggleLeaderboard(AvrsApiRequest):
|
|
13
|
+
def __init__(self, parser, cfg):
|
|
14
|
+
AvrsApiRequest.__init__(self, parser, cfg, 'ToggleLeaderboard', '')
|
|
15
|
+
psr = parser.add_parser('toggle', help='Toggles the leaderboard on or off')
|
|
16
|
+
|
|
17
|
+
psr.set_defaults(func=self.send_request)
|
|
18
|
+
|
|
19
|
+
def get_request_body(self, args):
|
|
20
|
+
self.target_object_id = ''
|
|
21
|
+
return {
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
class ChronoLeaderboard(AvrsApiRequest):
|
|
25
|
+
def __init__(self, parser, cfg):
|
|
26
|
+
AvrsApiRequest.__init__(self, parser, cfg, 'ChronoLeaderboard', '')
|
|
27
|
+
psr = parser.add_parser('chrono', help='Displays some options for the chrono in free practice and qualifying')
|
|
28
|
+
|
|
29
|
+
group = psr.add_mutually_exclusive_group()
|
|
30
|
+
group.add_argument('--start', action='store_true', help="Start the timer")
|
|
31
|
+
group.add_argument('--stop', action='store_true', help="Stop the timer")
|
|
32
|
+
group.add_argument('--reset', action='store_true', help="Reset the timer to its initial value")
|
|
33
|
+
|
|
34
|
+
psr.add_argument('--set', type=int, help="Set a new initial value for the timer")
|
|
35
|
+
|
|
36
|
+
psr.set_defaults(func=self.send_request)
|
|
37
|
+
|
|
38
|
+
def get_request_body(self, args):
|
|
39
|
+
self.target_object_id = ''
|
|
40
|
+
return {
|
|
41
|
+
'Start': args.start,
|
|
42
|
+
'Stop': args.stop,
|
|
43
|
+
'Reset': args.reset,
|
|
44
|
+
'Set': args.set
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
class LapsLeaderboard(AvrsApiRequest):
|
|
48
|
+
def __init__(self, parser, cfg):
|
|
49
|
+
AvrsApiRequest.__init__(self, parser, cfg, 'LapsLeaderboard', '')
|
|
50
|
+
psr = parser.add_parser('set-laps', help='Set the number of laps to complete the race')
|
|
51
|
+
|
|
52
|
+
psr.add_argument('laps', type=int, help='Number of laps')
|
|
53
|
+
|
|
54
|
+
psr.set_defaults(func=self.send_request)
|
|
55
|
+
|
|
56
|
+
def get_request_body(self, args):
|
|
57
|
+
self.target_object_id = ''
|
|
58
|
+
return {
|
|
59
|
+
'Laps': args.laps
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
class ResetLeaderboard(AvrsApiRequest):
|
|
63
|
+
def __init__(self, parser, cfg):
|
|
64
|
+
AvrsApiRequest.__init__(self, parser, cfg, 'ResetLeaderboard', '')
|
|
65
|
+
psr = parser.add_parser('reset', help='Reset all the leaderboard data')
|
|
66
|
+
|
|
67
|
+
psr.set_defaults(func=self.send_request)
|
|
68
|
+
|
|
69
|
+
def get_request_body(self, args):
|
|
70
|
+
self.target_object_id = ''
|
|
71
|
+
return {
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
from avrs.requests.request import AvrsApiRequest
|
|
2
|
+
|
|
3
|
+
class AvrsListSimObjectsRequest(AvrsApiRequest):
|
|
4
|
+
def __init__(self, parser, cfg):
|
|
5
|
+
AvrsApiRequest.__init__(self, parser, cfg, 'ListSimObjects', 0)
|
|
6
|
+
psr = parser.add_parser('list-sim-objects', help='list all the sim objects that currently exist in the simulator')
|
|
7
|
+
psr.add_argument(
|
|
8
|
+
'-v',
|
|
9
|
+
action='store_true',
|
|
10
|
+
help='request verbose output')
|
|
11
|
+
psr.add_argument(
|
|
12
|
+
'--components',
|
|
13
|
+
action='store_true',
|
|
14
|
+
help='also print information about the object components')
|
|
15
|
+
psr.add_argument(
|
|
16
|
+
'--isolate',
|
|
17
|
+
default='',
|
|
18
|
+
help='indicate a specific object of interest')
|
|
19
|
+
psr.set_defaults(func=self.send_request)
|
|
20
|
+
|
|
21
|
+
def get_request_body(self, args):
|
|
22
|
+
return {
|
|
23
|
+
"bVerbose": args.v,
|
|
24
|
+
'bListComponents': args.components,
|
|
25
|
+
'isolate': args.isolate
|
|
26
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
from avrs.requests.request import AvrsApiRequest
|
|
2
|
+
|
|
3
|
+
class LogPath(AvrsApiRequest):
|
|
4
|
+
def __init__(self, parser, cfg):
|
|
5
|
+
AvrsApiRequest.__init__(self, parser, cfg, 'LogPath', 'Ego')
|
|
6
|
+
psr = parser.add_parser('log-path', help='logs the path of the current vehicle so it can be used as' +
|
|
7
|
+
' an NPC profile')
|
|
8
|
+
|
|
9
|
+
psr.add_argument('filename', help = 'the name of the file you want')
|
|
10
|
+
psr.add_argument('time', type = float, help = 'the time in seconds you want to log the vehicle path. If you want to keep continously logging until'
|
|
11
|
+
+ ' end of simulation, enter -1')
|
|
12
|
+
psr.add_argument('--filepath', nargs='?', help = 'By default the csv saves in your saved folder located in the simulator.' +
|
|
13
|
+
' However if you would like to save to a new location, please provide an ABSOLUTE file path', default = None)
|
|
14
|
+
psr.set_defaults(func=self.send_request)
|
|
15
|
+
|
|
16
|
+
def get_request_body(self, args):
|
|
17
|
+
if args.filepath == None:
|
|
18
|
+
return {
|
|
19
|
+
'Filename' : args.filename,
|
|
20
|
+
'Time' : args.time,
|
|
21
|
+
'AbsolutePath' : ""
|
|
22
|
+
}
|
|
23
|
+
else:
|
|
24
|
+
return {
|
|
25
|
+
'Filename' : args.filename,
|
|
26
|
+
'Time' : args.time,
|
|
27
|
+
'Path' : args.filepath
|
|
28
|
+
}
|
avrs/requests/misc.py
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
from avrs.requests.request import AvrsApiRequest
|
|
2
|
+
from avrs.requests.rest_request import AvrsRestApiRequest
|
|
3
|
+
|
|
4
|
+
class AvrsGetSimVersionRequest(AvrsApiRequest):
|
|
5
|
+
def __init__(self, parser, cfg):
|
|
6
|
+
AvrsApiRequest.__init__(self, parser, cfg, 'GetVersion', 0)
|
|
7
|
+
psr = parser.add_parser('get-sim-version', help='get the version of the currently running simulator')
|
|
8
|
+
psr.set_defaults(func=self.send_request)
|
|
9
|
+
|
|
10
|
+
def get_request_body(self, args):
|
|
11
|
+
return {
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
class AvrsGetSessionIdRequest(AvrsApiRequest):
|
|
15
|
+
def __init__(self, parser, cfg):
|
|
16
|
+
AvrsApiRequest.__init__(self, parser, cfg, 'GetSessionId', 0)
|
|
17
|
+
psr = parser.add_parser('get-session-id', help='get the session ID of the currently running simulator session')
|
|
18
|
+
psr.set_defaults(func=self.send_request)
|
|
19
|
+
|
|
20
|
+
def get_request_body(self, args):
|
|
21
|
+
return {
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
class AvrsDescribeSimRestRequest(AvrsRestApiRequest):
|
|
25
|
+
def __init__(self, parser, cfg):
|
|
26
|
+
AvrsRestApiRequest.__init__(self, parser, cfg, '/api/v1.0/describe-app', 'GET')
|
|
27
|
+
psr = parser.add_parser('describe-app', help='get the version of the currently running simulator')
|
|
28
|
+
psr.set_defaults(func=self.send_request)
|
|
29
|
+
|
|
30
|
+
def get_request_params(self, args):
|
|
31
|
+
return {}
|
|
32
|
+
|
|
33
|
+
class AvrsGetExitSimRequest(AvrsApiRequest):
|
|
34
|
+
def __init__(self, parser, cfg):
|
|
35
|
+
AvrsApiRequest.__init__(self, parser, cfg, 'ExitSim', 0)
|
|
36
|
+
psr = parser.add_parser('exit-sim', help='exit the currently running simulator')
|
|
37
|
+
psr.set_defaults(func=self.send_request)
|
|
38
|
+
|
|
39
|
+
def get_request_body(self, args):
|
|
40
|
+
return {
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
class AvrsPingRequest(AvrsApiRequest):
|
|
44
|
+
def __init__(self, parser, cfg):
|
|
45
|
+
AvrsApiRequest.__init__(self, parser, cfg, 'GetVersion', 0)
|
|
46
|
+
psr = parser.add_parser('ping', help='ping the simulator to see if it is running and responsive')
|
|
47
|
+
psr.set_defaults(func=self.send_ping)
|
|
48
|
+
|
|
49
|
+
def send_ping(self, args):
|
|
50
|
+
try:
|
|
51
|
+
self.send_http_request(args)
|
|
52
|
+
except:
|
|
53
|
+
print('no')
|
|
54
|
+
|
|
55
|
+
class AvrsConfigureSimLodRequest(AvrsApiRequest):
|
|
56
|
+
def __init__(self, parser, cfg):
|
|
57
|
+
AvrsApiRequest.__init__(self, parser, cfg, 'ConfigureSimLod', 'lodctrl')
|
|
58
|
+
psr = parser.add_parser('set-lod', help='set the LOD of the sim, possibly reducing GPU overhead')
|
|
59
|
+
|
|
60
|
+
psr.add_argument(
|
|
61
|
+
'lod',
|
|
62
|
+
type=int,
|
|
63
|
+
help='the new lod level to set. 0 is max lod, 1 is min lod')
|
|
64
|
+
|
|
65
|
+
psr.set_defaults(func=self.send_request)
|
|
66
|
+
|
|
67
|
+
def get_request_body(self, args):
|
|
68
|
+
return {
|
|
69
|
+
'newLod': args.lod
|
|
70
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
|
|
2
|
+
from avrs.requests.request import AvrsApiRequest
|
|
3
|
+
|
|
4
|
+
class MoveToLandmarkRequest(AvrsApiRequest):
|
|
5
|
+
def __init__(self, parser, cfg):
|
|
6
|
+
AvrsApiRequest.__init__(self, parser, cfg, 'MoveToLandmark', 'Ego')
|
|
7
|
+
psr = parser.add_parser('move-to-landmark', help='command an object to move to a landmark')
|
|
8
|
+
psr.add_argument('--object-name', default='Ego', help='the name of the object to move')
|
|
9
|
+
psr.add_argument('landmark', help='the name of the landmark to move the object to')
|
|
10
|
+
psr.set_defaults(func=self.send_request)
|
|
11
|
+
|
|
12
|
+
def get_request_body(self, args):
|
|
13
|
+
self.target_object_id = args.object_name
|
|
14
|
+
return {
|
|
15
|
+
'LandmarkName': args.landmark
|
|
16
|
+
}
|