Ask Your Question
4

Possible to write move_base plugin in Python?

asked 2014-06-19 08:59:26 -0500

Hendrik Wiese gravatar image

Hi folks,

I'd like to write simple global and local planner plugins for move_base. Is it possible to do that in Python? Or do they have to be written in C++? Is there any documentation about this? Tutorials? Anything besides already existing planners?

Thanks a lot!

Cheers, Hendrik

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
3

answered 2014-06-19 22:38:18 -0500

fergs gravatar image

The planners are loaded into move_base using pluginlib, which is entirely C++ and does not have Python capabilities. However, you could possibly use Boost::Python capabilities to embed Python into C++. This wouldn't be trivial, but is probably possible, although you might have a real hard time debugging a plugin that embeds Boost::Python, so you will probably want to write a number of standalone tests before you even try to move such a planner into move_base as a plugin.

I'm not sure from your question if you are also looking for general docs on how to actually write a new planner in just C++, but basically, the docs you need are pluginlib which tells you how to actually expose and load the class you design, and the nav_core docs which tell you the base classes you need to derive from (an instance of a pluginlib loader basically can only load one type of base class). If developing a local planner, there are a number of helper classes in the base_local_planner package for things like odometry or the "latched_xy_controller".

edit flag offensive delete link more

Comments

Yeah, actually my question is both specifically regarding Python based plubins and generally about writing planners. So thanks for answering both parts. I'll take a look into the docs. Thanks!

Hendrik Wiese gravatar imageHendrik Wiese ( 2014-06-21 10:24:50 -0500 )edit

http://answers.ros.org/question/11521/plans-for-pluginlib-for-python/

David Lu gravatar imageDavid Lu ( 2014-06-22 09:18:14 -0500 )edit

Thanks, David! Sounds interesting. Complicated but interesting... I'll see what good use I can make of it.

Hendrik Wiese gravatar imageHendrik Wiese ( 2014-06-23 10:01:26 -0500 )edit
2

answered 2014-06-19 10:31:06 -0500

David Lu gravatar image

I would also like to do this, but right now there's no way to do it. The problem would be sending the entire costmap to the python node. For the global planner, that may be possible, but for the local planner, there may be bandwidth problems.

edit flag offensive delete link more

Comments

I've considered rewriting the whole thing in Python, but that's probably not productive. :-P

David Lu gravatar imageDavid Lu ( 2014-06-19 10:32:46 -0500 )edit

If writing a planner in Python is a priority, open a ticket.

David Lu gravatar imageDavid Lu ( 2014-06-19 10:33:00 -0500 )edit
1

I see, I see... Well, no, it's not a priority. It'd be just a little more convenient. C++ is on my lists of pretty well known languages. It's just that I like Python a lot more. Anyway, thanks for the insight!

Hendrik Wiese gravatar imageHendrik Wiese ( 2014-06-19 12:02:57 -0500 )edit

Your Answer

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

Add Answer

Question Tools

3 followers

Stats

Asked: 2014-06-19 08:59:26 -0500

Seen: 1,634 times

Last updated: Jun 19 '14