tud-amr / localPlannerBench

Local Planner Bench
https://tud-amr.github.io/localPlannerBench/
GNU General Public License v3.0
49 stars 5 forks source link

Listen to environment variable to load planners from custom paths #50

Closed c-salmi closed 1 year ago

c-salmi commented 2 years ago

This PR is related to #48.

I'm using an environment variable named LOCAL_PLANNER_BENCH_CUSTOM to specify a list of paths that contain python modules of custom planners.

Environment variables could be a neat way to tell localPlannerBench about these paths, without having to add an argument every time you execute the runner.

Let's say you have a directory with the following path /home/linus/my_custom_planners. The directory should look like:

my_custom_planners
    ├── my_planner_1.py
    ├── my_planner_2.py
    ├── ....            
    └── __init__.py

Where __init__.py should look like:

from .my_planner_1 import MyPlanner1
from .my_planner_2 import MyPlanner2

When this path is added to the environment variable, the runner script will look for the __init__.py and import/register the custom planners.

Let me know what you think of this approach.