import actionlib
from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal
client = actionlib.SimpleActionClient('move_base', MoveBaseAction)
client.wait_for_server()
goal = MoveBaseGoal()
goal.target_pose.header.frame_id = 'map'
goal.target_pose.header.stamp = rospy.Time.now()
goal.target_pose.pose.position.x = 1.0
goal.target_pose.pose.position.y = 2.0
goal.target_pose.pose.orientation.w = 1.0
client.send_goal(goal)
client.wait_for_result()
result = client.get_state()This code connects to the move_base action server, sets a goal position and orientation, sends it, waits for the robot to reach it, and checks the result.