Skip to content

Commit 46dc344

Browse files
Operator improvements running up to FSOnline (#197)
* Operator improvements running up to FSOnline * move away from wsl * work work work work work * Work it * Fix finished signal 1 * debug * Finished signal working * finish signal working * remove undefined * Fix track selection bug * Do not store passwords in setting.json or team_settings.json. * added competition mode to bridgelauncher * Final competition things * Cleanup operator changes and added documentation
1 parent a506827 commit 46dc344

File tree

15 files changed

+693
-698
lines changed

15 files changed

+693
-698
lines changed

AirSim/PythonClient/airsim/client.py

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -128,26 +128,9 @@ def confirmConnection(self):
128128
Checks state of connection every 1 sec and reports it in Console so user can see the progress for connection.
129129
"""
130130
if self.ping():
131-
print("Connected!")
131+
print("Ping to simulator OK")
132132
else:
133-
print("Ping returned false!")
134-
server_ver = self.getServerVersion()
135-
client_ver = self.getClientVersion()
136-
server_min_ver = self.getMinRequiredServerVersion()
137-
client_min_ver = self.getMinRequiredClientVersion()
138-
139-
ver_info = "Client Ver:" + str(client_ver) + " (Min Req: " + str(client_min_ver) + \
140-
"), Server Ver:" + str(server_ver) + " (Min Req: " + str(server_min_ver) + ")"
141-
142-
if server_ver < server_min_ver:
143-
print(ver_info, file=sys.stderr)
144-
print("AirSim server is of older version and not supported by this client. Please upgrade!")
145-
elif client_ver < client_min_ver:
146-
print(ver_info, file=sys.stderr)
147-
print("AirSim client is of older version and not supported by this server. Please upgrade!")
148-
else:
149-
print(ver_info)
150-
print('')
133+
print("Ping to simulator FAIL")
151134

152135
def simSwapTextures(self, tags, tex_id = 0, component_id = 0, material_id = 0):
153136
"""
@@ -1055,7 +1038,7 @@ def getMultirotorState(self, vehicle_name = ''):
10551038

10561039
# ----------------------------------- Car APIs ---------------------------------------------
10571040
class CarClient(VehicleClient, object):
1058-
def __init__(self, ip = "", port = 41451, timeout_value = 3600):
1041+
def __init__(self, ip = "", port = 41451, timeout_value = 10):
10591042
super(CarClient, self).__init__(ip, port, timeout_value)
10601043

10611044
def setCarControls(self, controls, vehicle_name = ''):

AirSim/PythonClient/airsim/types.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,9 +338,15 @@ class CarState(MsgpackMixin):
338338
kinematics_estimated = KinematicsState()
339339
timestamp = np.uint64(0)
340340

341+
class Point2D(MsgpackMixin):
342+
x = 0.0
343+
y = 0.0
344+
341345
class RefereeState(MsgpackMixin):
342346
doo_counter = 0
343347
laps = 0.0
348+
initial_position = Point2D()
349+
cones = []
344350

345351
class MultirotorState(MsgpackMixin):
346352
collision = CollisionInfo()

config/team_config.json

Lines changed: 113 additions & 169 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
{
2-
"access_token": "1234567890",
32
"teams": [
43
{
54
"id": "1",
6-
"name": "Formula Student Team Delft",
7-
"master": "http://localhost:11311 ",
5+
"name": "Team A",
6+
"master": "http://autonomous-system-1:11311/",
87
"car_settings": {
8+
"SeeDocsAt": "https://fs-online.github.io/Formula-Student-Driverless-Simulator/",
99
"SettingsVersion": 1.2,
1010
"ViewMode": "SpringArmChase",
1111
"ClockSpeed": 1.0,
12+
"PawnPaths": {
13+
"DefaultCar": { "PawnBP": "Class'/AirSim/VehicleAdv/Cars/TechnionCar/TechnionCarPawn.TechnionCarPawn_C'" }
14+
},
1215
"Vehicles": {
13-
"FSCar": {
16+
"FSCar": {
1417
"DefaultVehicleState": "",
1518
"EnableCollisionPassthrogh": false,
1619
"EnableCollisions": true,
@@ -19,192 +22,133 @@
1922
"RemoteControlID": -1
2023
},
2124
"Sensors": {
22-
"Imu" : {
25+
"Imu" : {
2326
"SensorType": 2,
2427
"Enabled": true
25-
},
26-
"Gps" : {
28+
},
29+
"Gps" : {
2730
"SensorType": 3,
2831
"Enabled": true
29-
},
30-
"LidarCustom": {
31-
"SensorType": 6,
32-
"Enabled": true,
33-
"NumberOfLasers": 16,
34-
"PointsPerScan": 10000,
35-
"X": 0,
36-
"Y": 0,
37-
"Z": -1,
38-
"DrawDebugPoints": false
39-
}
32+
},
33+
"GSS" : {
34+
"SensorType": 7,
35+
"Enabled": true
36+
}
4037
},
4138
"Cameras": {
42-
"front_center_custom": {
43-
"CaptureSettings": [
44-
{
45-
"PublishToRos": 1,
46-
"ImageType": 0,
47-
"Width": 640,
48-
"Height": 480,
49-
"FOV_Degrees": 27,
50-
"DepthOfFieldFstop": 2.8,
51-
"DepthOfFieldFocalDistance": 200.0,
52-
"DepthOfFieldFocalRegion": 200.0,
53-
"TargetGamma": 1.5
54-
}
55-
],
56-
"X": 0.50, "Y": 0, "Z": 0.10,
57-
"Pitch": 0, "Roll": 0, "Yaw": 0
58-
},
59-
"front_left_custom": {
60-
"CaptureSettings": [
61-
{
62-
"PublishToRos": 1,
63-
"ImageType": 0,
64-
"Width": 672,
65-
"Height": 376,
66-
"FOV_Degrees": 90,
67-
"TargetGamma": 1.5
68-
},
69-
{
70-
"PublishToRos": 1,
71-
"ImageType": 1,
72-
"Width": 672,
73-
"Height": 376,
74-
"FOV_Degrees": 90,
75-
"TargetGamma": 1.5
76-
}
77-
],
78-
"X": 0.50, "Y": -0.06, "Z": 0.10,
79-
"Pitch": 0.0, "Roll": 0.0, "Yaw": 0.0
80-
},
81-
"front_right_custom": {
82-
"CaptureSettings": [
83-
{
84-
"PublishToRos": 1,
85-
"ImageType": 0,
86-
"Width": 672,
87-
"Height": 376,
88-
"FOV_Degrees": 90,
89-
"TargetGamma": 1.5
90-
}
91-
],
92-
"X": 0.50, "Y": 0.06, "Z": 0.10,
93-
"Pitch": 0.0, "Roll": 0.0, "Yaw": 0.0
94-
}
9539
},
9640
"X": 2, "Y": 0, "Z": 0,
9741
"Pitch": 0, "Roll": 0, "Yaw": 0
98-
}
42+
}
9943
},
10044
"SubWindows": [
101-
{"WindowID": 0, "ImageType": 0, "CameraName": "front_left_custom", "Visible": true},
102-
{"WindowID": 1, "ImageType": 0, "CameraName": "front_center_custom", "Visible": false},
103-
{"WindowID": 2, "ImageType": 0, "CameraName": "front_right_custom", "Visible": true}
10445
]
105-
}
46+
}
10647
},
10748
{
10849
"id": "2",
109-
"name": "TUFast",
110-
"master": "http://localhost:11312 ",
50+
"name": "Team B",
51+
"master": "http://autonomous-system-2:11311/",
11152
"car_settings": {
112-
"SettingsVersion": 1.2,
113-
"ViewMode": "SpringArmChase",
114-
"ClockSpeed": 1.0,
115-
"Vehicles": {
116-
"FSCar": {
117-
"DefaultVehicleState": "",
118-
"EnableCollisionPassthrogh": false,
119-
"EnableCollisions": true,
120-
"AllowAPIAlways": true,
121-
"RC":{
122-
"RemoteControlID": -1
53+
"SeeDocsAt": "https://fs-online.github.io/Formula-Student-Driverless-Simulator/",
54+
"SettingsVersion": 1.2,
55+
"ViewMode": "SpringArmChase",
56+
"ClockSpeed": 1.0,
57+
"SpectatorServerPassword": "password",
58+
"PawnPaths": {
59+
"DefaultCar": { "PawnBP": "Class'/AirSim/VehicleAdv/Cars/TechnionCar/TechnionCarPawn.TechnionCarPawn_C'" }
60+
},
61+
"Vehicles": {
62+
"FSCar": {
63+
"DefaultVehicleState": "",
64+
"EnableCollisionPassthrogh": false,
65+
"EnableCollisions": true,
66+
"AllowAPIAlways": true,
67+
"RC":{
68+
"RemoteControlID": -1
69+
},
70+
"Sensors": {
71+
"Imu" : {
72+
"SensorType": 2,
73+
"Enabled": true
12374
},
124-
"Sensors": {
125-
"Imu" : {
126-
"SensorType": 2,
127-
"Enabled": true
128-
},
129-
"Gps" : {
130-
"SensorType": 3,
131-
"Enabled": true
132-
},
133-
"LidarCustom": {
134-
"SensorType": 6,
135-
"Enabled": true,
136-
"NumberOfLasers": 16,
137-
"PointsPerScan": 10000,
138-
"X": 0,
139-
"Y": 0,
140-
"Z": -1,
141-
"DrawDebugPoints": false
142-
}
75+
"Gps" : {
76+
"SensorType": 3,
77+
"Enabled": true
14378
},
144-
"Cameras": {
145-
"front_center_custom": {
146-
"CaptureSettings": [
147-
{
148-
"PublishToRos": 1,
149-
"ImageType": 0,
150-
"Width": 640,
151-
"Height": 480,
152-
"FOV_Degrees": 27,
153-
"DepthOfFieldFstop": 2.8,
154-
"DepthOfFieldFocalDistance": 200.0,
155-
"DepthOfFieldFocalRegion": 200.0,
156-
"TargetGamma": 1.5
157-
}
158-
],
159-
"X": 0.50, "Y": 0, "Z": 0.10,
160-
"Pitch": 0, "Roll": 0, "Yaw": 0
161-
},
162-
"front_left_custom": {
163-
"CaptureSettings": [
164-
{
165-
"PublishToRos": 1,
166-
"ImageType": 0,
167-
"Width": 672,
168-
"Height": 376,
169-
"FOV_Degrees": 90,
170-
"TargetGamma": 1.5
171-
},
172-
{
173-
"PublishToRos": 1,
174-
"ImageType": 1,
175-
"Width": 672,
176-
"Height": 376,
177-
"FOV_Degrees": 90,
178-
"TargetGamma": 1.5
179-
}
180-
],
181-
"X": 0.50, "Y": -0.06, "Z": 0.10,
182-
"Pitch": 0.0, "Roll": 0.0, "Yaw": 0.0
183-
},
184-
"front_right_custom": {
185-
"CaptureSettings": [
186-
{
187-
"PublishToRos": 1,
188-
"ImageType": 0,
189-
"Width": 672,
190-
"Height": 376,
191-
"FOV_Degrees": 90,
192-
"TargetGamma": 1.5
193-
}
194-
],
195-
"X": 0.50, "Y": 0.06, "Z": 0.10,
196-
"Pitch": 0.0, "Roll": 0.0, "Yaw": 0.0
79+
"Lidar1": {
80+
"SensorType": 6,
81+
"Enabled": true,
82+
"X": 0, "Y": 0, "Z": -1,
83+
"Roll": 0, "Pitch": 0, "Yaw" : 0,
84+
"NumberOfLasers": 4,
85+
"PointsPerScan": 4096,
86+
"VerticalFOVUpper": 5,
87+
"VerticalFOVLower": -5,
88+
"HorizontalFOVStart": -90,
89+
"HorizontalFOVEnd": 90,
90+
"RotationsPerSecond": 10,
91+
"DrawDebugPoints": false
92+
},
93+
"Lidar2": {
94+
"SensorType": 6,
95+
"Enabled": true,
96+
"X": 0, "Y": 0, "Z": -2,
97+
"Roll": 0, "Pitch": 0, "Yaw" : 0,
98+
"NumberOfLasers": 4,
99+
"PointsPerScan": 4096,
100+
"VerticalFOVUpper": 5,
101+
"VerticalFOVLower": -5,
102+
"HorizontalFOVStart": -90,
103+
"HorizontalFOVEnd": 90,
104+
"RotationsPerSecond": 5,
105+
"DrawDebugPoints": false
106+
},
107+
"GSS" : {
108+
"SensorType": 7,
109+
"Enabled": true
110+
}
111+
},
112+
"Cameras": {
113+
"cam1": {
114+
"CaptureSettings": [
115+
{
116+
"ImageType": 0,
117+
"Width": 785,
118+
"Height": 785,
119+
"FOV_Degrees": 90
197120
}
121+
],
122+
"X": 1.0,
123+
"Y": 0.06,
124+
"Z": -1.20,
125+
"Pitch": 0.0,
126+
"Roll": 0.0,
127+
"Yaw": 0
198128
},
199-
"X": 2, "Y": 0, "Z": 0,
200-
"Pitch": 0, "Roll": 0, "Yaw": 0
129+
"cam2": {
130+
"CaptureSettings": [
131+
{
132+
"ImageType": 0,
133+
"Width": 785,
134+
"Height": 785,
135+
"FOV_Degrees": 90
136+
}
137+
],
138+
"X": 1.0,
139+
"Y": 0.56,
140+
"Z": -1.20,
141+
"Pitch": 0.0,
142+
"Roll": 0.0,
143+
"Yaw": 0.0
201144
}
202-
},
203-
"SubWindows": [
204-
{"WindowID": 0, "ImageType": 0, "CameraName": "front_left_custom", "Visible": true},
205-
{"WindowID": 1, "ImageType": 0, "CameraName": "front_center_custom", "Visible": true},
206-
{"WindowID": 2, "ImageType": 0, "CameraName": "front_right_custom", "Visible": true}
207-
]
145+
},
146+
"X": 2, "Y": 0, "Z": 0,
147+
"Pitch": 0, "Roll": 0, "Yaw": 0
148+
}
149+
},
150+
"SubWindows": [
151+
]
208152
}
209153
}
210154
]

docs/images/operator.jpg

554 KB
Loading

docs/images/operator.png

-48.4 KB
Binary file not shown.

0 commit comments

Comments
 (0)