GithubHelp home page GithubHelp logo

badgr's Introduction

BADGR: An Autonomous Self-Supervised Learning-Based Navigation System

Gregory Kahn, Pieter Abbeel, Sergey Levine

Website link

Installation

Make sure you have 90GB of space available, anaconda installed, and ROS installed. Our installation was on Ubuntu 16.04 with ROS Kinetic.

Clone the repository and go into the folder:

git clone https://github.com/gkahn13/badgr.git
cd badgr

From now on, we will assume you are in the badgr folder.

Download the training data tfrecords and sample rosbags from here, and extract them into the data folder:

mkdir data
cd data
mv </path/to/BADGR_collision_tfrecords.zip> .
mv </path/to/BADGR_bumpy_tfrecords.zip> .
mv </path/to/BADGR_rosbags.zip> .
unzip BADGR_collision_tfrecords.zip
rm BADGR_collision_tfrecords.zip
unzip BADGR_bumpy_tfrecords.zip
rm BADGR_bumpy_tfrecords.zip
unzip BADGR_rosbags.zip
rm BADGR_rosbags.zip
cd ..

Then setup the anaconda environment:

conda create -y --name badgr python==3.6.9
source activate badgr
pip install -r requirements.txt
sudo apt-get install ros-${ROS_DISTRO}-ros-numpy

Add the src directory to your PYTHONPATH:

echo 'export PYTHONPATH=</path/to/badgr/src>:$PYTHONPATH' >> ~/.bashrc

Training

Open a new terminal and activate the badgr anaconda environment:

source activate badgr

We train two separate neural networks: one that predicts future collisions and positions, and one that predicts bumpy terrain:

python scripts/train.py configs/collision_position.py
python scripts/train.py configs/bumpy.py

These networks are trained separately so that the data can be rebalanced for either equal proportion collision or bumpy labels. However, at test time these models are combined into a single predictive model, which is possible because the models both have the same inputs.

Create the folder for the combined model:

mkdir data/bumpy_collision_position

Evaluation

First, play the collision rosbag in a loop,

rosbag play -l data/rosbags/collision.bag

set the cost function weights to only account for collisions,

rosparam set /cost_weights "{'collision': 1.0, 'position': 0.0, 'position_sigmoid_center': 0.4, 'position_sigmoid_scale': 100., 'action_magnitude': 0.01, 'action_smooth': 0.0, 'bumpy': 0.0}"

and then start the policy

python scripts/eval.py configs/bumpy_collision_position.py

This will display a visualizer showing the candidate action sequences, predicted probabilities of collision, and the optimal action sequence for purely avoiding collisions.

Evaluation Display

If you wish to visualize the planner for avoiding bumpy terrain, start the bumpy rosbag in a loop,

rosbag play -l data/rosbags/bumpy.bag

change the cost function,

rosparam set /cost_weights "{'collision': 0.0, 'position': 0.0, 'position_sigmoid_center': 0.4, 'position_sigmoid_scale': 100., 'action_magnitude': 0.01, 'action_smooth': 0.0, 'bumpy': 1.0}"

change the visualizer to show bumpiness by modifying configs/bumpy_collision_position.py to have debug_color_cost_key='bumpy', and restart the policy

python scripts/eval.py configs/bumpy_collision_position.py

FAQ

  1. If you are having issues with importing OpenCV (e.g., ImportError: /opt/ros/kinetic/lib/python2.7/dist-packages/cv2.so: undefined symbol: PyCObject_Type), try the following to have python look for the Python 3 OpenCV first:
export PYTHONPATH=<path/to/anaconda/envs>/badgr/lib/python3.6/site-packages/:$PYTHONPATH

badgr's People

Contributors

gkahn13 avatar

Watchers

 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.