|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdevice.Device
robot.Robot
robot.Pioneer
public class Pioneer
This class represents a minimal or standard configuration of a Pioneer 2DX robot at TAMS laboratory. Specialized classes can inherit from it to add new devices.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface robot.external.IPioneer |
---|
IPioneer.StateType, IPioneer.viewDirectType |
Field Summary | |
---|---|
(package private) IPioneer.StateType |
currentState
|
(package private) Position |
lastPosition
|
(package private) int |
stuckCounter
|
(package private) boolean |
timerIsOccured
Watchdog timer for stuck checking |
Fields inherited from class robot.Robot |
---|
bloFi, goal, gripper, localizer, logger, planner, posi, position, ranger0, ranger1, rLaser, robotId, rSonar, simu, speed, turnrate |
Fields inherited from interface robot.external.IPioneer |
---|
BEAMCOUNT, COS45, DEGPROBEAM, DIAGOFFSET, DIST_TOLERANCE, FMAX, FMIN, HORZOFFSET, INV_COS45, isDebugDistance, isDebugLaser, isDebugPosition, isDebugSonar, isDebugState, LFMAX, LFMIN, LMAX, LMAXANGLE, LMIN, LPMAX, MAXSPEED, MAXTURNRATE, MINRANGE, MINSPEED, MINTURNRATE, MOUNTOFFSET, RFMAX, RFMIN, RMAX, RMIN, SHAPE_DIST, SONARCOUNT, SONARMAX, STOP_ROT, STOP_WALLFOLLOWDIST, TRACK_ROT, WALLFOLLOWDIST, WALLLOSTDIST, YAW_TOLERANCE |
Constructor Summary | |
---|---|
Pioneer(Device roboDevices)
Deprecated. Use Pioneer(Device[]) instead.
Creates a Pioneer robot object. |
|
Pioneer(Device[] roboDevList)
Creates a Pioneer robot. |
Method Summary | |
---|---|
(package private) void |
commandMotors(double newSpeed,
double newTurnrate)
Sets the motor speed and syncs the underlying positioning device. |
(package private) void |
debugSensorData()
|
(package private) double |
getCollisionAvoid(double checkTurnrate)
Collision avoidance overrides other turnrate if necessary! |
IPioneer.StateType |
getCurrentState()
|
(package private) double |
getDistance(IPioneer.viewDirectType viewDirection)
Returns the minimum distance of the given view direction. |
(package private) double |
getEscapeWhenStuck(double newTurnrate)
|
(package private) double |
getLeftWallfollow(double maxTurnrate)
Plan a left wall follow trajectory. |
(package private) double |
getMinLasRange(int minAngle,
int maxAngle)
Returns the minimum distance of the given arc. |
(package private) double |
getSafeSpeed(double maxSpeed)
Calculates a safe speed regarding collision avoiding obstacles. |
(package private) double |
getSafeTurnrate(double maxTurnrate)
Checks if turning the robot is not causing collisions. |
(package private) double[] |
getSonarRanges()
If there are less valid range values than @see SONARCOUNT than the array contains fake (max) values. |
(package private) double[] |
maxSonarValues()
|
void |
setCommand()
Sets the robot into manual mode. |
(package private) void |
setCurrentState(IPioneer.StateType newCurrentState)
|
void |
setWallfollow()
|
void |
stop()
Stops the robot motion immediately. |
protected void |
update()
Checks the robot's current state and performs appropriate actions. |
(package private) void |
updatePosi()
Updates the motor speed immediately. |
(package private) void |
updateSpeed(double saveSpeed)
Tries to set the speed given. |
(package private) void |
updateStop()
Stops the motors immediately if not already stopped. |
(package private) void |
updateTurnrate(double saveTurnrate)
Tries to set the turnrate given. |
Methods inherited from class robot.Robot |
---|
connectDevices, getBloFi, getGoal, getGripper, getLaser, getLocalizer, getPlanner, getPosi, getPosition, getRobotId, getSimu, getSonar, getSpeed, getTurnrate, setGoal, setPosition, setRobotId, setSpeed, setTurnrate, shutdown, toString |
Methods inherited from class device.Device |
---|
equals, getDevice, getDeviceIterator, getDeviceList, getDeviceListArray, getHost, getId, getIndex, getLogger, getPort, getSleepTime, getThreadName, isInList, isRunning, isSupported, isThreaded, matches, matchesList, run, runThreaded, setDeviceList, setHost, setName, setPort, setSleepTime |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
IPioneer.StateType currentState
boolean timerIsOccured
Position lastPosition
int stuckCounter
Constructor Detail |
---|
public Pioneer(Device roboDevices)
Pioneer(Device[])
instead.
Creates a Pioneer robot object.
roboDevices
- The robot devices this robot can access.public Pioneer(Device[] roboDevList)
roboDevList
- The device list provided to this robot.Method Detail |
---|
protected void update()
update
in class Device
double getEscapeWhenStuck(double newTurnrate)
void commandMotors(double newSpeed, double newTurnrate)
newSpeed
- The new speed to command.newTurnrate
- The new turnrate to command.void updatePosi()
void updateStop()
public void stop()
void updateSpeed(double saveSpeed)
saveSpeed
- The speed to set.void updateTurnrate(double saveTurnrate)
saveTurnrate
- The turnrate to set.final double getMinLasRange(int minAngle, int maxAngle)
minAngle
- Minimum angle to check (degree).maxAngle
- Maximum angle to check (degree).
final double[] getSonarRanges()
final double getDistance(IPioneer.viewDirectType viewDirection)
viewDirection
- Robot view direction
double[] maxSonarValues()
final double getLeftWallfollow(double maxTurnrate)
final double getCollisionAvoid(double checkTurnrate)
final double getSafeSpeed(double maxSpeed)
maxSpeed
- The speed being trying to set.
final double getSafeTurnrate(double maxTurnrate)
public IPioneer.StateType getCurrentState()
void setCurrentState(IPioneer.StateType newCurrentState)
newCurrentState
- the currentState to setpublic void setWallfollow()
public void setCommand()
void debugSensorData()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |