Skip to main content

Benchmarking Non-prehensile Interactive Navigation

Project description

BenchNPIN: Benchmarking Non-prehensile Interactive Navigation

BenchNPIN is a comprehensive suite of benchmarking tools for mobile robot non-prehensile interactive navigation. The goal of BenchNPIN is to provide researchers a standarized platform for training and evaluating algorithms in non-prehensile interactive navigation. BenchNPIN provides simulated environments for a wide range of non-prehensile interactive navigation tasks, metrics specifically capturing both task efficiency and interaction effort, policy templates with reference implementations.

The Environments

Navigating Maze with Movable Obstacles

env = gym.make('maze-NAMO-v0')

This environment features a static maze structure with randomly initialized obstacles. The robot's task is to navigate from a starting position to a goal location while minimizing path length and obstacle collisions.


The Maze environment.

Autonomous Ship Navigation in Icy Waters

env = gym.make('ship-ice-v0')

In this task, an autonomous surface vehicle must reach a horizontal goal line ahead while minimizing collisions with broken ice floes in the channel.


The Ship-Ice environment.

Box Delivery

env = gym.make('box-pushing-v0')

The Box-Delivery environment consists of a set of movable boxes to be delivered to a designated receptacle. The robot is tasked to delivery all boxes using its front bumper.


The Box-Delivery environment.

Area Clearing

env = gym.make('area-clearing-v0')

This envronment consists of a set of movable boxes and a clearance area. The task of the robot is to remove all boxes from this clearance area.


The Area-Clearing environment.

Installation

Install from pip

pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ benchnpin

NOTE: we are currently using TestPyPI, and will release the official PyPI library soon. Please stay tuned! The pip install above is sufficient to run Ship-Ice and Maze environments. To run Box-Delivery and Area-Clearing, please install shortest path module as follows

git clone https://github.com/IvanIZ/spfa.git
cd spfa
python setup.py install

Build from source

  1. Clone the project
git clone https://github.com/IvanIZ/BenchNPIN.git
  1. Install dependencies.
cd BenchNPIN
pip install -r requirements.txt
  1. Install Gym environment
pip install -e .
  1. Install shortest path module
git clone https://github.com/IvanIZ/spfa.git
cd spfa
python setup.py install

Usage

Running an interactive navigation environment

import benchnpin.environments
import gymnasium as gym

env = gym.make('ship-ice-v0')
observation, info = env.reset()

terminated = truncated = False
while not (terminated or truncated):

    action = your_policy(observation)
    observation, reward, terminated, truncated, info = env.step(action)
    env.render()

Creating a custom policy from the policy template

from benchnpin.baselines.base_class import BasePolicy

class CustomPolicy(BasePolicy):

    def __init__(self) -> None:
        super().__init__()

        # initialize costum policy here
        ...

    
    def train(self):
        # train the custom policy here, if needed
        ...


    def act(self, observation, **kwargs):
        # define how custom policy acts in the environment
        ...

    
    def evaluate(self, num_eps: int, model_eps: str ='latest'):
        # define how custom policy is evaluated here
        ...

Running benchmarks on policies

from benchnpin.common.metrics.base_metric import BaseMetric
import CustomPolicy1      # some custom policies
import CustomPolicy2
import CustomPolicy3

# initialize policies to be evaluated
policy1 = CustomPolicy1()
policy2 = CustomPolicy2()
policy3 = CustomPolicy3()

# run evaluations
num_eps = 200    # number of episodes to evaluate each policy
benchmark_results = []
benchmark_results.append(policy1.evaluate(num_eps=num_eps))
benchmark_results.append(policy2.evaluate(num_eps=num_eps))
benchmark_results.append(policy3.evaluate(num_eps=num_eps))

# plot efficiency and effort scores
BaseMetric.plot_algs_scores(benchmark_results, save_fig_dir='./')

Implemented Baselines

Tasks Baselines
Maze SAC1, PPO1
Ship-Ice SAC1, PPO1, SAV Planning2, 3
Box-Delivery SAC1, PPO1, SAM4
Area_Clearing SAC1, PPO1, SAM4, GTSP5

1: Reinforcement Learning policies Integrated with Stable Baselines 3.

2: Planning-based policy using an ASV ice navigation lattice planner.

3: Planning-based policy using a predictive ASV ice navigation planner.

4: Spatial Action Maps policy.

5: A Generalized Traveling Salesman Problem (GTSP) policy. Please see Appendix I of our paper for details.

Trained Models

You may download the our trained model weights from here.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

benchnpin-0.1.0.tar.gz (77.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

benchnpin-0.1.0-py3-none-any.whl (77.9 MB view details)

Uploaded Python 3

File details

Details for the file benchnpin-0.1.0.tar.gz.

File metadata

  • Download URL: benchnpin-0.1.0.tar.gz
  • Upload date:
  • Size: 77.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for benchnpin-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6670c8d26e161e20863b50be1abaca04f12628ceffce64da38611ce0e4cbbb79
MD5 e0f9427adb4fd5a6ae2dbf15bcfb7f40
BLAKE2b-256 deab688b384e4a076127206e2df2d4cfa45fa2925c1748a5dbe4c703f0ca70fb

See more details on using hashes here.

File details

Details for the file benchnpin-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: benchnpin-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 77.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for benchnpin-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 774fe3058a3a6e1fc61876290c56ea6bb44147940a59af99e187a4853bd97f1e
MD5 362a80dbf93a5b0f7232d0f088e1fa9b
BLAKE2b-256 a6b21574d173fa0e5023bbd43a8dccd25783ebf07e4eef792a99578bc64aa23e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page