|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.lejon.Steerer
Low-level driver class for controlling the drive hardware. We use a ms-timer to create a timebase for periodic control and position update. The timeout is handled concurrently. The motion is controlled by a PID controller compensating the rotation differential of the wheels against a given setpoint.
Field Summary | |
static josx.platform.rcx.Motor |
MotorLeft
|
static int |
MotorModeL
|
static int |
MotorModeR
|
static int |
MotorPowerL
|
static int |
MotorPowerR
|
static josx.platform.rcx.Motor |
MotorRight
|
static josx.platform.rcx.Sensor |
SensorLeft
|
static josx.platform.rcx.Sensor |
SensorRight
|
Constructor Summary | |
Steerer()
Creates an new instance with its own timer and PID controller |
Method Summary | |
void |
cancel()
Cancels the running action. |
MotionReport |
getReport(MotionReport report)
Returns the local pose of the drive and the distance travelled along the path. |
void |
init(DriveParameters driveParams,
SteeringEventListener sel)
Initializes the newly created instance against the given drive constants and sets up the callback mechanism. |
void |
move()
(Re)start the action that was set up or paused previously. |
void |
pause()
Pauses the running action. |
void |
setup(float setpointPID,
int motorPowerL,
int motorPowerR,
int motorModeL,
int motorModeR,
int aimedTicksLeft,
int aimedTicksRight)
Setup a new action. |
void |
timedOut()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static josx.platform.rcx.Motor MotorLeft
public static josx.platform.rcx.Motor MotorRight
public static josx.platform.rcx.Sensor SensorLeft
public static josx.platform.rcx.Sensor SensorRight
public static int MotorModeL
public static int MotorModeR
public static int MotorPowerL
public static int MotorPowerR
Constructor Detail |
public Steerer()
Method Detail |
public void init(DriveParameters driveParams, SteeringEventListener sel)
driveParams
- the drive parameterssel
- the handler for steering eventspublic void setup(float setpointPID, int motorPowerL, int motorPowerR, int motorModeL, int motorModeR, int aimedTicksLeft, int aimedTicksRight)
setpointPID
- constant TICKS differential per period to
control. This is the velocity diffential of left and right
wheel. The setpoint is defined here as vl - vr.motorPowerL
- initial power level of left motor, one of
{0,1,...,7}motorPowerR
- initial power level of right motor, one of
{0,1,...,7}motorModeL
- the mode for left motor, 1 = FORWARD,
2 = BACKWARDmotorModeR
- the mode for right motor, 1 = FORWARD,
2 = BACKWARDaimedTicksLeft
- the amount of TICKS of left wheel after
action is finished. This defines the distance in TICKS the left
wheel has to travel. The value must always be positive.aimedTicksRight
- the amount of TICKS of right wheel after
action is finished. This defines the distance in TICKS the right
wheel has to travel. The value must always be positive.public void move()
public void pause()
public void cancel()
public MotionReport getReport(MotionReport report)
report
- the report object to fill
public void timedOut()
timedOut
in interface josx.util.TimerListener
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |