Ask Your Question

navigation path planner plugin

asked 2014-06-17 13:26:00 -0500

alex920a gravatar image

Let's say I have a plugin that given the starting and goal cells, the dimensions of the static map and an array representing occupied cells of map (for example cell (1;1) occupied), it computes the path. Now let's say that I have to check every tot time if the current map is changing (with sensor data) and I have to update the static map with the new obstacles and compute new path. How can I give to this plugin all these informations? I hope the problem is clear. Thanks!

edit retag flag offensive close merge delete


This is unclear. Are you trying to rewrite the navigation stack functionality?

David Lu gravatar image David Lu  ( 2014-06-17 15:17:14 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2014-06-20 03:00:55 -0500

fergs gravatar image

I think you want to review how the navigation stack works in more detail, and the actual API of nav_core, which defines the base classes for planner plugins to the navigation stack. For instance, planners are completely separate from the actual costmap updating -- writing a new planner doesn't necessarily require even touching the costmap stuff other than using the final updated costmap to score your plans. The costmaps continually update themselves based on incoming sensor data, the local planner is called at a sufficiently high rate to generate mobile base trajectories, and the global planner is called when a new goal arrives or the local planner is unable to generate a trajectory for the last generated global plan.

As for global vs. local, well, the distinction is pretty clear. A global planner takes in a 2d-goal and a current 2d state and outputs a list of poses through which the robot should move to get to the goal. A local planner takes a list of poses (presumably created by a global planner) and creates a trajectory for the robot base for the current timestep (thus it is more of a "controller" than a "planner"). A global planner could take quite a long time to generate each plan, a local planner has to be fast (cause you typically run it at 10-20hz to get smooth mobile base motions).

Thus, the current navigation stack doesn't do much in the way of "computing the change in the map to decide when to replan", basically the local planner has just enough intelligence to wiggle a little to the left or right of an obstacle that ends up moving into the planned path, and when its path is blocked you call the global planner.

edit flag offensive delete link more


Ok! That's more clear! And who updates the costmaps from sensors? Is there any code I can analyze?And what if an obstacle appears when the local planning is calculating the trajectory?

alex920a gravatar image alex920a  ( 2014-06-20 03:27:08 -0500 )edit

All of the costmap code is in the costmap2d package within the navigation stack. The costmap is implemented as a series of layers (each layer is a plugin). The obstacle and voxel layers are 2d/3d versions of sensor updaters. Within each, you'll find code for subscribing/updating from lasers and such

fergs gravatar image fergs  ( 2014-06-21 18:14:45 -0500 )edit

cannot find the specific while when the costmap is subscribing to laserscan topic and qhen it updates the costmap:( can someone help me?

alex920a gravatar image alex920a  ( 2014-06-26 05:36:24 -0500 )edit

Check out the code for ObstacleLayer.

David Lu gravatar image David Lu  ( 2014-06-26 10:19:04 -0500 )edit

Thanks! I'll check:)

alex920a gravatar image alex920a  ( 2014-06-28 11:00:48 -0500 )edit

answered 2014-06-18 04:23:27 -0500

alex920a gravatar image

updated 2014-06-18 05:17:34 -0500

Not really. I just want to know how to: 1. every sample time eventually update the static map with new objects detected from sensors and if the update has success, compute the new path; 2. how to extract the occupied cells from the static map; 3 . how to compare the static map (eventually the costmap) with the local map in order to compute the map's update.

Sorry for the bad explaining, I'm just a beginner. In summary I have to: 1. given for example the plugin's funcion setMap(dimX, dimY, int[] occupied, startPoint, goalPoint) find how to give to this function all these informations. (int[] occupied is the array with the occupied cells of the map) 2. understand if this wrapper I'm writing if a global or local planner because I really didn't understand the difference between them. 3. during the global planning (for example the carrot planner) is the path changing if the robot encounters a new obstacle?


edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2014-06-17 13:26:00 -0500

Seen: 985 times

Last updated: Jun 20 '14