Skip to content

Commit

Permalink
Operator improvements running up to FSOnline (#197)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
SijmenHuizenga authored Aug 11, 2020
1 parent a506827 commit 46dc344
Show file tree
Hide file tree
Showing 15 changed files with 693 additions and 698 deletions.
23 changes: 3 additions & 20 deletions AirSim/PythonClient/airsim/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,26 +128,9 @@ def confirmConnection(self):
Checks state of connection every 1 sec and reports it in Console so user can see the progress for connection.
"""
if self.ping():
print("Connected!")
print("Ping to simulator OK")
else:
print("Ping returned false!")
server_ver = self.getServerVersion()
client_ver = self.getClientVersion()
server_min_ver = self.getMinRequiredServerVersion()
client_min_ver = self.getMinRequiredClientVersion()

ver_info = "Client Ver:" + str(client_ver) + " (Min Req: " + str(client_min_ver) + \
"), Server Ver:" + str(server_ver) + " (Min Req: " + str(server_min_ver) + ")"

if server_ver < server_min_ver:
print(ver_info, file=sys.stderr)
print("AirSim server is of older version and not supported by this client. Please upgrade!")
elif client_ver < client_min_ver:
print(ver_info, file=sys.stderr)
print("AirSim client is of older version and not supported by this server. Please upgrade!")
else:
print(ver_info)
print('')
print("Ping to simulator FAIL")

def simSwapTextures(self, tags, tex_id = 0, component_id = 0, material_id = 0):
"""
Expand Down Expand Up @@ -1055,7 +1038,7 @@ def getMultirotorState(self, vehicle_name = ''):

# ----------------------------------- Car APIs ---------------------------------------------
class CarClient(VehicleClient, object):
def __init__(self, ip = "", port = 41451, timeout_value = 3600):
def __init__(self, ip = "", port = 41451, timeout_value = 10):
super(CarClient, self).__init__(ip, port, timeout_value)

def setCarControls(self, controls, vehicle_name = ''):
Expand Down
6 changes: 6 additions & 0 deletions AirSim/PythonClient/airsim/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,15 @@ class CarState(MsgpackMixin):
kinematics_estimated = KinematicsState()
timestamp = np.uint64(0)

class Point2D(MsgpackMixin):
x = 0.0
y = 0.0

class RefereeState(MsgpackMixin):
doo_counter = 0
laps = 0.0
initial_position = Point2D()
cones = []

class MultirotorState(MsgpackMixin):
collision = CollisionInfo()
Expand Down
282 changes: 113 additions & 169 deletions config/team_config.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
{
"access_token": "1234567890",
"teams": [
{
"id": "1",
"name": "Formula Student Team Delft",
"master": "http://localhost:11311 ",
"name": "Team A",
"master": "http://autonomous-system-1:11311/",
"car_settings": {
"SeeDocsAt": "https://fs-online.github.io/Formula-Student-Driverless-Simulator/",
"SettingsVersion": 1.2,
"ViewMode": "SpringArmChase",
"ClockSpeed": 1.0,
"PawnPaths": {
"DefaultCar": { "PawnBP": "Class'/AirSim/VehicleAdv/Cars/TechnionCar/TechnionCarPawn.TechnionCarPawn_C'" }
},
"Vehicles": {
"FSCar": {
"FSCar": {
"DefaultVehicleState": "",
"EnableCollisionPassthrogh": false,
"EnableCollisions": true,
Expand All @@ -19,192 +22,133 @@
"RemoteControlID": -1
},
"Sensors": {
"Imu" : {
"Imu" : {
"SensorType": 2,
"Enabled": true
},
"Gps" : {
},
"Gps" : {
"SensorType": 3,
"Enabled": true
},
"LidarCustom": {
"SensorType": 6,
"Enabled": true,
"NumberOfLasers": 16,
"PointsPerScan": 10000,
"X": 0,
"Y": 0,
"Z": -1,
"DrawDebugPoints": false
}
},
"GSS" : {
"SensorType": 7,
"Enabled": true
}
},
"Cameras": {
"front_center_custom": {
"CaptureSettings": [
{
"PublishToRos": 1,
"ImageType": 0,
"Width": 640,
"Height": 480,
"FOV_Degrees": 27,
"DepthOfFieldFstop": 2.8,
"DepthOfFieldFocalDistance": 200.0,
"DepthOfFieldFocalRegion": 200.0,
"TargetGamma": 1.5
}
],
"X": 0.50, "Y": 0, "Z": 0.10,
"Pitch": 0, "Roll": 0, "Yaw": 0
},
"front_left_custom": {
"CaptureSettings": [
{
"PublishToRos": 1,
"ImageType": 0,
"Width": 672,
"Height": 376,
"FOV_Degrees": 90,
"TargetGamma": 1.5
},
{
"PublishToRos": 1,
"ImageType": 1,
"Width": 672,
"Height": 376,
"FOV_Degrees": 90,
"TargetGamma": 1.5
}
],
"X": 0.50, "Y": -0.06, "Z": 0.10,
"Pitch": 0.0, "Roll": 0.0, "Yaw": 0.0
},
"front_right_custom": {
"CaptureSettings": [
{
"PublishToRos": 1,
"ImageType": 0,
"Width": 672,
"Height": 376,
"FOV_Degrees": 90,
"TargetGamma": 1.5
}
],
"X": 0.50, "Y": 0.06, "Z": 0.10,
"Pitch": 0.0, "Roll": 0.0, "Yaw": 0.0
}
},
"X": 2, "Y": 0, "Z": 0,
"Pitch": 0, "Roll": 0, "Yaw": 0
}
}
},
"SubWindows": [
{"WindowID": 0, "ImageType": 0, "CameraName": "front_left_custom", "Visible": true},
{"WindowID": 1, "ImageType": 0, "CameraName": "front_center_custom", "Visible": false},
{"WindowID": 2, "ImageType": 0, "CameraName": "front_right_custom", "Visible": true}
]
}
}
},
{
"id": "2",
"name": "TUFast",
"master": "http://localhost:11312 ",
"name": "Team B",
"master": "http://autonomous-system-2:11311/",
"car_settings": {
"SettingsVersion": 1.2,
"ViewMode": "SpringArmChase",
"ClockSpeed": 1.0,
"Vehicles": {
"FSCar": {
"DefaultVehicleState": "",
"EnableCollisionPassthrogh": false,
"EnableCollisions": true,
"AllowAPIAlways": true,
"RC":{
"RemoteControlID": -1
"SeeDocsAt": "https://fs-online.github.io/Formula-Student-Driverless-Simulator/",
"SettingsVersion": 1.2,
"ViewMode": "SpringArmChase",
"ClockSpeed": 1.0,
"SpectatorServerPassword": "password",
"PawnPaths": {
"DefaultCar": { "PawnBP": "Class'/AirSim/VehicleAdv/Cars/TechnionCar/TechnionCarPawn.TechnionCarPawn_C'" }
},
"Vehicles": {
"FSCar": {
"DefaultVehicleState": "",
"EnableCollisionPassthrogh": false,
"EnableCollisions": true,
"AllowAPIAlways": true,
"RC":{
"RemoteControlID": -1
},
"Sensors": {
"Imu" : {
"SensorType": 2,
"Enabled": true
},
"Sensors": {
"Imu" : {
"SensorType": 2,
"Enabled": true
},
"Gps" : {
"SensorType": 3,
"Enabled": true
},
"LidarCustom": {
"SensorType": 6,
"Enabled": true,
"NumberOfLasers": 16,
"PointsPerScan": 10000,
"X": 0,
"Y": 0,
"Z": -1,
"DrawDebugPoints": false
}
"Gps" : {
"SensorType": 3,
"Enabled": true
},
"Cameras": {
"front_center_custom": {
"CaptureSettings": [
{
"PublishToRos": 1,
"ImageType": 0,
"Width": 640,
"Height": 480,
"FOV_Degrees": 27,
"DepthOfFieldFstop": 2.8,
"DepthOfFieldFocalDistance": 200.0,
"DepthOfFieldFocalRegion": 200.0,
"TargetGamma": 1.5
}
],
"X": 0.50, "Y": 0, "Z": 0.10,
"Pitch": 0, "Roll": 0, "Yaw": 0
},
"front_left_custom": {
"CaptureSettings": [
{
"PublishToRos": 1,
"ImageType": 0,
"Width": 672,
"Height": 376,
"FOV_Degrees": 90,
"TargetGamma": 1.5
},
{
"PublishToRos": 1,
"ImageType": 1,
"Width": 672,
"Height": 376,
"FOV_Degrees": 90,
"TargetGamma": 1.5
}
],
"X": 0.50, "Y": -0.06, "Z": 0.10,
"Pitch": 0.0, "Roll": 0.0, "Yaw": 0.0
},
"front_right_custom": {
"CaptureSettings": [
{
"PublishToRos": 1,
"ImageType": 0,
"Width": 672,
"Height": 376,
"FOV_Degrees": 90,
"TargetGamma": 1.5
}
],
"X": 0.50, "Y": 0.06, "Z": 0.10,
"Pitch": 0.0, "Roll": 0.0, "Yaw": 0.0
"Lidar1": {
"SensorType": 6,
"Enabled": true,
"X": 0, "Y": 0, "Z": -1,
"Roll": 0, "Pitch": 0, "Yaw" : 0,
"NumberOfLasers": 4,
"PointsPerScan": 4096,
"VerticalFOVUpper": 5,
"VerticalFOVLower": -5,
"HorizontalFOVStart": -90,
"HorizontalFOVEnd": 90,
"RotationsPerSecond": 10,
"DrawDebugPoints": false
},
"Lidar2": {
"SensorType": 6,
"Enabled": true,
"X": 0, "Y": 0, "Z": -2,
"Roll": 0, "Pitch": 0, "Yaw" : 0,
"NumberOfLasers": 4,
"PointsPerScan": 4096,
"VerticalFOVUpper": 5,
"VerticalFOVLower": -5,
"HorizontalFOVStart": -90,
"HorizontalFOVEnd": 90,
"RotationsPerSecond": 5,
"DrawDebugPoints": false
},
"GSS" : {
"SensorType": 7,
"Enabled": true
}
},
"Cameras": {
"cam1": {
"CaptureSettings": [
{
"ImageType": 0,
"Width": 785,
"Height": 785,
"FOV_Degrees": 90
}
],
"X": 1.0,
"Y": 0.06,
"Z": -1.20,
"Pitch": 0.0,
"Roll": 0.0,
"Yaw": 0
},
"X": 2, "Y": 0, "Z": 0,
"Pitch": 0, "Roll": 0, "Yaw": 0
"cam2": {
"CaptureSettings": [
{
"ImageType": 0,
"Width": 785,
"Height": 785,
"FOV_Degrees": 90
}
],
"X": 1.0,
"Y": 0.56,
"Z": -1.20,
"Pitch": 0.0,
"Roll": 0.0,
"Yaw": 0.0
}
},
"SubWindows": [
{"WindowID": 0, "ImageType": 0, "CameraName": "front_left_custom", "Visible": true},
{"WindowID": 1, "ImageType": 0, "CameraName": "front_center_custom", "Visible": true},
{"WindowID": 2, "ImageType": 0, "CameraName": "front_right_custom", "Visible": true}
]
},
"X": 2, "Y": 0, "Z": 0,
"Pitch": 0, "Roll": 0, "Yaw": 0
}
},
"SubWindows": [
]
}
}
]
Expand Down
Binary file added docs/images/operator.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/images/operator.png
Binary file not shown.
Loading

0 comments on commit 46dc344

Please sign in to comment.