1
1
#!/usr/bin/env python3
2
2
3
+ # Warning: Only try this in simulation!
4
+ # The direct attitude interface is a low level interface to be used
5
+ # with caution. On real vehicles the thrust values are likely not
6
+ # adjusted properly and you need to close the loop using altitude.
3
7
4
8
import asyncio
5
9
@@ -35,6 +39,10 @@ async def run():
35
39
await drone .action .disarm ()
36
40
return
37
41
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
+
38
46
print ("-- Roll 30 at 60% thrust" )
39
47
await drone .offboard .set_attitude (Attitude (30.0 , 0.0 , 0.0 , 0.6 ))
40
48
await asyncio .sleep (2 )
@@ -43,7 +51,7 @@ async def run():
43
51
await drone .offboard .set_attitude (Attitude (- 30.0 , 0.0 , 0.0 , 0.6 ))
44
52
await asyncio .sleep (2 )
45
53
46
- print ("-- Roll 0 at 60% thrust" )
54
+ print ("-- Hover at 60% thrust" )
47
55
await drone .offboard .set_attitude (Attitude (0.0 , 0.0 , 0.0 , 0.6 ))
48
56
await asyncio .sleep (2 )
49
57
@@ -54,6 +62,8 @@ async def run():
54
62
print (f"Stopping offboard mode failed with error code: \
55
63
{ error ._result .result } " )
56
64
65
+ await drone .action .land ()
66
+
57
67
58
68
if __name__ == "__main__" :
59
69
loop = asyncio .get_event_loop ()
0 commit comments