Milling Exercise - GMU-ASRC/turbopi GitHub Wiki

This is an exercise designed to get you familiar with both our TurboPis and the overall process of discovering, engineering, and deploying emergent behaviors in swarms of robots.

Let's say you've designed an entirely new robot from scratch. How do you make it do an emergent behavior? We propose 4 distinct steps:

  1. Characterize
    1. Create models of the robot's sensing and actuation characteristics
  2. Program
    1. Program the models from Step 1. into a simulator
  3. Simulate and Explore
    1. Find a control strategy which produces the behavior you want in your simulator
  4. Deploy
    1. Program that same control strategy into each of the real robots
    2. Profit???

This is the process we used to make the TurboPis mill (follow each other in a circle).

infovaya_graphicalabstract-card

Today, we'll have you repeat this process. You'll learn the ins and outs of working with TurboPis,
how to work with a simulator and find emergent behaviors,
and boost your technical skills.

But once also understand the overall process well enough, the idea is that you'll be able to repeat it with a new behavior or even a new robotic platform.

Let's get started!

1. Characterize

First, you'll need a fully-built TurboPi.
If you've been given an already-built one, you should re-flash the TurboPi to restore it to factory condition, and then set it up with all out software goodies.

Setting up the TurboPi

If you just built a TurboPi out-of-the-box, you can probably skip the factory reset section, as the microSD card has already been flashed.

See Factory Reset, Powerup, and Automated Setup

Once you've ensured the sensors are calibrated, you need to create Sensing and Actuation models.

But before you begin this, please check the battery level of the robot.

Sensing models

Connect to the Pi again. If the git repository setup was successful, you'll be on the main branch and you should see a milling_controller.py file in the home directory of the Pi.

Open a terminal on the Pi and run sudo python milling_controller.py --dry_run.

The LEDs on the top of the robot should be green or red, depending on if the robot sees green or not respectively.

Set one robot on the floor and move another robot with a green ping pong ball into the first robot's field-of-vision. You should see the LED change color.

Use this to find the boundary on the floor of where the LED on the first robot is flickering/solid green at least 80% of the time.

Actuation models

Connect to the Pi again. If the git repository setup was successful, you'll be on the main branch and you should see a drive.py file in the home directory of the Pi.

Open a terminal on the Pi and run sudo python drive.py -v 100 -w 0. Hold the robot in your hands to prevent it from driving away from you, as the wheels should start turning.

v should be between 0 and 100, and w should be between -2 and 2.

Note: If you leave out v or w, the default value will be v=0 and w=0.

Follow the measurement procedures to find the actual speed and turning rate of the robot for different combinations of v and w.

Store the combinations and the resulting forward speeds and turning rates in a spreadsheet.

Challenge: There's a -d parameter. What does it do? What are the acceptable ranges? What's the default value for it?