Skip to content

Commit 1accab1

Browse files
committed
examples: go up first, and land again
1 parent f8389f2 commit 1accab1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

examples/offboard_attitude.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ async def run():
3939
await drone.action.disarm()
4040
return
4141

42+
print("-- Go up at 70% thrust")
43+
await drone.offboard.set_attitude(Attitude(0.0, 0.0, 0.0, 0.7))
44+
await asyncio.sleep(2)
45+
4246
print("-- Roll 30 at 60% thrust")
4347
await drone.offboard.set_attitude(Attitude(30.0, 0.0, 0.0, 0.6))
4448
await asyncio.sleep(2)
@@ -47,7 +51,7 @@ async def run():
4751
await drone.offboard.set_attitude(Attitude(-30.0, 0.0, 0.0, 0.6))
4852
await asyncio.sleep(2)
4953

50-
print("-- Roll 0 at 60% thrust")
54+
print("-- Hover at 60% thrust")
5155
await drone.offboard.set_attitude(Attitude(0.0, 0.0, 0.0, 0.6))
5256
await asyncio.sleep(2)
5357

@@ -58,6 +62,8 @@ async def run():
5862
print(f"Stopping offboard mode failed with error code: \
5963
{error._result.result}")
6064

65+
await drone.action.land()
66+
6167

6268
if __name__ == "__main__":
6369
loop = asyncio.get_event_loop()

0 commit comments

Comments
 (0)