15-494/694 Cognitive Robotics: Lab 2
Learning Goal: This lab will teach you how to compile a Tekkotsu state machine
on the workstation, transfer it to the robot, and execute it there.
Part I: Account Setup (Second Step)
You will only have to do this once.
- Log in to a lab workstation using your Andrew userid and password.
- Open a gnome-terminal by typing alt-control-T.
- Run the second account setup script by typing this command in your terminal window:
$ ~/Class/utils/setup-account2
Part II: Compiling a State Machine
- Enter the code from the first example in the State
Machines Lab on the Tekkotsu wiki. Put this code in your ~/project directory
under the name Example1.cc.fsm.
- Compile the code by typing "make" in your ~/project directory.
- Visit the State Machines wiki page
when you want to learn more about state machine syntax and programming techniques.
Part III: Running Your Code on the Robot
- Each day when you use the robot, you should begin by uploading a
fresh copy of the Tekkotsu libraries using the sendtekkotsu
script, in case there have been any overnight additions or bug
fixes. The script also uploads your executable file
tekkotsu-CALLIOPE2SP. Once you've done this, if you update your code
and need to ship it to the robot again, you can use the
sendmycode script, which is much faster. With either script,
you must supply the name or IP address of the robot: Example:
> sendtekkotsu artsi-calliope3.rel
or, if you've already done sendtekkotsu once today, use sendmycode:
> sendmycode 128.2.xxx.yyy
- Type control-shift-T in the terminal window to open a new tab.
Then ssh into the robot by typing, e.g., "ssh
user@artsi-calliope3.rel". Notice that the prompt on the robot is
red, while the prompt on the workstation is green. This helps you
tell them apart: "red for robot".
- Run Tekkotsu on the robot by typing:
> cd ~/project
> ./tekkotsu-CALLIOPE2SP
- In a third tab, start a ControllerGUI by typing, e.g.,
"ControllerGUI artsi-calliope3.rel". Note that you can just type "Con" and
hit the [Tab] key and the shell will auto-complete.
- In the ControllerGUI, go to Root Control > User Behaviors >
Example1. Double click on the behavior to run it. Try pressing the
bump switch or the play button in response to the bark sound. Also
try not pressing it. What happens in each case? Click on the
behavior name again to deactivate it.
- Go to Root Control > Status Reports > Event Logger and
select buttonEGID, stateMachineEGID, and stateTransitionEGID. Run the
behavior and look on the Tekkotsu console to see the events scroll
by.
- Now compile and run the Example2 behavior from the State
Machines Lab.
Part IV: Powering Down
- Stop Tekkotsu by typing control-D or "quit" in the terminal window.
- Press the power button on the Create and the LEDs should all go out.
- Move the slide switch on the servo controller board back to the
neutral position, shutting off servo power and extinguishing the
system power light. (This is because we don't want to energize the
robot's servos while it's on the charger.)
- You can leave the netbook powered up; make sure it is plugged in
to its charger, then close the lid.
- Plug in the Create's charger cable.
Part V: Homework (Start It In Class)
- Read the Storyboard
Lab to learn how to use the Storyboard tool.
- Do the three State
Machine Exercises on the Tekkotsu wiki. You may do these alone,
or in teams of 2, your choice.
- Collect your fsm files, Storyboard files, and screenshots of your
Storyboard displays into a zip file, and send it to dst@cs.cmu.edu.
(You can use gnome-screenshot or gimp to take a screenshot.) If you
worked as a team, include the names of both team members in your code.
Due: Friday, January 30.
Part VI: Troubleshooting
|