sending multiple goals via global planner plugin
Hi all,
I have a mobile robot and I would like it to navigate around the building and I already have a map of the building. I am using wheel encoders to generate odometry message, robotposeekf to fuse data from IMU and wheelencoders, amcl for localization and move_base for planning. I am using hokuyo laser for navigation. Now I have started writing a global planner plugin and I have to send multiple goals in this global planner. For testing, I just added three points into the plan. When I run it, the robot starts from the startposition and heads towards the second goal but before it reaches the second goal, the path towards the third goal is generated and it starts moving towards it and after that it starts behaving in a weird manner.
The link to the video: https://www.youtube.com/watch?v=Y0CiNQ15U00&feature=youtu.be
The makePlan function of the global planner plugin:
bool DRGlobalPlanner::makePlan(const geometry_msgs::PoseStamped& start, const geometry_msgs::PoseStamped& goal, std::vector<geometry_msgs::PoseStamped>& plan){
plan.push_back(start);
ROS_INFO("makePlan called!!!!!!!!!!!!!!!!!!");
geometry_msgs::PoseStamped inter;
tf::Quaternion inter_quat = tf::createQuaternionFromYaw(1.57);
inter.pose.position.x = 4.5;
inter.pose.position.y = 3.0;
inter.pose.orientation.x = inter_quat.x();
inter.pose.orientation.y = inter_quat.y();
inter.pose.orientation.z = inter_quat.z();
inter.pose.orientation.w = inter_quat.w();
plan.push_back(inter);
plan.push_back(goal)
return true;
}
I feel that the problem is because the makePlan function is called again and again by movebase which leads to this weird behavior. Why is makePlan function called again and again from movebase although there is no need for it, for example if there are just two points in the plan(start and goal) and there is nothing between them, movebase still calls makeplan of the global planner plugin again and again : https://www.youtube.com/watch?v=7k6yzcg2h3s&feature=youtu.be ? Also, I would like to know how can I make sure that the robot reaches the current goal and then only moves towards the next goal in the std::vector<geometry_msgs::PoseStamped>& plan
? I have used Action API to send multiple goals and it works well with it but I have to write my own global planner so that I can add more functionality later. Any help will be appreciated. Please let me know if you need more information from me.
Update:
I have not set planner_frequency
, so its the default which is 0. The issue is there only when I use my own global planner plugin or carrot_planner plugin. When I use SBPL Lattice Planner, then it works as expected and move_base does not call makePlan function of the global planner again and again when its not needed. So, I feel it has something to do with the way the global planner plugin is written and not with move_base but I am not able to figure it out. Does anyone have any clue why is this happening?
Thanks in advance.
Naman Kumar
Asked by Naman on 2015-07-14 14:40:58 UTC
Answers
Is your planner_frequency set to greater than 0?
Asked by David Lu on 2015-07-15 09:17:27 UTC
Comments
I have not set planner_frequency
, so its the default which is 0. This happens when I use my own global planner plugin or carrot_planner plugin. When I use SBPL Lattice Planner, then it works as expected and move_base does not call makePlan again and again. TIA
Asked by Naman on 2015-07-15 09:22:28 UTC
Comments
Are there any local planner errors?
Asked by David Lu on 2015-07-16 10:33:42 UTC
@David. No, I am not getting any errors!
Asked by Naman on 2015-07-16 11:07:40 UTC
Please use the "minor edit" option when editing your questions if you don't add substantial information.
Asked by David Lu on 2015-07-17 13:03:56 UTC
okay..sorry about that!
Asked by Naman on 2015-07-17 13:21:24 UTC
did you solve this issue of sending multiple goals in global planner?
Asked by aarontan on 2018-06-29 12:23:27 UTC