Giter Site home page Giter Site logo

johntgz / colpred_nmpc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ntnu-arl/colpred_nmpc

0.0 0.0 0.0 41 KB

This repository contains the software and data for the ICRA2023 submitted article "NMPC for Deep Neural Network-Based Collision Avoidance exploiting Depth Images"

Python 100.00%

colpred_nmpc's Introduction

Collision Predictor NMPC

This repository contains the framework using in our paper called: "Nonlinear Model Predictive Control for Deep Neural Network-Based Collision Avoidance exploiting Depth Images", submitted to ICRA 2024. The associated (temporary) video can be seen at https://youtu.be/aELjlfwAjfk.

Installation

First, install:

Other Python requirements are listed in requirements.txt and can be installed with pip:

pip install -r requirements.txt

Clone the repo and navigate to main folder. Then, the package can be install using pip:

pip install -e .

NOTE: For convenience, the training data base folder is defined in colpred_nmpc/__init__.py, as the variable COLPREDMPC_DATA_DIR. For retraining on your own dataset, please update this global variable or set the correct path in the training/testing scripts.

Repo architecture

The repo folder is organized as follow:

  1. colpred_nmpc: Main module folder, including Neural Nets, Casadi+Acados based controller, and ROS wrapper.
  2. config: Yaml files for missions configurations and robot parameters.
  3. gazebo: A handful of Gazebo world files used in simulations. NOTE: spawns robot module which uses mrsim-gazebo for simulations using GenoM. Should be replaced/removed for using with another simulation pipeline.
  4. logs: Contains execution logs and Neural Nets weight files. This is where the scripts are looking for weights by default.
  5. scripts: Scripts folder, including NN training/testing and main ROS controller (nmpc_ros.py).

Usage

The training dataset and neural network weights will be uploaded soon.

Training

Use depth_state_check_train.py for training the Neural Network. The class Colpred encompasses the network definition as well as convenience functions.

Testing

The script depth_state_check_train.py allows quantitative and qualitative evaluation of the trained network. In particular, it allows to display classfication results (2D slices, or full 3D frustrum volume).

Flying

The Neural NMPC controller is defined in controller.py, and the corresponging ROS interface is defined in ros_wrapper.py. The main script nmpc_ros.py encapsulates the controller initialization, and the actual control loop.

Following ROS services are defined:

  • startstop: starts the control loop
  • goto: sets the desired waypoint relative to current pose, according the p_des in the yaml files.
  • toggle_colpred: enable collision avoidance objective and constraint?

NOTE: When using ml-casadi, PyTorch builds the graph on first execution. Thus, the first call(s) to the CasADi function will be slow. The main script thus processes a fake image once to prevent the first control iteration to be slow.

Ackowledgements

We would like to acknowledge Mihir Kulkarni for the code snippets, in particular for inflate_images.py and collision_checker.py.

Contact

You can contact us for any question:

colpred_nmpc's People

Contributors

sedith avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.