Assignment 4 (Hardware Lab)

The Robots: Bupimos

Our robots (called Bupimos) are built upon a Zumo 32U4 base. The Zumo 32U4 robot is a small (~10 x 10 cm) robot made by Pololu corporation. Low-level motor control occurs on the Zumo, while high-level control takes place on the Raspberry Pi 3 (RPi) computer. Connected to the RPi is a Hokuyo laser range finder.  For more information on these products see the following pages:

Here is a front view of the robot.  Note the “A” button, which must be pressed in order for the robot to move.  For all pictures below you can click on them to get a larger view:

frontHere is a back view:

back

The following is a back view that shows the Zumo power switch and LEDs.
zumo_back

Power

The Zumo has a built-in battery compartment filled with 4 AA batteries.  When these batteries run out.  If your robot stops moving and you’ve checked everything else, get fresh batteries!  There is also a rechargeable USB battery pack with three connectors.  Recharge by connecting a micro USB cable (not provided) to a stable USB power source.  That is, you recharge by connecting the left-most port pictured below.

There is a short micro-USB power-only cable connected from the battery pack to the RPi.  This cable has a switch and this is how you should turn on the RPi.

Please note that the RPi will actually power the Zumo, but it will drain the battery pack quickly and possibly draw an unsafe amount of current.  So make sure that you turn the Zumo’s power switch on as well.

You can also connect the RPi’s micro-USB power input to an AC source so that the batteries are not drained.

Connecting to your Robot

For instructions on connecting to your robot, go to the D2L site for this course where the ROBOT_ADDRESS for each robot is provided, along with the corresponding username and password.  You connect to the robot via ssh through the department’s gateway server.

Note that you can open as many terminals to the robot as you need (but each one has to go through the gateway server, then to the robot).  You can also open graphical applications on the robot (e.g. rviz) by adding the “-Y” option to ssh (for both ssh connections).  However, this will definitely be slow.

Tasks

Task 1: Familiarization

Make sure your robot is powered on (using both the USB cable switch and the Zumo’s power switch).  Wait a few seconds and then log in.  Now inspect the ~/catkin_ws/src directory.  Note the following:

  • bupimo_launch contains all of the launch files.
  • bupimo_msgs contains custom messages relating to the robot.
  • zumo_comms_node communicates with the Zumo robot base.
  • test_behaviours contains some simple movement scripts.  The scripts directory contains the template of a script you will complete in Task 2.
  • scan_to_lines contains a modified version of assignment 3.  That is, it segments and detects lines in the laser data.
  • wall_follow contains a template of a script you will complete in Task 3.

The following will launch all of the necessary components to run the ‘forward_until_wall.py’ script in test_behaviours.  Execute it and check for red text or errors.

If there are no errors, then make sure the robot is in the arena and free to move.  Now press the “A” button on the front of the robot.  This will allow the robot to move.  It should move forward until something lies directly ahead of it.  Stop it by pressing “A” again and/or hitting Ctrl-C.

Read through the following script to understand its operation:

You can also teleoperate the robot using the following launch file.  WARNING: The default speeds are too high for our robot!  After launching this, press “z” a number of times to reduce the maximum forward speed to 0.15 or less.  You may also need to increase the angular speed by pressing “e”.

Drive it around!  Have fun, but not too much—no off-roading!

Task 2: Bounce

Add your own code to the following file to implement a simple form of laser-based obstacle avoidance as described in the file’s comments:

Launch with the following:

DEMONSTRATE your running obstacle avoidance algorithm within the arena.

Task 3: Wall Following

The package ~/catkin_ws/src/scan_to_lines contains a modified version of the laser line extraction algorithm from assignment 3.  Your job is to complete the code in the following script to implement line-based wall-following:

The comments at the beginning of the file describe the desired algorithm.  The vectors referenced within the code are pictured below:

wall_follow_vectors

DEMONSTRATE your running wall following algorithm within the arena.