From 7a32285435b86f422d1c97684e1c09c66cf2a8e6 Mon Sep 17 00:00:00 2001 From: Rajat Singhal Date: Sun, 19 Apr 2020 14:55:48 +0530 Subject: [PATCH 1/2] [Pythonclient/types] Fix set_throttle method in CarControls --- PythonClient/airsim/types.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/PythonClient/airsim/types.py b/PythonClient/airsim/types.py index 9337adcc25..25e359843c 100644 --- a/PythonClient/airsim/types.py +++ b/PythonClient/airsim/types.py @@ -304,13 +304,13 @@ def __init__(self, throttle = 0, steering = 0, brake = 0, def set_throttle(self, throttle_val, forward): if (forward): - is_manual_gear = False - manual_gear = 0 - throttle = abs(throttle_val) + self.is_manual_gear = False + self.manual_gear = 0 + self.throttle = abs(throttle_val) else: - is_manual_gear = False - manual_gear = -1 - throttle = - abs(throttle_val) + self.is_manual_gear = False + self.manual_gear = -1 + self.throttle = - abs(throttle_val) class KinematicsState(MsgpackMixin): position = Vector3r() From 8e03078db89ae4bde97f05e119b12d03d9826de3 Mon Sep 17 00:00:00 2001 From: Rajat Singhal Date: Sun, 19 Apr 2020 15:03:14 +0530 Subject: [PATCH 2/2] [PythonClient] Remove return from void-type APIs --- PythonClient/airsim/client.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/PythonClient/airsim/client.py b/PythonClient/airsim/client.py index b4f5d5136b..b8dde7f0f5 100644 --- a/PythonClient/airsim/client.py +++ b/PythonClient/airsim/client.py @@ -55,7 +55,7 @@ def enableApiControl(self, is_enabled, vehicle_name = ''): is_enabled (bool): True to enable, False to disable API control vehicle_name (str, optional): Name of the vehicle to send this command to """ - return self.client.call('enableApiControl', is_enabled, vehicle_name) + self.client.call('enableApiControl', is_enabled, vehicle_name) def isApiControlEnabled(self, vehicle_name = ''): """ @@ -186,7 +186,7 @@ def simSetTimeOfDay(self, is_enabled, start_datetime = "", is_start_datetime_dst update_interval_secs (float, optional): Interval to update the Sun's position move_sun (bool, optional): Whether or not to move the Sun """ - return self.client.call('simSetTimeOfDay', is_enabled, start_datetime, is_start_datetime_dst, celestial_clock_speed, update_interval_secs, move_sun) + self.client.call('simSetTimeOfDay', is_enabled, start_datetime, is_start_datetime_dst, celestial_clock_speed, update_interval_secs, move_sun) # weather def simEnableWeather(self, enable): @@ -196,7 +196,7 @@ def simEnableWeather(self, enable): Args: enable (bool): True to enable, False to disable """ - return self.client.call('simEnableWeather', enable) + self.client.call('simEnableWeather', enable) def simSetWeatherParameter(self, param, val): """ @@ -206,7 +206,7 @@ def simSetWeatherParameter(self, param, val): param (WeatherParameter): Weather effect to be enabled val (float): Intensity of the effect, Range 0-1 """ - return self.client.call('simSetWeatherParameter', param, val) + self.client.call('simSetWeatherParameter', param, val) # camera control # simGetImage returns compressed png in array of bytes @@ -401,7 +401,7 @@ def simPrintLogMessage(self, message, message_param = "", severity = 0): message_param (str, optional): Parameter to be printed next to the message severity (int, optional): Range 0-3, inclusive, corresponding to the severity of the message """ - return self.client.call('simPrintLogMessage', message, message_param, severity) + self.client.call('simPrintLogMessage', message, message_param, severity) def simGetCameraInfo(self, camera_name, vehicle_name = ''): """ @@ -439,7 +439,7 @@ def simSetCameraFov(self, camera_name, fov_degrees, vehicle_name = ''): vehicle_name (str, optional): Name of vehicle which the camera corresponds to """ # TODO: below str() conversion is only needed for legacy reason and should be removed in future - return self.client.call('simSetCameraFov', str(camera_name), fov_degrees, vehicle_name) + self.client.call('simSetCameraFov', str(camera_name), fov_degrees, vehicle_name) def simGetGroundTruthKinematics(self, vehicle_name = ''): """