|
dLife Home Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.Observable
dlife.robot.Device
dlife.robot.DifferentialDriveEffector
dlife.robot.khepera2.Khepera2DifferentialDrive
public class Khepera2DifferentialDrive
A class to control the motion of a Khepera2. This class also allows the configuration of the Khepera2's PID controller for speed control.
| Field Summary |
|---|
| Fields inherited from class dlife.robot.DifferentialDriveEffector |
|---|
vL, vR |
| Fields inherited from class dlife.robot.Device |
|---|
DEFAULT_GUI_UPDATE_DELAY, DEFAULT_READ_DELAY, myRobot, readCount |
| Constructor Summary | |
|---|---|
Khepera2DifferentialDrive()
Construct a Khepera2DifferentialDrive. |
|
Khepera2DifferentialDrive(int Kp,
int Ki,
int Kd)
Construct a Khepera2DifferentialDrive that uses the specified gains for the PID speed controller. |
|
| Method Summary | |
|---|---|
void |
configureSpeedController(int Kp,
int Ki,
int Kd)
Configure the Khepera2's speed PID controller using the specified gains. |
void |
readStateFromRobot()
Updates the speeds of the wheels using information returned from the Khepera2. |
void |
setMotorPWM(double leftPWM,
double rightPWM)
Directly control the pulse width modulation (PWM) ratio of the left and right wheel motors. |
protected void |
setRobotWheelSpeeds(double left,
double right)
Set the speed of the robot wheels. |
void |
startUp()
Invoke super.startUp and then configure the speed PID controller if the default values are not being used. |
| Methods inherited from class dlife.robot.DifferentialDriveEffector |
|---|
createGUIObjects, freeze, getLeftWheelSpeed, getRightWheelSpeed, getRotation, getTranslation, move, rotate, setWheelSpeeds, shutDown, translate |
| Methods inherited from class dlife.robot.Device |
|---|
getAutoRead, getGUI, getGUIUpdateDelay, getReadDelay, getRobot, getSensorReadCount, getSensorReadRate, setAutoRead, setGUIUpdateDelay, setReadDelay, setRobot, startAutoReadTimer, stopAutoReadTimer |
| Methods inherited from class java.util.Observable |
|---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Khepera2DifferentialDrive()
public Khepera2DifferentialDrive(int Kp,
int Ki,
int Kd)
Kp - gain for proportional control in PID.Ki - gain for integral control in PID.Kd - gain for derivative control in PID.| Method Detail |
|---|
public void startUp()
startUp in class Device
protected void setRobotWheelSpeeds(double left,
double right)
setRobotWheelSpeeds in class DifferentialDriveEffectorleft - the left speedright - the right speed
RobotCommunicationException - if unable to communicate with the
Khepera2.
public void configureSpeedController(int Kp,
int Ki,
int Kd)
Kp - gain for proportional control in PID.Ki - gain for integral control in PID.Kd - gain for derivative control in PID.
public void setMotorPWM(double leftPWM,
double rightPWM)
leftPWM - fraction of on time for left wheel motor.rightPWM - fraction of on time for right wheel motor.public void readStateFromRobot()
readStateFromRobot in class Device
|
dLife Home Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||