Giter VIP home page Giter VIP logo

rovercode's Introduction

actionshot

screenshot

Rovercode

Chat Zenhub Board Build Status Coverage Status

Rovercode is easy-to-use package for controlling robots (rovers) that can sense and react to their environment. The Blockly editor makes it easy to program and run your bot straight from your browser. Just drag and drop your commands to drive motors, read values from a variety of supported sensors, and see what your rover sees with the built in webcam viewer.

Rovercode runs on a Raspberry Pi 3 with the GrovePi+ sensor board and the Grove I2C motor controller board.

Setup

Creating Your .env

First, create an app.rovercode.com account here. Then, navigate to the "My Rovers" section and create a new rover. Once it is created, click the "Download Credentials" button at the bottom of the rover's detail page. The file will download as something like rovercode_yourrovername.env. Save this file to a flash drive.

Rover Setup

This setup is tested on Raspbian Stretch. There may be issues on Raspbian Buster.

First, on your Raspberry Pi:

$ sudo apt-get update
$ curl -sSL https://get.docker.com | sh
$ sudo raspi-config # choose "5 Interfacing Options", then choose P5 I2C and enable it.
$ docker pull rovercode/rovercode-arm
$ sudo wget https://raw.githubusercontent.com/rovercode/rovercode/development/services/rovercode-commissioning.service /etc/systemd/system/
$ sudo wget https://raw.githubusercontent.com/rovercode/rovercode/development/services/rovercode.service /etc/systemd/system/
$ sudo systemctl enable rovercode-commissioning.service  # An error about the file already existing is ok.
$ sudo systemctl enable rovercode.service  # An error about the file already existing is ok.
# Turn off your Raspberry Pi, insert your thumbdrive with the `rovercode_yourrovername.env` file, and turn the Raspberry Pi back on.

Once the Raspberry Pi restarts, the commissioning service should run, followed by the rovercode service. Run sudo systemctl status rovercode.service to confirm that it is running. Then, on any PC or tablet, head to app.rovercode.com to connect to your rover.

Development PC Setup

When developing Rovercode, you may want to run Rovercode on your PC instead of a Raspberry Pi. Below are instructions for how to install and run Rovercode on your PC.

$ git clone --recursive https://github.com/rovercode/rovercode.git && cd rovercode
$ docker build -t rovercode .
# Copy in the `rovercode_yourrovername.env` file as `.env` (nothing before the dot)
$ cp ~/Downloads/rovercode_yourrovername.env .env
$ docker run --env DEVELOPMENT=true --name rovercode -v $PWD:/var/rovercode rovercode

Note the --env DEVELOPMENT=true flag. Then, still on your development PC, head to app.rovercode.com and connect to your "rover" (your PC running the service).

Testing

Run the tests like this:

$ docker run --name rovercode-tests -v $PWD:/var/rovercode --entrypoint=/bin/bash rovercode -c 'python -m pytest'
$ docker run --name rovercode-tests -v $PWD:/var/rovercode --entrypoint=/bin/bash rovercode -c 'prospector'

Docs

More detailed usage instructions can be found here.

Read the complete docs here.

Contact

We'd love to say hi! Join our chat!.

License

GNU GPLv3 © Rovercode LLC and Rovercode contributors

rovercode's People

Contributors

andysmithfal avatar asomov avatar blhurlburt avatar cabarnes avatar ehooo avatar gitter-badger avatar guillier avatar hbradio avatar matthw avatar rjfendricks avatar ryanknutson avatar tdicola avatar wavetylor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rovercode's Issues

Code editor

Allow user to switch to Javascript text code editing mode. This will create a new project and disable all block viewing and editing.

Handle CORS properly

With our app talking to the API, we currently opted to just let everything under the sun make valid requests using the flask_cors. We should probably figure out how to implement cors correctly so we don't look like a bunch of insecure web babies.

This looks like a good source to start on: https://remysharp.com/2011/04/21/getting-cors-working

Webpage sometimes stalls loading saved designs

Sometimes (once out of every three page reloads or so), the the saved designs will take a long time (minutes) to load.
The rest of the page is responsive, except that the design name will not be populated.
When the saved designs finally do load, there is a lot of console log activity of events coming in.

Add html directory to lighttpd.conf in setup.sh

After running setup.sh, localhost shows me the default lighttpd page. We forgot to change the lighttpd.conf to point to our rovercode/www directory.

Since we're moving to nginx, we won't fix this.

Set LED color

Let the rover have an on-board RGB LED. Blockly already has a color picker.

As a teacher, I would like to assign motors/sensors to GPIO to match how I wired the hardware.

rovcercode-web (https://github.com/aninternetof/rovercode-web) will have a page that allows a teacher to do things like assign "right motor foward" or "left IR sensor" to GPIOX. Right now, the GPIO assignments are all hardcoded in the JavaScript.

The rover API should present what pins it has available to the rovercode-web app.

It could auto-detect what hardware it is running on (The Adafruit GPIO object knows that hardware it is running on, so we should just ask it).

Saving bds not working

Getting a 400 response from saving block diagrams. Some sort of conflict with ajax json settings.

Select new web backend

We need a stack that will

  • smoothly handle live information on the webpage (detected speech coming in, sensor status, overlays on the camera image, etc)
  • be easy to install

Node + [something] on the back end? React or Angular on the front end?

Camera detect ball

Detect ball of a given color and return its coordinates. Draw these coordinates over the webcam stream.

Text-to-Speech

Make the rover say something using a text-to-speech engine (online or local)

It's possible to turn a motor on forward and backward at the same time

This is not great for the motor.

If a motor is running then turned on in a different direction without first being stopped, rovercode should automatically shut off the first direction pwm pin.

I'm not sure at what level this should happen. It seems safest to do it on the rover side instead of the client side. But, it'll need to get info from the client at connection to know what pins are forward/backward pairs.

Code viewer

Add a tab to view the generated code instead of the blocks. Not editable.

Google Cast support

A Google Cast screen from the main browser interface. The Casted screen will show the Rover's webcam feed, toggle to the view the code blocks, and whatever other information from the rover seems right.

Migrate sensor event handling to Flask (and choose reatime platform)

Right now, a change in a sensor value is detected in rover-service.py, then sent over Redis to a php function that generates a server-sent event. All of this should be able to be done in app.py now.

We'll need to decide if we want to stick with SSEs, or move to websockets.

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.