[ERROR] : Called wait_for_result when no goal exists
This is terminal output:
[ERROR] [1660043302.501132, 4595.399000]: Called wait_for_result when no goal exists
[INFO] [1660043302.505849, 4595.405000]: Goal execution done!
It says Goal execution done but robot is not moving.
Can someone help me please?
from unittest import result
import rospy
import actionlib
from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal
class SendGoal():
def __init__(self):
self.client = actionlib.SimpleActionClient('move_base',MoveBaseAction)
self.wait = self.client.wait_for_result()
self.goal = MoveBaseGoal()
self.goal.target_pose.header.frame_id = "map"
self.goal.target_pose.header.stamp = rospy.Time.now()
self.goal.target_pose.pose.position.x = 30.0
self.goal.target_pose.pose.orientation.w = 0.01
self.goal.target_pose.pose.position.y = -10.5
def movebase_client(self):
self.client.wait_for_server()
self.client.send_goal(self.goal)
if result:
print("job done")
if not self.wait:
rospy.logerr("Action server not available!")
rospy.signal_shutdown("Action server not available!")
else:
return self.client.get_result()
if __name__ == '__main__':
try:
rospy.init_node('movebase_client_py')
result = SendGoal().movebase_client()
if result:
rospy.loginfo("Goal execution done!")
except rospy.ROSInterruptException:
rospy.loginfo("Navigation test finished.")