-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexploration.py
More file actions
36 lines (31 loc) · 965 Bytes
/
exploration.py
File metadata and controls
36 lines (31 loc) · 965 Bytes
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
import numpy
from PIL import Image
from naoqi import ALProxy, ALBroker
import move
myBroker = ALBroker("myBroker", "0.0.0.0", 0, "10.1.32.201", 9559)
aln = ALProxy("ALNavigation")
tts = ALProxy("ALTextToSpeech")
def generateMap():
radius = float(raw_input("What radius do you want me to move? "))
aln.explore(radius)
print("Exploration done!")
aln.stopExploration()
path = aln.saveExploration()
return path
def setHome():
print("Set a home position")
move.main()
return aln.getRobotPositionInMap()[0]
locations = {}
def setLocations():
if "home" not in locations:
locations['home'] = setHome()
input_ = raw_input("Set a location y/n?: ")
if input_ == 'n':
return locations
else:
move.main()
name = raw_input("What is this location called?: ")
locations[name] = aln.getRobotPositionInMap()[0]
aln.navigateToInMap(locations["home"])
return setLocations()