rovercode

License:GPLv3
Source:https://github.com/aninternetof/rovercode
Hosted at:https://rovercode.com (master) and https://beta.rovercode.com (development)
https://img.shields.io/badge/chat-on%20Slack-41AB8C.svg?style=flat https://img.shields.io/badge/join-mailing%20list-yellow.svg?style=flat https://api.travis-ci.org/aninternetof/rovercode.svg https://coveralls.io/repos/github/aninternetof/rovercode/badge.svg?branch=development

Welcome!

rovercode is an easy-to-use system 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.

https://rovercode.com/static/images/screenshot.jpg

Architecture

rovercode is made up of two parts:

  • rovercode (the docs you’re reading right now) is the service that runs on the rover.
  • rovercode-web (a separate repo documented here) is the web app running at rovercode.com.

rovercode runs on the rover. The rover can be any single-board-computer supported by the Adafruit Python GPIO wrapper library, including the NextThingCo CHIP, Raspberry Pi, and BeagleBone Black.

rovercode-web is hosted on the Internet at rovercode.com. It has a Blockly-based editor (which we call Mission Control) for creating a routine. The routine executes in the browser (sandboxed, of course), and commands are sent to the rover for rovercode to execute (e.g. “stop motor, turn on light”). Events on the rover (“right eye detects something”) are sent to the browser via a WebSocket connection.

The rover and the device running the browser must be on the same local network.

Get Started

Check out the quickstart guide. Then see how to contribute.

Contact

Please join the rovercode developer mailing list! Go here, then click “register”.

Also, we’d love to chat with you! Join the the rovercode Slack channel.

You can also email brady@rovercode.com.

Contents

quickstart

Standard Setup (on rover)

First, on your rover (CHIP, Raspberry Pi, BeagleBone, etc):

$ sudo apt install git
$ git clone --recursive https://github.com/aninternetof/rovercode.git && cd rovercode
$ sudo bash setup.sh #run this only once -- it will take some time
$ sudo bash start.sh #run this each time you boot the rover (or automatically start if chosen in setup)

Then, on any PC or tablet, head to rovercode.com to connect to your rover. Start playing!

Development Setup (on development PC)

When developing rovercode, you may want to run rovercode on your PC instead of a CHIP/Raspberry Pi/Beaglebone. Below are instructions for how to install and run rovercode on your PC. Everything should work fine: rovercode will automatically detect that it is not running on target hardware and will stub out the calls to the motors and sensors.

First, on your development PC:

$ sudo apt install git
$ git clone --recursive https://github.com/aninternetof/rovercode.git && cd rovercode
$ sudo bash setup.sh #run this only once -- it will take some time
$ sudo bash start.sh #run this each time

Then, still on your development PC, head to rovercode.com and connect to your “rover” (your PC running the service).

Alternate Development Setup (on development PC using Docker)

Rather use Docker? First, on your development PC:

$ sudo apt install git docker.io
$ git clone --recursive https://github.com/aninternetof/rovercode.git && cd rovercode
$ sudo docker build -t rovercode .
$ sudo docker run --name rovercode -v $PWD:/var/www/rovercode -p 80:80 -d rovercode

Then, still on your development PC, head to rovercode.com and connect to your “rover” (your PC running the service).

detailed usage

using rovercode with a rovercode-web hosted somewhere other than rovercode.com

By default, when rovercode runs, it registers itself with https://rovercode.com. But what if you want to try your changes to rovercode with https://beta.rovercode.com? Or with your local instance of rovercode-web (as described in the next section)? You can specify the target rovercode-web url by creating a .env file in your rovercode directory.

# first, navigate to the rovercode root diretory (same level as the Dockerfile), then
$ echo ROVERCODE_WEB_URL=https://beta.rovercode.com/ > .env

When you start rovercode, it will register itself with beta.rovercode.com.

develop rovercode and rovercode-web on the same machine at the same time

Get, build, and bring up rovercode-web as usual:

$ git clone --recursive https://github.com/aninternetof/rovercode-web.git && cd rovercode-web
$ sudo docker-compose -f dev.yml build
$ sudo docker-compose -f dev.yml up
$ google-chrome localhost:8000

Get and build rovercode as usual:

$ git clone --recursive https://github.com/aninternetof/rovercode.git && cd rovercode
$ sudo docker build -t rovercode .

Set the url of the rovercode-web target to http://rovercodeweb:8000. You will see in the next step that this is the hostname that we assign to our local rovercode-web container.

# first, navigate to the rovercode root diretory (same level as the Dockerfile), then
$ echo ROVERCODE_WEB_URL=http://rovercodeweb:8000/ > .env

Finally, when you bring up the rovercode container, add a link flag to allow access between this container and your rovercode-web container.

$ sudo docker run -t --link rovercodeweb_django_1:rovercodeweb --net rovercodeweb_default --name rovercode -v $PWD:/var/www/rovercode -p 80:80 -d rovercode

docker-compose named it rovercodeweb_django_1, but notice that we used a colon to rename it simply rovercodeweb. This is necessary, because this becomes the hostname, and Django does not like underscores in hostname headers.

We also had to add a net rovercodeweb_default flag, because docker-compose put rovercode-web on its own network instead of on the default one. (If you’re curious, you can find its name using the command sudo docker network ls.)

rovercode is now running, and you can see that it has registered itself with your local rovercodeweb container by going to http://localhost:8000/mission-control/rovers. You can now select this rover in the mission-control interface, and rover commands will be sent to your rovercode container.

Attribution:DEIS blog post

contribute

There is lots of fun work to be done!

Head on over to the rovercode github. We use ZenHub to improve GitHub’s agile management, so install it, then visit the boards tab to find a fun card in the backlog. Or submit a new card for a bug or cool new feature idea.

And remember, you can do all these same things for rovercode-web.

Chat with us on the rovercode Slack channel.

Follow the the code of conduct.

API

app

Indices and tables