Home
build details

Show: section status errors & todos local changes recent changes last change in-page changes feedback controls

Making your Duckiebot move

Modified 2019-04-03 by Andrea F. Daniele

Breandan Considine, Liam Paull, Andrea F. Daniele

previous task next (14 of 27) index
task

The following was marked as "special-par-assigned".

Breandan Considine, Liam Paull, Andrea F. Daniele

File book/opmanual_duckiebot/atoms_17_operation_manual_duckiebot/2_0_5_make_it_move.md.

File book/opmanual_duckiebot/atoms_17_operation_manual_duckiebot/2_0_5_make_it_move.md
in repo duckietown/docs-opmanual_duckiebot branch master19-liam commit 07d4c56c
last modified by Andrea F. Daniele on 2019-04-03 05:19:43

Created by function create_notes_from_elements in module mcdp_docs.task_markers.

This page is for the DB18 configuration used in classes in 2018. For last year’s instructions see here.

Laptop configured, according to Unit B-1 - Laptop Setup.

You have configured the Duckiebot as documented in Unit B-5 - Duckiebot Initialization.

You have configured Docker communication as documented in Unit B-7 - Setting up the Docker workflow.

You can make your robot move.

Option 1 - Pure Docker

Modified 2019-04-03 by Andrea F. Daniele

Controlling your robot using the dashboard

Modified 2019-04-03 by Andrea F. Daniele

If you followed the instructions in Unit B-8 - Setting up the Dashboard, you should have access to the Duckiebot dashboard.

Make sure that the dashboard container is running by following the instructions in Subsection 8.1.1 - Install Dashboard.

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,

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.

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.

Option 2 - Docker + ROS

Modified 2019-04-03 by Andrea F. Daniele

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

container $  roslaunch duckietown joystick.launch veh:=hostname

You can now use your joystick to move things around

If you have cloned the repo on your laptop and installed ROS, then you can start the keyboard controller interface with

laptop $ make virjoy-hostname

Option 3 - Pure ROS

Modified 2018-09-27 by liampaull

SSH into the Raspberry Pi and run the following from the duckietown directory:

duckiebot $ cd ~/duckietown
duckiebot $ source environment.sh

The environment.sh setups the ROS environment at the terminal (so you can use commands like rosrun and roslaunch).

Now make sure the motor shield is connected.

Run the command:

duckiebot $ make demo-joystick

If there is no “red” output in the command line then pushing the left joystick knob controls throttle - right controls steering.

Close the program using Ctrl-C.

ssh into your robot and run:

duckiebot $ make demo-joystick

Now on your laptop run:

laptop $ make virjoy-hostname

you need to have pygame installed, see the README

not currently supported on Mac OSX

It is possible you will have to unplug and replug the joystick or just push lots of buttons on your joystick until it wakes up. Also make sure that the mode switch on the top of your joystick is set to “X”, not “D”.

XXX Is all of the above valid with the new joystick?

previous task next (16 of 27) index
task

The following was marked as "status-XXX".

XXX Is all of the above valid with the new joystick?

File book/opmanual_duckiebot/atoms_17_operation_manual_duckiebot/2_0_5_make_it_move.md.

File book/opmanual_duckiebot/atoms_17_operation_manual_duckiebot/2_0_5_make_it_move.md
in repo duckietown/docs-opmanual_duckiebot branch master19-liam commit 07d4c56c
last modified by Andrea F. Daniele on 2019-04-03 05:19:43

Created by function create_notes_from_elements in module mcdp_docs.task_markers.

No questions found. You can ask a question on the website.