I am currently working on a Pepper Robot. The project aims to welcome visitors in a laboratory and to guide them to the office/teacher he wants to see. To do that, i need to make Pepper create her map of the environment and to localize herself.
I have encountered two problems:
- the quality of the map,
- the navigation with this map.
A good navigation implies a good map, but even though when there is only free space around, Pepper is not able to navigate on it.
I use the SoftBank's :
- qi library (http://doc.aldebaran.com/2-4/dev/python/install_guide.html),
- functions (http://doc.aldebaran.com/2-5/naoqi/motion/alnavigation-api.html)
Below are the maps I have (note that the floor reflects light) : Black is free space - White is obstacle
- when the lights are turned on, Environment with lights On
- when the lights are turned off Environment with lights Off
To better the map i went in a room with no reflexion on the floor (carpet floor) and here are the map i had Carpet Floor Carpet Floor Lights On (the environment changed but it is quiet recognizable with some imagination)
For now I couldn't test the navigation on a carpet floor but on the first two maps, Pepper movements are completely incorrect. Moreover, the localization gives me ellipse errors 2 meters wide and 3 meters long on an exploration of 5 meters.
So my questions are :
- am I doing something incorrect?
- how could i solve my problems?
- it is my first experience with navigation, am I expecting too much of it? or are the softbank's functions not efficient?
My code to explore :
PepperSpeech = session.service("ALTextToSpeech")
PepperSpeech.say("Connexion")
PepperNavig = session.service("ALNavigation")
PepperMvt = session.service("ALMotion")
PepperMvt.wakeUp()
PepperSpeech.say("Lancement de l'exploration")
state = PepperNavig.explore(5.0)
print(state)
PepperSpeech.say("Exploration terminee")
time.sleep(2)
PepperNavig.stopExploration()
path = PepperNavig.saveExploration()
print(path)
time.sleep(2)
PepperSpeech.say("sauvegarde terminee")
loadingsuccess = PepperNavig.loadExploration(path)
print(loadingsuccess)
CurrentMap = PepperNavig.getMetricalMap()
fichier = open("Map5m312Obst.txt", "w")
print(type(CurrentMap))
print(type(CurrentMap[0]))
formatted = [format(v) for v in CurrentMap]
fichier.write(str(formatted))
fichier.close()
My code to navigate:
adress = str("/home/nao/.local/share/Explorer/2018-01-18T084351.874Z.explo")
etat = PepperNavig.loadExploration(adress)
print("etat load :")
print(etat)
Map = PepperNavig.getMetricalMap()
PepperNavig.startLocalization()
PepperNavig.relocalizeInMap([0, 0, 0])
id = PepperNavig.navigateToInMap([0, -1, 0])
PepperNavig.wait(id)
pose1 = PepperNavig.getRobotPositionInMap()
print("pose1 = " + str(pose1))
time.sleep(5)
id = PepperNavig.navigateToInMap([0, 0, 0])
PepperNavig.wait(id)
pose2 = PepperNavig.getRobotPositionInMap()
print("pose2 = " + str(pose2))
time.sleep(5)
id = PepperNavig.navigateToInMap([-1, 0, 0])
PepperNavig.wait(id)
pose2 = PepperNavig.getRobotPositionInMap()
print("pose2 = " + str(pose2))
time.sleep(5)
id = PepperNavig.navigateToInMap([0, -1, 0])
PepperNavig.wait(id)
pose3 = PepperNavig.getRobotPositionInMap()
print("pose3 = " + str(pose3))
time.sleep(5)