-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathdemoClaw.py
41 lines (30 loc) · 814 Bytes
/
demoClaw.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
"""
Demo the claw for the python interface
"""
from Mambo import Mambo
# you will need to change this to the address of YOUR mambo
mamboAddr = "e0:14:d0:63:3d:d0"
# make my mambo object
mambo = Mambo(mamboAddr)
print "trying to connect"
success = mambo.connect(num_retries=3)
print "connected: %s" % success
# get the state information
print "sleeping"
mambo.smart_sleep(2)
mambo.ask_for_state_update()
mambo.smart_sleep(2)
print "taking off!"
mambo.safe_takeoff(5)
print "open and close the claw"
mambo.open_claw()
# you have to sleep to let the claw open (it needs time to do it)
mambo.smart_sleep(5)
mambo.close_claw()
# you have to sleep to let the claw close (it needs time to do it)
mambo.smart_sleep(5)
print "landing"
mambo.safe_land()
mambo.smart_sleep(5)
print "disconnect"
mambo.disconnect()