rovercode-web¶
License: | GPLv3 |
---|---|
Source: | https://github.com/aninternetof/rovercode-web |
Hosted at: | https://rovercode.com (master) and https://beta.rovercode.com (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.

Architecture¶
rovercode is made up of two parts:
- rovercode-web (the docs you’re reading right now) is the web app running at rovercode.com.
- rovercode (a separate repo documented here) is the service that runs on the rover.
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¶
Install docker and docker-compose, then
$ 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
Basic Commands¶
rovercode-web runs is built with Django. During development, you can do regular Django things like this:
$ docker-compose -f dev.yml run django python manage.py migrate
$ docker-compose -f dev.yml run django python manage.py createsuperuser
If anything gives you trouble, see the detailed cookiecutter-django Docker documentation.
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 |
---|
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-web 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.
Chat with us on the rovercode Slack channel.
Follow the the code of conduct.
modules¶
rovercode-web has two modules. rovercode-web serves the homepage and manages users. mission-control is the Blockly app.
mission-control¶
This is the web application where students create and run Blockly designs.
mission_control.apps |
Mission Control apps. |
mission_control.models |
Mission Control models. |
mission_control.serializers |
Mission Control serializers. |
mission_control.urls |
|
mission_control.utils |
|
mission_control.views |
rovercode-web¶
This is the main website. It handles all of the non-Mission-Control things, like serving the landing page and logging in users.
config.urls |
|
rovercode_web.users.adapters |
|
rovercode_web.users.admin |
|
rovercode_web.users.apps |
|
rovercode_web.users.models |
|
rovercode_web.users.urls |
|
rovercode_web.users.views |