examples.dlife.robot.khepera2
Class Khepera2Braitenberg
java.lang.Object
dlife.robot.Controller
examples.dlife.robot.khepera2.Khepera2Braitenberg
public class Khepera2Braitenberg
- extends Controller
A Braitenberg controller for the Khepera2. This Controller causes the Khepera
to wander around (pretty much) without hitting obstacles using a Braitenberg
controller.
To run this example:
- Complete the Basic dLife Installation.
- Complete the Khepera2
Setup.
- Launch the
dlife.robot.gui.controlcenter
- Select
dlife.robot.khepera2.Khepera2 in the "Robot:" drop
down list.
- Click the button next to the "Controller:" label.
- Navigate to the
dLifeDist/examples/dlife/robot/khepera2/
directory.
- Choose the
Khepera2Braitenberg.class file.
- Click the "Start Up" button.
- Choose the connection mechanism to be used:
- Serial Port: Use the file chooser to select the device file to which the
Khepera2 is connected.
- Bluetooth: Select the desired Khepera2 from the drop down list. Initially
you will need to know the Bluetooth address of the Khepera2 in order to
identify the one to which you want to connect. You may optionally associate a
name with the robot's bluetooth address using the text field and the "Set"
button, making it easier to identify in the future.
- Click "Connect"
- The Khepera2 will flash its LEDs to indicate that a connection has been
established.
- Click "Run"
- The Khepera2 will begin to move about avoiding obstacles.
- Click "Stop" then "Shutdown" when finished.
The source code for this class is contained in the file:
- Version:
- Jan 19, 2011
- Author:
- Grant Braught, Dickinson College
|
Method Summary |
void |
startUp(Robot robot)
Create a differential drive and a proximity sensor and add them to the
robot. |
void |
step()
Implement a Braitenberg obstacle avoidance controller. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Khepera2Braitenberg
public Khepera2Braitenberg()
startUp
public void startUp(Robot robot)
- Create a differential drive and a proximity sensor and add them to the
robot.
- Specified by:
startUp in class Controller
- Parameters:
robot - the Robot that this Controller will be controlling.
step
public void step()
- Implement a Braitenberg obstacle avoidance controller.
- Specified by:
step in class Controller