public interface LineFollowingMoveController extends ArcRotateMoveController
WHEEL_SIZE_EV3, WHEEL_SIZE_NXT1, WHEEL_SIZE_NXT2, WHEEL_SIZE_RCX
Modifier and Type | Method and Description |
---|---|
void |
steer(double turnRate)
Moves the robot forward while making a curve specified by
turnRate . |
void |
steerBackward(double steerRatio)
Moves the robot backward while making a curve specified by
turnRate . |
arc, arc, arcBackward, arcForward, getMinRadius, setMinRadius, travelArc, travelArc
getAngularAcceleration, getAngularSpeed, getMaxAngularSpeed, rotate, rotate, rotateLeft, rotateRight, setAngularAcceleration, setAngularSpeed
backward, forward, getLinearAcceleration, getLinearSpeed, getMaxLinearSpeed, isMoving, setLinearAcceleration, setLinearSpeed, stop, travel, travel
addMoveListener, getMovement
void steer(double turnRate)
turnRate
. This move is suited for line following as it executes immediately without stopping the move that the robot is currently executing. It is also non blocking, control goes back to the main program right way.
The turnRate
specifies the sharpness of the turn. Use values
between -200 and +200.
A positive value means that center of the turn is on the left. If the
robot is traveling toward the top of the page the arc looks like this:
).
A negative value means that center of the turn is on the right so the arc
looks this: (.
. In this class, this parameter determines the ratio of inner wheel speed
to outer wheel speed as a percent.
Formula: ratio = 100 - abs(turnRate)
.
When the ratio is negative, the outer and inner wheels rotate in opposite
directions. Examples of how the formula works:
steer(0)
-> inner and outer wheels turn at the same
speed, travel straight
steer(25)
-> the inner wheel turns at 75% of the speed
of the outer wheel, turn left
steer(100)
-> the inner wheel stops and the outer wheel
is at 100 percent, turn left
steer(200)
-> the inner wheel turns at the same speed as
the outer wheel - a zero radius turn.
Note: If you have specified a drift correction in the constructor it will not be applied in this method.
turnRate
- If positive, the left side of the robot is on the inside of
the turn. If negative, the left side is on the outside.void steerBackward(double steerRatio)
turnRate
. This move is suited for line following as it executes immediately without stopping the move that the robot is currently executing. It is also non blocking, control goes back to the main program right way.
The turnRate
specifies the sharpness of the turn. Use values
between -200 and +200.
A positive value means that center of the turn is on the left. If the
robot is traveling toward the top of the page the arc looks like this:
).
A negative value means that center of the turn is on the right so the arc
looks this: (.
. In this class, this parameter determines the ratio of inner wheel speed
to outer wheel speed as a percent.
Formula: ratio = 100 - abs(turnRate)
.
When the ratio is negative, the outer and inner wheels rotate in opposite
directions. Examples of how the formula works:
steer(0)
-> inner and outer wheels turn at the same
speed, travel straight
steer(25)
-> the inner wheel turns at 75% of the speed
of the outer wheel, turn left
steer(100)
-> the inner wheel stops and the outer wheel
is at 100 percent, turn left
steer(200)
-> the inner wheel turns at the same speed as
the outer wheel - a zero radius turn.
Note: If you have specified a drift correction in the constructor it will not be applied in this method.
steerRatio
- If positive, the left side of the robot is on the inside of
the turn. If negative, the left side is on the outside.