Client: Add land_timeout

This commit is contained in:
Arthur Golubtsov
2019-11-19 07:36:51 +00:00
parent 7127c1e4e9
commit 1a038f95f1
2 changed files with 8 additions and 6 deletions

View File

@@ -26,21 +26,22 @@ y_ratio = 1.0
z_ratio = 1.0
[COPTERS]
frame_id = map
frame_id = floor
takeoff_height = 1.0
takeoff_time = 5.0
safe_takeoff = False
reach_first_point_time = 5.0
land_time = 3.0
land_timeout = 6.0
x0_common = 0
y0_common = 0
z0_common = 0
[FLOOR FRAME]
parent = aruco_map
x = 0.0
y = 0.0
z = 3.55
x = 2.4
y = 12.4
z = 6.27
roll = 180
pitch = 0
yaw = -90
@@ -48,7 +49,7 @@ yaw = -90
[PRIVATE]
id = /hostname
restart_dhcpcd = True
use_leds = True
use_leds = False
led_pin = 21
x0 = 0
y0 = 0

View File

@@ -82,6 +82,7 @@ class CopterClient(client.Client):
self.SAFE_TAKEOFF = self.config.getboolean('COPTERS', 'safe_takeoff')
self.RFP_TIME = self.config.getfloat('COPTERS', 'reach_first_point_time')
self.LAND_TIME = self.config.getfloat('COPTERS', 'land_time')
self.LAND_TIMEOUT = self.config.getfloat('COPTERS', 'land_timeout')
self.X0_COMMON = self.config.getfloat('COPTERS', 'x0_common')
self.Y0_COMMON = self.config.getfloat('COPTERS', 'y0_common')
self.Z0_COMMON = self.config.getfloat('COPTERS', 'z0_common')
@@ -645,7 +646,7 @@ def _play_animation(*args, **kwargs):
# Land
task_manager.add_task(land_time, 0, animation.land,
task_kwargs={
"timeout": client.active_client.TAKEOFF_TIME,
"timeout": client.active_client.LAND_TIMEOUT,
"frame_id": client.active_client.FRAME_ID,
"use_leds": client.active_client.USE_LEDS,
},