Client: Add ability to takeoff via animation setpoints

This commit is contained in:
Arthur Golubtsov
2019-09-12 16:11:57 +01:00
parent 263d4081ab
commit 6311d6275a
2 changed files with 5 additions and 5 deletions

View File

@@ -163,8 +163,8 @@ def selfcheck():
return checks
def navto(x, y, z, yaw=float('nan'), frame_id=FRAME_ID, **kwargs):
set_position(frame_id=frame_id, x=x, y=y, z=z, yaw=yaw)
def navto(x, y, z, yaw=float('nan'), frame_id=FRAME_ID, auto_arm=False, **kwargs):
set_position(frame_id=frame_id, x=x, y=y, z=z, yaw=yaw, auto_arm=auto_arm)
#telemetry = get_telemetry(frame_id=frame_id)
logger.info('Going to: | x: {:.3f} y: {:.3f} z: {:.3f} yaw: {:.3f}'.format(x, y, z, yaw))

View File

@@ -108,7 +108,7 @@ def correct_animation(frames, frame_delay=0.1, min_takeoff_height=0.5, move_delt
# If copter lands in animation, landing points can be deleted
if (corrected_frames[len(corrected_frames)-1]['z'] < min_takeoff_height) and check_land:
for i in range(len(corrected_frames)-1,0,-1):
print i
# print i
if abs(corrected_frames[i-1]['z'] - corrected_frames[i]['z']) > move_delta:
break
del corrected_frames[i]
@@ -133,11 +133,11 @@ def convert_frame(frame):
def execute_frame(point=(), color=(), yaw=float('Nan'), frame_id='aruco_map', use_leds=True,
flight_func=FlightLib.navto, flight_kwargs=None, interrupter=interrupt_event):
flight_func=FlightLib.navto, auto_arm=False, flight_kwargs=None, interrupter=interrupt_event):
if flight_kwargs is None:
flight_kwargs = {}
flight_func(*point, yaw=yaw, frame_id=frame_id, interrupter=interrupt_event, **flight_kwargs)
flight_func(*point, yaw=yaw, frame_id=frame_id, auto_arm=auto_arm, interrupter=interrupt_event, **flight_kwargs)
if use_leds:
if color:
LedLib.fill(*color)