Fail to send a goal to navigate
Hi,
I tried to send the goal to move_base. However, the robot does not move and I get the following error:
[ WARN] : The goal sent to the navfn planner is off the global costmap. Planning will always fail to this goal.
Robot: Turtlebot3 ; OS: Ubuntu16.04 ; navigation package: github
Part of my code sending the goal :
goal.target_pose.header.frame_id = "/map";
goal.target_pose.header.stamp = ros::Time::now();
goal.target_pose.pose.position.x = goal_x;
goal.target_pose.pose.position.y = goal_y; /*both derived from abs pos. of outlet in /map or distance wrt to base_link*/
goal.target_pose.pose.orientation.w = 1.0;
The code is mainly from this link. I modified the code according to this problem.
The given map's yaml and pgm file:
image: tunnel_map.pgm
resolution: 0.05
origin: [-10.0, -10.0, 0.0]
negate: 0
occupied_thresh: 0.65
free_thresh: 0.196
https://imgur.com/rqpcdwf This map is like a tunnle where its size is 2m*2m square having an outlet in bottom right.
Turtlebot3 in Rviz: https://imgur.com/Bx0DPLe
Also, I changed frame_id between base_link and /map many times and tried to find the correct coordinate for them, but either the robot didn't move showing the warning mentioned above or plan a path to the center of the grid map whatever the value of position.x and position.y is.
Thank you for taking the time and effort in reading this problem~ and please let me know if anything is unclear.
I wonder what you have set goal_x and goal_y to
ex. If frame id is /map, robot pos is the upper left corner, the goal is (-9,-9), it won't move anywhere.
You do realize that you can only send goals which are inside your global costmap? If your global costmap is really 2x2m you won't be able to send the goal (-9m, -9m). Maybe you could add more details? Why is your global costmap only 2m in size? This is more the size of a local costmap..
Actually, I don't know that the goal can only send into the global costmap. In this problem, didn't he send the goal to static map?
The static map is in the global costmap. The global costmap is the full area the robot knows, you just can not drive to an unknown position.
Ok, I will check the global costmap. Thank you~