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

Writing a planner plugin for ROS2 using Python

asked 2020-07-15 07:49:28 -0500

doekaschi gravatar image

I found this tutorial, which shows how to create a new planner plugin for ROS2 using C++. However, I was wondering if there are any resources on how to achieve the same goal using Python?

I am aware of the fact, that C++ probably is faster when it's used for path-planning, however I already have a large base of code in Python that I would hate to have to rewrite. Currently, I am considering to send service requests to my Python program from the C++-based planner, however, I would love to hear if there is another (better) option.

Regards.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-07-15 08:59:24 -0500

SmallJoeMan gravatar image

updated 2020-07-15 08:59:41 -0500

This question is very much related to my question asking for a controller plugin in Python: https://answers.ros.org/question/3566... I've looked into this a fair bit, and ended up writing a plugin in c++.

Basically the navigation stack uses pluginlib to dynamically load plugins. I believe it only supports c++ plugins.

I think you have three options:
1) Embed your python in a c++ plugin
2) Call out to python nodes via services/actions from a c++ plugin
3) Startup and manage the lifecycle of your Python planner yourself, remapping topics from any existing c++ planners to your Python planner.

edit flag offensive delete link more

Question Tools

5 followers

Stats

Asked: 2020-07-15 07:49:28 -0500

Seen: 973 times

Last updated: Jul 15 '20