26 NaoqiNode.__init__(self,
'naoqi_exploration')
32 '''Connect to Naoqi modules 34 rospy.loginfo(
"Exploration Node Connecting to NaoQi at %s:%d", self.
pip, self.
pport)
38 rospy.logerr(
"Unable to reach ALNavigation.")
41 version_array = self.
get_proxy(
"ALSystem").systemVersion().split(
'.')
42 if len(version_array) < 3:
43 rospy.logerr(
"Unable to deduce the system version.")
45 version_tuple = (int(version_array[0]), int(version_array[1]), int(version_array[2]))
46 min_version = (2, 5, 2)
47 if version_tuple < min_version:
48 rospy.logerr(
"Naoqi version " + str(min_version) +
49 " required for localization. Yours is " + str(version_tuple))
55 if self.
motion is not None:
56 if not self.motion.robotIsWakeUp():
60 '''Learning a new map and saving it 61 Input : maximal radius to explore (in meters) 64 if self.
tts is not None:
65 self.tts.post.say(str(
"starting exploration"))
67 rospy.loginfo(
"Starting exploration in a radius of %d m", radius)
71 self.navigation.explore(radius)
73 self.navigation.stopExploration()
74 rospy.loginfo(
"Exploration has finished")
78 rospy.loginfo(
"Path to the map: %s", self.
pathtomap)
80 if self.
tts is not None:
81 self.tts.post.say(str(
"saving the map"))
86 '''Set safety thresholds 87 Input th_orth : orthogonal security distance 88 Input th_tan : tangential security distance 90 if self.
motion is not None:
91 self.motion.setOrthogonalSecurityDistance(th_orth)
92 self.motion.setTangentialSecurityDistance(th_tan)
94 if __name__ ==
'__main__':
95 rospy.loginfo(
"Exploration based on Naoqi")
98 radius = rospy.get_param(
'~radius', 10)
def learnMap(self, radius)
def setThresholds(self, th_orth, th_tan)
def get_proxy(self, name, warn=True)