I would like to teach a location to Pepper and when I move it close to that location, he would get there. But it would be best if there was a way to create positions that would move from one to another.
I tried this code from the documentation and I do not understand how to have access that location again after saving in this example.
et = localizationProxy.learnHome()
# Check that no problem occurred.
if ret == 0:
print "Learning OK"
else:
print "Error during learning " + str(ret)
# Make some moves.
motionProxy.moveTo(0.5, 0.0, 0.2)
# Go back home.
ret = localizationProxy.goToHome()
# Check that no problem occurred.
if ret == 0:
print "go to home OK"
else:
print "error during go to home " + str(ret)
# Save the data for later use.
ret = localizationProxy.save("example")
You can use
ALLocalization.load("example")to reload the map.The APIs
learnHome/goToHomeare a particular case of a more general mechanism. If you want to learn several locations to move to, useALLocalization.getRobotPositionand save them into files under your app's writeable path. To go to these locations, once you have reloaded the map and these locations, tranform the position according to the current robot location, and useALNavigation.navigateToto go there.You can use the
ALNavigationAPIs instead ofALLocalization, but it is lacking a tutorial.I was told SLAM in NAOqi 2.5 is not working well and that in 2.9, using the Qi SDK, it works much more reliably.