def waitForInitialPose(self, next_topic, timeout=None):
counter = 0
while not rospy.is_shutdown():
counter = counter + 1
if timeout and counter >= timeout:
return False
try:
self.marker_lock.acquire()
self.initialize_poses = True
topic_suffix = next_topic.split("/")[-1]
if self.initial_poses.has_key(topic_suffix):
self.pre_pose = PoseStamped(pose=self.initial_poses[topic_suffix])
self.initialize_poses = False
return True
else:
rospy.logdebug(self.initial_poses.keys())
rospy.loginfo("Waiting for pose topic of '%s' to be initialized",
topic_suffix)
rospy.sleep(1)
finally:
self.marker_lock.release()
评论列表
文章目录