Go to the documentation of this file.00001
00002
00003
00004 import rospy
00005 import actionlib
00006
00007 from lama_jockeys.msg import NavigateAction
00008 from lama_jockeys.msg import NavigateGoal
00009
00010 _edge_id = 1
00011
00012 if __name__ == '__main__':
00013 import sys
00014 try:
00015 edge_id = int(sys.argv[1])
00016 except (IndexError, ValueError):
00017 edge_id = _edge_id
00018 rospy.init_node('test_anj_featurenav')
00019
00020 client = actionlib.SimpleActionClient('anj_featurenav_navigator',
00021 NavigateAction)
00022 while not client.wait_for_server(rospy.Duration(5)):
00023 rospy.loginfo(('waiting for action server "{}"').format(
00024 'anj_featurenav_navigator'))
00025
00026 navigate_goal = NavigateGoal()
00027 navigate_goal.action = navigate_goal.TRAVERSE
00028 navigate_goal.edge.id = edge_id
00029 rospy.loginfo('Starting following segment on edge {}'.format(edge_id))
00030 client.send_goal_and_wait(navigate_goal)
00031 result = client.get_result()
00032
00033 if result.final_state != result.DONE:
00034 rospy.logerr('Navigation error')
00035 exit()
00036
00037 rospy.loginfo('Navigation successful')
00038
00039 rospy.spin()