Coder Social home page Coder Social logo

xbox-raspberrypi-rover's Introduction

Control a Raspberry Pi Rover using Xbox One Controller

This repo contains a set of python scripts to drive Adeept Mars Rover PiCar-B with an Xbox One controller (over Bluetooth). The application code is not tighly coupled to work only with Adeept Mars Rover and can be easily updated to drive any Raspberry Pi enabled rover.

Prerequisites

  • Raspberry Pi (with Bluetooth)
  • Xbox One controller Generation 2 or later which has bluetooth support
    Adeept Mars Rover PiCar-B
  • Setup and pair your Xbox One Bluetooth Controller using the xpadneo driver with your Raspberry Pi (Raspbian)
  • Assembled Adeept Mars Rover PiCar-B
    Adeept Mars Rover PiCar-B
  • Launch Raspberry Pi terminal and install sudo pip3 install evdev

Adding Sound Effects

The Adeept rover comes with Adafruit NeoPixel LED strip which can be used to create exciting light effects. The LED strip uses the NeoPixel library to make this work. I have realised that using this library interferes with the Raspberry Pi onboard USB and Bluetooth sound drivers. So in case you want to play some sound effects from the Raspberry then expect to hear a choppy playback.    

To workaround this, I added an external USB sound card which outputs to an 3.5mm jack connected to a small speaker.
USB Sound Card

So that's on the hardware side.. Now to make it all work, I used the SoX (Sound eXchange) python library which can change the sound card on-the-fly and outputs the effect through the desired channel. . The implementation for the sound effects is done in the Soundfile.py

You'll need to install these packages to enable the sound effects in the code base: sudo apt-get install sox libsox-fmt-mp3 mp3

Usage

  • SSH to your raspberry pi
  • Download this Repository
    git clone https://github.com/erviveksoni/xbox-raspberrypi-rover.git
  • cd xbox_controller_adeept_rover
  • Run sudo python3 drive_rover.py

xbox-raspberrypi-rover's People

Contributors

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