ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
5

what is the reasoning behind current architecture of navigation stack (move_base), the way it is?

asked 2011-09-26 22:10:25 -0600

harmish gravatar image

updated 2014-01-28 17:10:26 -0600

ngrennan gravatar image

i was looking at how move_base and navigation stack works. somethings seems weird to me. nav_core package has BaseGlobalPlanner and BaseLocalPlanner interfaces, which is like general programming practice. navfn is a package that implements BaseGlobalPlanner. BaseGlobalPlanner interface has two methods to overwrite initialize and make_plan. it seems that the task of initialize method is to pass the global costmap to the planner. now, i think this can be achieved by same mechanism as ros messages or service. and task of make_plan can be also served by a ros service.

sometimes standard ros mechanisms (messages and services) used, as for costmap and recovery behaviours. however, sometimes general programming techniques (interfaces) are used, as for BaseGlobalPlanner and BaseLocalPlanner. so the question is why there is this kind of double practice? i would like to know the reasoning here, so i can make better decisions, as i will be working with the navigation stack for my project...

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
6

answered 2011-09-27 02:53:06 -0600

DimitriProsser gravatar image

The nav_core package contains the BaseGlobalPlanner and BaseLocalPlanner interfaces so that various planners can be loaded in place of one another without modifying move_base. ROS does this using pluginlib.

Pluginlib is one of the reasons that the initialize method is required. Since plugins are loaded dynamically, one cannot instantiate an instance of a particular plugin (navfn, for example). move_base uses pluginlib's classLoader to load an instance of whatever planner is desired. It then calls the initialize method to set up all configurations, services, publishers, subscribers, etc. The initialize method does more than just pass the copy of the costmap. If you were to only try to use messages, you would not be able to dynamically load the planner (because it'd have to be pre-loaded to be able to subscribe to the topic and, thus, would not be dynamically loaded).

By enforcing the BaseGlobalPlanner and BaseLocalPlanner interfaces, move_base can always be sure that it has both planners at all times. If the planners ran standalone, move_base would have more difficulty controlling their operation, ensure that they're running, and creating/destroying instances of planners.

These are just my opinions on the matter, I'm sure it's not a comprehensive list, but I hope it helps.

edit flag offensive delete link more

Comments

1
One more aspect is to avoid any overhead from calling services/passing message over the network very often. Especially when passing data structures like maps around.
dornhege gravatar image dornhege  ( 2011-12-16 06:25:59 -0600 )edit
0

answered 2011-12-16 05:16:11 -0600

130s gravatar image

updated 2011-12-17 10:21:52 -0600

I had a similar question at first.

I leave the thorough, theoretical answer to @DimitriProsser's and instead this is just my opinion. (As far as I've seen though) many API of ROS stacks provide data types (by msg system) they require, but don't really restrict procedure. move_base is the one exception where the common procedure/logic to achieve the necessary task is already figured out and also implemented as a framework by using pluginlib.

Btw this deviates the topic but this seems to me similar when web application framework (struts etc.) appeared, when there was very flexible ways to build web application but less framework so developers had to write their own logic every time. People in web development tend to call those common procedure as "business process" or something. I assume sooner or later (or even now) this kind of "procedure framework" will increase in ROS too (I'm still new to robotics relatively, so correct/inform me please)?

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2011-09-26 22:10:25 -0600

Seen: 998 times

Last updated: Dec 17 '11