0
$\begingroup$

Rosanswers logo

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.


Originally posted by doekaschi on ROS Answers with karma: 78 on 2020-07-15

Post score: 2

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

This question is very much related to my question asking for a controller plugin in Python: https://answers.ros.org/question/356655/advice-on-nav2-controller-plugin/ 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.

Originally posted by SmallJoeMan with karma: 116 on 2020-07-15

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.