Giter VIP home page Giter VIP logo

robocar's Introduction

Robocar

A self-driving car built with raspberry pi and C++ 17.

Robocar on a running track

Videos

Below are some other videos of the Robocar in action

Hardware

Vehicle

The following table contains the basic components necessary for the car.

Item Approx. Price Link
Raspberry Pi $100 amazon
Car chassi $25 amazon
Actuator $7 amazon
Wires $5 amazon
Camera $8 amazon
USB Power Supply $12 amazon
Power bank $35 amazon

Others

Item Approx. Price Link
Additional wires $10 amazon
Soldering Iron $15 amazon
Traffic Signs $12 amazon
Tape (for making lanes) $10 amazon

Software

Installation

Dependencies

1) cmake 3.1+
sudo apt install gcc g++
2) gcc 7.4+
sudo apt install gcc
3) googletest (optional - only for running tests)
$ wget https://github.com/google/googletest/archive/release-1.10.0.tar.gz && \
    tar zxf release-1.10.0.tar.gz && \
    rm -f release-1.10.0.tar.gz && \
    cd googletest-release-1.10.0 && \
    cmake . && \
    make -j && \
    sudo make install
4) OpenCV
# First install dependencies
$ sudo apt-get -y install build-essential cmake pkg-config \
    libjpeg-dev libtiff-dev libjasper-dev libpng12-dev \
    libavcodec-dev libavformat-dev libswscale-dev libv4l-dev \
    libxvidcore-dev libx264-dev \
    libatlas-base-dev gfortran

# Build opencv from source
$ wget -O opencv.tar.gz https://github.com/opencv/opencv/archive/4.1.2.tar.gz && \
    wget -O opencv_contrib.tar.gz https://github.com/opencv/opencv_contrib/archive/4.1.2.tar.gz && \
    tar zxf opencv.tar.gz && \
    tar zxf opencv_contrib.tar.gz && \
    mv opencv-4.1.2/ opencv && \
    mv opencv_contrib-4.1.2/ opencv_contrib && \
    cd opencv && \
    mkdir build && \
    cd build && \
    cmake -D CMAKE_BUILD_TYPE=RELEASE \
        -D CMAKE_INSTALL_PREFIX=/usr/local \
        -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \
        -D ENABLE_NEON=ON \
        -D ENABLE_VFPV3=ON \
        -D BUILD_TESTS=OFF \
        -D OPENCV_ENABLE_NONFREE=ON \
        -D INSTALL_PYTHON_EXAMPLES=OFF \
        -D BUILD_EXAMPLES=OFF .. && \
    make -j4 && \
    sudo make install && \
    sudo ldconfig && \
    sudo apt-get update

# Clean up downloads
$ cd ~/
$ rm opencv.tar.gz && rm opencv_contrib.tar.gz
$ rm -r opencv && rm -r opencv_contrib

# Reboot
$ sudo reboot

5) Tensforflow Lite

Before running the following, make sure you are at the root of this project.

# Make sure you are at robocar root before running this.
$ sudo apt-get -y install build-essential && \
    cd third_party && \
    git clone https://github.com/tensorflow/tensorflow && \
    cd tensorflow && \
    ./tensorflow/lite/tools/make/download_dependencies.sh && \
    ./tensorflow/lite/tools/make/build_rpi_lib.sh

Note: Tensorflow folder is in .gitignore to avoid having it checked-in nto this repo. In the future we might consider having it as submodule.

Build

$ cmake .
$ make

Run tests (optional)

$ cmake . -DBUILD_TESTS=ON
$ make
$ make test

Run

The binary will be in the bin/ directory:

$ sudo bin/robocar

robocar's People

Contributors

andreazevedo avatar

Stargazers

 avatar

Watchers

 avatar  avatar  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.