26 NaoqiNode.__init__(self,
'loading_map')
32 rospy.loginfo(
"Node Loading map at %s:%d", self.
pip, self.
pport)
36 rospy.logerr(
"Unable to reach ALNavigation.")
39 version_array = self.
get_proxy(
"ALSystem").systemVersion().split(
'.')
40 if len(version_array) < 3:
41 rospy.logerr(
"Unable to deduce the system version.")
43 version_tuple = (int(version_array[0]), int(version_array[1]), int(version_array[2]))
44 min_version = (2, 5, 2)
45 if version_tuple < min_version:
46 rospy.logerr(
"Naoqi version " + str(min_version) +
47 " required for localization. Yours is " + str(version_tuple))
53 self.navigation.stopLocalization()
54 res = self.navigation.loadExploration(pathtomap)
56 rospy.loginfo(
"The map %s has been loaded", pathtomap)
58 rospy.logwarn(
"The map %s cannot be loaded", pathtomap)
62 '''Relocalization of the robot according to the position given as input 63 Input : The robot's position (x, y, theta) 65 self.navigation.relocalizeInMap([x ,y ,theta])
66 self.navigation.startLocalization()
69 if __name__ ==
'__main__':
70 rospy.loginfo(
"LoadingMap based on Naoqi")
74 raw_input(
"Move Pepper to the position that corresponds to\ 75 zero in the map and press enter")
76 pathtomap = rospy.get_param(
'~path_to_map',
"")
77 if pub.loadMap(pathtomap):
78 pub.relocalization(0,0,0)
def relocalization(self, x, y, theta)
def loadMap(self, pathtomap)
def get_proxy(self, name, warn=True)