Skip to content
Permalink
Browse files

added docs about dashboard

  • Loading branch information...
afdaniele committed Apr 3, 2019
1 parent 4f42e7e commit 985dd779125cd1aa014bdcaea3820cac21700fac
@@ -0,0 +1,149 @@
# Setting up the Dashboard {#duckiebot-dashboard-setup status=ready}

Assigned: Andrea F. Daniele

This section shows how to install the Duckietown dashboard on the Duckiebot using Docker.


<div class='requirements' markdown='1'>

Requires: Laptop configured, according to [](#laptop-setup).

Requires: You have configured the Duckiebot as documented in [](#setup-duckiebot).

Requires: You have configured Docker communication as documented in [](#docker-setup).

Results: You have access to a web-based Dashboard for your Duckiebot.

</div>


## The \compose\ platform {#compose-platform}

\\compose\\ is a CMS (Content Management System) platform that provides functionalities
for fast-developing web applications. Custom applications are developed as external
packages that can be installed using the built-in Package Store.

The Duckiebot Dashboard is a package that you can install on your instance
of \\compose\\ running on your Duckiebot.
To make is easier for you to get started, we provide a Docker image with \\compose\\
and all the packages you need. Follow the instructions in the next step to get started.

Visit the [official documentation page](http://compose.afdaniele.com/docs/latest/index)
for further information about \\compose\\.


### Install Dashboard {#dashboard-installation}

Use the following command to run the dashboard on your Duckiebot:


laptop $ docker -H ![hostname].local run -dit --net=host --name dashboard duckietown/rpi-duckiebot-dashboard:master19



## Dashboard - First-setup {#dashboard-first-setup}

Wait up to 20 seconds, then open the URL `http://![hostname].local` in your browser.
You should be able to see the following page,

<div figure-id="fig:compose_first_setup" figure-caption="">
<img src="compose_first_setup.png" style='width: 30em'/>
</div>


### Steps 1, 2

By default, \\compose\\ uses Google Sign-In to authenticate the users.
In Duckietown, we use authentication based on personal tokens. You should be able to
retrieve yours by visiting the page:

> [`https://www.duckietown.org/site/your-token`](https://www.duckietown.org/site/your-token)
Since we are not going to use Google Sign-In, you can click on **Skip**.
This will let you skip the first two steps and move straight to **Step 3**.
Do not worry about creating an administrator account (Step 2) for now,
the Duckietown package is going to create one for us as soon as we authenticate
for the first time using our personal token.


### Step 3

At this point, the **Step 3** tab should be open, as shown in the image below.

<div figure-id="fig:compose_first_setup_step3" figure-caption="">
<img src="compose_first_setup_step3.png" style='width: 34em'/>
</div>

You can complete this step as you please.
Feel free to update all the fields, and remember, you can always update your
choices through the page **Settings** after you authenticate
using your personal token.

When you are happy with your choices, click on **Next**.


### Step 4

The **Step 4** tab should now be open, as shown below.


<div figure-id="fig:compose_first_setup_step4" figure-caption="">
<img src="compose_first_setup_step4.png" style='width: 34em'/>
</div>


You can go ahead and press **Finish**.


## First Login

If everything went as planned, the dashboard is now configured and ready to go!

You should be able to see the login page, as shown below.

<div figure-id="fig:dashboard_login_page" figure-caption="">
<img src="dashboard_login_page.png" style='width: 34em'/>
</div>

Since we skipped the first two steps of the **First Setup** section
([](#dashboard-first-setup)), we cannot login using a Google account.
As discussed above, the Duckietown package provides its own login system,
which is based on the Duckietown personal token (Duckietoken).
If you have not retrieved yours, it is now time to do so by visiting
the page:

> [`https://www.duckietown.org/site/your-token`](https://www.duckietown.org/site/your-token)
Note: Since your dashboard does not have an administrator account yet,
the first user to login will be automatically assigned the role of
administrator. If you have multiple tokens, make sure to keep note of
which one you used for the first login.

Once you have your personal token, you can go ahead and click on
the button **Sign in with Duckietown**.
You should now see a dialog like the one shown below,

<div figure-id="fig:dashboard_login_with_duckietown_modal" figure-caption="">
<img src="dashboard_login_with_duckietown_modal.png" style='width: 35em'/>
</div>

Copy/paste or type in your personal token and press Login.
Wait for the token to be validated, and if your token is correct, you will
be redirected to your profile page, similar to the one shown below.

<div figure-id="fig:dashboard_profile_page" figure-caption="">
<img src="dashboard_profile_page_full.png" style='width: 35em'/>
</div>

As you might have noticed, the top bar now shows many more pages. Some pages are
accessible by all users, others only by administrators (e.g., Settings,
Package Store, Debug).

Also, you might have noticed that some Duckietown-specific pages are already
there (e.g., Portainer, Mission Control, Duckietown). This is because we used
a Docker image of \\compose\\ that comes with some Duckietown packages
pre-installed.

Take your time to visit all the pages and get comfortable with the platform.
We will discuss the functionalities offered by each page in the next sections.
@@ -1,6 +1,6 @@
# Making your Duckiebot move {#rc-control status=ready}

Assigned: Breandan Considine, Liam Paull
Assigned: Breandan Considine, Liam Paull, Andrea F. Daniele

This page is for the `DB18` configuration used in classes in 2018. For last year's instructions see [here](https://docs.duckietown.org/DT17/).

@@ -23,22 +23,20 @@ both for the laptop and for the Duckiebot. The procedure is documented in [](+so


## Option 1 - Pure Docker {#make-it-move_docker status=beta}


### Run the `roscore` container


### Run the `roscore` container

Use the following command to run the container that contains `roscore`:

laptop $ docker -H ![hostname].local run -dit --privileged --name roscore --net host -v /data:/data --restart unless-stopped duckietown/rpi-ros-kinetic-roscore:master18

If this is the first time you run this, it might take some time to download the container.

Verify that the container is running by either using [the Portainer interface](#docker-setup-portainer-interface)
or by using `docker ps`.

or by using `docker ps`.



### Run the joystick demo

Use the following command to run the joystick demo:
@@ -49,11 +47,61 @@ Use the following command to run the joystick demo:

### Controlling your robot with a joystick


If you have a joystick, you can use it to make your robot move.

Otherwise, you can use the following instructions to run the demo with
keyboard control
Otherwise, you can use the following instructions to run the demo with
keyboard control.


### Controlling your robot using the dashboard {#setup-ros-websocket-image}

If you followed the instructions in [](#duckiebot-dashboard-setup), you
should have access to the Duckiebot dashboard.

Note: Make sure that the dashboard container is running by following the instructions
in [](#dashboard-installation).

In order for your dashboard to be able to exchange messages with your
robot, you need to setup a communication channel. Of course, we have a
Docker image for this. Running the following command will give the
dashboard access to the ROS messaging system that powers your robot.


laptop $ docker -H ![hostname].local run -dit --name ros-websocket --network=host duckietown/rpi-duckiebot-rosbridge-websocket:master18


You can now open the browser and visit the page `http://![hostname].local/mission-control`.

This is the Mission Control page. It is the page that lets you monitor and control
your Duckiebot. The top of the page should be similar to the following image,


<div figure-id="fig:dashboard_mission_control_auto" figure-caption="">
<img src="dashboard_mission_control_auto.png" style='width: 35em'/>
</div>


The first thing to check to make sure that everything we have done so far
is correct, is the status of the **Bridge**, in the top-right corner of the page.
The label should show the status "**Bridge: Connected**" (as shown in the image above).
If the indicator reads "**Bridge: Closed**", it means that something went wrong
while launching the ROS websocket node above. In that case, start again from
the beginning of this section.

Note: Don't worry if one of the blocks is called "Camera" but you
don't see an image. We will get to that later.

This page will show you lateral and angular speed of your robot, and
a plot of left and right motor speed. Toggle the **Take over** switch
in the top-right corner of the page to gain control of your robot.
You will see that the background of the page will highlight and the
central plot will start moving.

You can now use the arrows on your keyboard to drive your Duckiebot.

**Did you know?**
The page contains 4 blocks by default. Feel free to drag them around and rearrange
them as you please. You can also use the menu button of each block to resize them.


### Controlling your robot with your keyboard
@@ -94,13 +142,14 @@ Note: If the above doesn't work, try running the command line interface version

## Option 2 - Docker + ROS {#make-it-move_docker_ros status=beta}


Run the base image on the duckiebot:


laptop $ docker -H ![hostname].local run -it --net host --privileged --name base duckietown/rpi-duckiebot-base:master18 /bin/bash


Then when the container has started
Then when the container has started


container $ roslaunch duckietown joystick.launch veh:=![hostname]

@@ -121,7 +170,6 @@ If you have cloned the repo on your laptop and installed ROS, then you can start
## Option 3 - Pure ROS {#make-it-move_ros status=deprecated}



#### Controlling your robot with a joystick

SSH into the Raspberry Pi and run the following from the `duckietown` directory:
@@ -176,7 +224,7 @@ XXX Is all of the above valid with the new joystick?



## Troubleshooting
## Troubleshooting

Symptom: When do a `docker run` command you get a response like: `Error response from daemon: Get https://registry-1.docker.io/v2/: x509: certificate has expired or is not yet`

@@ -205,7 +253,7 @@ Resolution: Test whether or not the joystick itself is working properly, run:
Move the joysticks and push the buttons. You should see the data displayed change
according to your actions.

Resolution: Check that the cables on your robot are connected
Resolution: Check that the cables on your robot are connected



@@ -35,13 +35,14 @@ Now stop the `picam` container:

warning The `picam` container is just for this example to verify your camera works. You should leave this container stopped if you plan to use the camera in other containers.

## Viewing an Image Stream on Your Laptop

## Viewing an Image Stream on Your Laptop {#view-image-using-rqt-image-view}

Start publishing images through ROS on the Duckiebot using
the container `rpi-duckiebot-ros-picam`:


laptop $ docker -H ![hostname].local run -it --name ros-picam --network=host --device /dev/vchiq -v /data:/data duckietown/rpi-duckiebot-ros-picam:master18
laptop $ docker -H ![hostname].local run -it --name ros-picam --network=host --device /dev/vchiq -v /data:/data duckietown/rpi-duckiebot-ros-picam:master18

Note: you need `-v /data:/data` because of the calibration procedure later.

@@ -73,10 +74,43 @@ The container will start. At the prompt, run:
The command should open a window where you can view the image.
You have to select the right topic from the dropdown menu.


## Viewing the image stream on the Dashboard

If you followed the instructions in [](#duckiebot-dashboard-setup), you
should have access to the Duckiebot dashboard.

A few things to check before continuing:

- Make sure that the dashboard container is running, as explained in [](#dashboard-installation).

- Make sure that the camera node is running, as explained in [](#view-image-using-rqt-image-view).

- Make sure that the ROS websocket bridge is running, as explained in [](#setup-ros-websocket-image).


Open the browser and visit the page `http://![hostname].local/mission-control`.

The bottom of the page shows the camera block. If you followed all the steps described
above, you should be able to see the camera feed in the camera block, as shown in the
image below.

<div figure-id="fig:dashboard_mission_control_camera_feed" figure-caption="">
<img src="dashboard_mission_control_camera_feed.png" style='width: 35em'/>
</div>

By default, the camera stream is throttle down to 8 frames per second. This is to
minimize the resources used by your browser while streaming images from the robot.
Feel free to increase the data stream frequency in the **Properties** tab of the
camera block.

Note: If you see a black image in the camera block, make sure that you removed the
protective cap that covers the camera lens of your Duckiebot.


## Verifying the output by using the ROS utilities

Close the `rqt_image_view` window and type the next commands in the same
window.
Use the commands below to check the data streams in ROS.


### List topics

0 comments on commit 985dd77

Please sign in to comment.
You can’t perform that action at this time.