×

PC Control These demos and projects allow the robot to be controlled via a computer.

ArbotiX Commander Control - These demos and projects control the Robot using the ArbotiX Commander, the handheld Arduino based remote control.

Direct Control - These demos and projects control the Robot directly from sensors connected directly to the Robot's control board.

Pose Control - These demos and projects allow you to create and playback a sequence of poses.

Serial Control - These demos and projects control the robot using a serial packet protocol.

Standalone - These demos and projects are deisgned to let your robot function without a computer or additional microcontroller.

Wireless Control - These demos and projects allow you to control the robot wirelessly - usually by replacing the Serial Connection with XBee modules.

Reference - These articles have technical details regarding the control and operation of the robot.

×

More info here

Geekbot Demo 5 - Line Navigator

GB-built.jpg
mt_ignore
Pose Control

This demonstration shows how to run the Geekbot Line Navigator, which allows you to send your Geekbot around a map of locations you define! Give your Geekbot turn-by-turn instructions in code, name your locations, and select your path from the LCD Control Panel. This builds on the lessons we learned in the previous demos, and rounds out our geekbot line following demos with a more advanced but simple to set up activity. This is a great way to utilize the power of Arrays to create a list of instructions before sending your geekbot on a mission!

Contents:
  1. Project Parts List
  2. Assemble your Geekbot
  3. Download the Sketch
  4. Setting Up
  5. Coding the Map

Project Parts List:

RobotGeek Geekbot Kit

Everything you'll need to get started with this demo is included in the RobotGeek Geekbot Kit! We'll be using the Sparkfun Line Follower Array and the RobotGeek LCD Control Panel on the standard Geekbot Base.

Assemble your Geekbot

Geekbot V3 Assembly Guide

Follow and complete the Geekbot V3 Assembly Guide, making sure to follow the directions for mounting the Line Follower Array and RobotGeek LCD Control Panel. If you haven't already done so, go through the Geekduino Getting Started Guide and the Geekbot Getting Started Guide.

Download the Sketch

Geekbot Sketches

A .zip file with all of the Geekbot Sketches can be found here.

If you haven't already done so, download and install the RobotGeek Libraries and Tools here.

Unzip the file and you will have a folder called geekbot-master We recommend that you find the RobotGeek Sketches folder in your Arduino user folder and put the geekbot-master in there. The rest of this guide will assume you've placed your sketches in the following folder.

  Arduino -> RobotGeek Sketches -> geekbot-master

This will be the same 'Arduino' folder you put your libraries and robotgeek tools in, and NOT the folder where the Arduino application is.

Open:

File -> Sketchbook -> RobotGeek Sketches -> geekbot-master -> Geekbot_V3 -> geekbotV3LineNavigator
and upload the code to your Geekduino.

Setting Up

You'll need to place a black line on light flooring, or a white line on dark flooring for the geekbot to follow. A good test pattern is an infinity ∞ line. This gives you a single 4 way intersection that feeds back into itself, so you can make sure your geekbot is taking intersections If you have a light line on dark flooring, you'll have to set invert bits in the code. Check out lines 18-19 in LineSensorArray.cpp:

    mySensorBar.clearInvertBits(); //Default: dark on light
    //mySensorBar.setInvertBits(); //Alternate option: light line on dark
For a dark line on light floor, leave mySensorBar.clearInvertBits(); uncommented. For a light line on dark floor, //comment out mySensorBar.clearInvertBits(); and uncomment mySensorBar.setInvertBits();

You'll need to put your lines down before coding your map.

Setting up intersections:

Intersections have been covered in Demo 3. If you need to revisit the instructions for setting up intersections, you can click here

You can adjust the trim on the fly with the Rotation Knob. If your geekbot is having trouble finding the line, you can adjust the sensitivity of the Line Following Array by turning the blue knob on it.

Coding the Map

The major feature of this firmware is the ability to hard code a map with set destinations for your geekbot to roam through. The map that is presently hard coded is the one we use to roll the geekbot through the office! You will obviously need to set your own course, so let's go over what you'll need to do. Once you've laid down your tape, draw out your map simply on a piece of paper, labeling each location. b_500_500_16777215_00__images_tutorials_geekbot_v3_mapp.jpg
In myMap.h line 6, change

#define MAP_LOCATION_COUNT 4
to the number of end locations on your map. In myMap.cpp line 7-13, there is a String array named destinationList. It should look like this:
String destinationList[MAP_LOCATION_COUNT] =
{
    "Rick",
    "Kevin",
    "Wade",
    "Matt"
};
Enter your list of destinations here. For each route, you will have to define the path that the robot will take, turn by turn, to and from each location. It seems tedious, but it's not difficult, and if you followed along with these tutorials, it is very similar to the line router As shown in the example code, 4 locations means that you need to define 12 routes. Still in myMap.cpp, let's take a look at the example routes.
uint8_t routeRickKevin[] = {  NAV_FWD, NAV_UTURN, NAV_STOP  };
uint8_t routeRickWade[] = {  NAV_RIGHT, NAV_LEFT, NAV_UTURN, NAV_STOP  };
uint8_t routeRickMatt[] = {  NAV_RIGHT, NAV_FWD, NAV_UTURN, NAV_STOP  };

uint8_t routeKevinRick[] = { NAV_FWD, NAV_UTURN, NAV_STOP };
uint8_t routeKevinWade[] = { NAV_LEFT, NAV_LEFT, NAV_UTURN, NAV_STOP  };
uint8_t routeKevinMatt[] = { NAV_LEFT, NAV_FWD, NAV_UTURN, NAV_STOP  };

uint8_t routeWadeRick[] = { NAV_RIGHT, NAV_LEFT, NAV_UTURN, NAV_STOP };
uint8_t routeWadeKevin[] = { NAV_RIGHT, NAV_RIGHT, NAV_UTURN, NAV_STOP };
uint8_t routeWadeMatt[] = { NAV_LEFT, NAV_UTURN, NAV_STOP };

uint8_t routeMattRick[] = { NAV_FWD, NAV_LEFT, NAV_UTURN, NAV_STOP };
uint8_t routeMattKevin[] = { NAV_FWD, NAV_RIGHT, NAV_UTURN, NAV_STOP };
uint8_t routeMattWade[] = { NAV_RIGHT, NAV_UTURN, NAV_STOP };
Notice that we're going from each location to every other destination. You should name these routes clearly as in the example, as you will need to use the names in a bit. These directions can be as long or as short as needed, but use all the same parts. You can:
  • NAV_FWD - At the intersection, continue forward
  • NAV_LEFT - At the intersection, make a 90 Degree turn Left
  • NAV_RIGHT - At the intersection, make a 90 Degree turn Right
  • NAV_UTURN - At the intersection, Turn the Geekbot 180 Degrees
  • NAV_STOP - At the intersection, End the route
You can see how this will be used to move the geekbot across the map. These act the same way as inputting these commands on the LCD when running the Geekbot Line Router code. Now, to handle which routes are used when each location is selected, you need to link them to the destination list. Still in myMap.cpp, let's look at the example code again:
uint8_t * navigationMap[][MAP_LOCATION_COUNT] =
{
    /* Enter routes for each location in same order as destinationList above */
    {routeNoRoute,   routeRickKevin, routeRickWade,  routeRickMatt}, //Location: Rick's Office
    {routeKevinRick, routeNoRoute,   routeKevinWade, routeKevinMatt}, //Location: Kevin's Desk
    {routeWadeRick,  routeWadeKevin, routeNoRoute,   routeWadeMatt}, //Location: Wade's Desk
    {routeMattRick,  routeMattKevin, routeMattWade,  routeNoRoute} //Location: Matt's Office
};
If you look at the routes, the first line of commands for the Robot Lab starts with routeNoRoute. This is because there is no route to take to go from the location you are starting at to itself. You'll see the same in each of the command lines. If you kept everything organized and well named in the previous step, this will be easy.

×

PC Control These demos and projects allow the robot to be controlled via a computer.

ArbotiX Commander Control - These demos and projects control the Robot using the ArbotiX Commander, the handheld Arduino based remote control.

Direct Control - These demos and projects control the Robot directly from sensors connected directly to the Robot's control board.

Pose Control - These demos and projects allow you to create and playback a sequence of poses.

Serial Control - These demos and projects control the robot using a serial packet protocol.

Standalone - These demos and projects are deisgned to let your robot function without a computer or additional microcontroller.

Wireless Control - These demos and projects allow you to control the robot wirelessly - usually by replacing the Serial Connection with XBee modules.

Reference - These articles have technical details regarding the control and operation of the robot.

×

More info here

Feedback Form


Search