Ask Your Question

Plans for pluginlib for Python

asked 2011-10-12 10:17:26 -0500

David Lu gravatar image

updated 2014-01-28 17:10:34 -0500

ngrennan gravatar image

Is there any way (or plan to make a way) to create plugins in Python? It seems C++ is the only option at the moment.

Specifically I'd like to make trajectory filters in Python.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2011-10-13 08:11:52 -0500

One of the best options to comply with the existing architecture is to write a plugin using python, then wrap it with boost python. I've used it a lot and it is extremely easy to wrap C++ code in Python and call the python interpreter (thus your plugin) from C++.

I usually write code in Python, profile it and write in C++ the functions that are more demanding. With boost one can easily have a C++ code (the plugin interface) that calls Python (your plugin) that calls some other C++ functions for time-critical applications!

edit flag offensive delete link more

answered 2011-10-12 12:57:00 -0500

tfoote gravatar image

"Plugins" in python are much simpler and don't need a special library to dynamically load a library. If you'd like an example of a python plugin infrastructure inside ROS take a look at roswtf

edit flag offensive delete link more


That's one way to do it, but roswtf doesn't use pluginlib. pluginlib (and the associated packages filters and trajectory_filters) uses a ClassLoader which loads up a specific C++ class in order to use the plugin.
David Lu gravatar image David Lu  ( 2011-10-13 07:03:58 -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

1 follower


Asked: 2011-10-12 10:17:26 -0500

Seen: 920 times

Last updated: Oct 13 '11