|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectroomba.roombanetwork.services.userservice.Roomba
public class Roomba
A User Service representation of a Roomba. This class will get a lock on a Roomba, send commands to the Roomba via the RNS, and receive sensor data back from the Roomba via the RNS.
| Constructor Summary | |
|---|---|
Roomba()
Constructor - gets a lock on a Roomba service |
|
Roomba(boolean lockNeeded)
Constructor - connects to a Roomba service |
|
Roomba(java.lang.String roombaName)
Constructor - gets a lock on a specific Roomba, specified by the name |
|
Roomba(java.lang.String roombaName,
boolean lockNeeded)
Constructor - connects on a specific Roomba, specified by the name |
|
| Method Summary | |
|---|---|
void |
addSongNote(int notenum,
int duration)
Adds a note to the current song. |
void |
clearSong()
Clears the current song without playing it |
void |
drive(double distance)
Command the Roomba to drive a distance (in Meters) |
void |
forwardForTime(double speed,
double duration)
Command the Roomba to drive straight for the specified time duration (in seconds) at the speed specified |
void |
forwardSpeed(double speed)
Command the Roomba to drive straight at the specified speed |
int |
getAngle()
Gets the rotational distance traveled from the initial position |
int |
getBattery()
Gets the battery charge level |
boolean |
getCenterWheelDrop()
Gets the status of the center wheel drop sensor |
boolean |
getCliffFrontLeft()
Gets the status of the cliff front left sensor |
boolean |
getCliffFrontRight()
Gets the status of the cliff front right sensor |
boolean |
getCliffLeft()
Gets the status of the cliff left sensor |
boolean |
getCliffRight()
Gets the status of the cliff right sensor |
int |
getDistance()
Gets the translational distance traveled from the initial position |
boolean |
getLeftBump()
Gets the status of the left bump sensor |
boolean |
getLeftWheelDrop()
Gets the status of the left wheel drop sensor |
double |
getLocalizedX()
Gets the x position reported by localization. |
double |
getLocalizedY()
Gets the y position reported by localization. |
double |
getOdometryX()
Gets the x position reported by odometry |
double |
getOdometryY()
Gets the y position reported by odometry |
boolean |
getRightBump()
Gets the status of the right bump sensor |
boolean |
getRightWheelDrop()
Gets the status of the right wheel drop sensor |
boolean |
getVirtualWall()
Gets the status of the virtual wall sensor |
boolean |
getWall()
Gets the status of the wall sensor |
void |
messageReceived(java.lang.String messageType,
java.lang.String[] messageComponents)
Processes a message received. |
void |
pause(double duration)
Command the Roomba to not process any other commands for the specified duration (in seconds) |
void |
playSong()
Command the Roomba to play the current song. |
void |
setStatusGreenLED(boolean statusGreenLED)
Command the Roomba to set the green status LED |
void |
setStatusRedLED(boolean statusRedLED)
Command the Roomba to set the red status LED |
void |
turn(double angle)
Command the Roomba to turn an angle (in degrees) |
void |
turnForTime(double speed,
double duration)
Command the Roomba to turn for the specified time duration (in seconds) at the speed specified |
void |
turnSpeed(double speed)
Command the Roomba to turn at the specified speed |
void |
waitForBump()
This method will block until either bump sensor is detected |
void |
waitForVirtualWall()
This method will block until a virtual wall is detected |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Roomba()
public Roomba(boolean lockNeeded)
lockNeeded - True iff the client needs a lock on the roombapublic Roomba(java.lang.String roombaName)
roombaName - The roomba service name to lock
public Roomba(java.lang.String roombaName,
boolean lockNeeded)
roombaName - The roomba service name to locklockNeeded - True iff the client needs a lock on the roomba| Method Detail |
|---|
public void messageReceived(java.lang.String messageType,
java.lang.String[] messageComponents)
messageReceived in interface ClientListenermessageType - The message typemessageComponents - The components of the received messagepublic void drive(double distance)
distance - The distance in Meters to drivepublic void turn(double angle)
angle - The angle in degrees to turnpublic void forwardSpeed(double speed)
speed - The drive speed
public void forwardForTime(double speed,
double duration)
speed - Speed to move at. If this is positive, the robot will move forward. Otherwise
it will move in reverse.duration - Time to move forward in secondspublic void turnSpeed(double speed)
speed - The turn speed
public void turnForTime(double speed,
double duration)
speed - Speed to turn at. If this is positive, the robot will turn to the right. Otherwise
it will turn to the left.duration - Time to move forward in secondspublic void pause(double duration)
duration - The duration to wait in secondspublic void setStatusGreenLED(boolean statusGreenLED)
statusGreenLED - True iff the green status LED should be onpublic void setStatusRedLED(boolean statusRedLED)
statusRedLED - True iff the red status LED should be on
public void addSongNote(int notenum,
int duration)
notenum - The note numberduration - The note durationpublic void clearSong()
public void playSong()
public boolean getLeftBump()
public boolean getRightBump()
public boolean getCliffFrontLeft()
public boolean getCliffFrontRight()
public boolean getCliffLeft()
public boolean getCliffRight()
public boolean getWall()
public boolean getVirtualWall()
public boolean getLeftWheelDrop()
public boolean getRightWheelDrop()
public boolean getCenterWheelDrop()
public int getBattery()
public int getDistance()
public int getAngle()
public double getOdometryX()
public double getOdometryY()
public double getLocalizedX()
public double getLocalizedY()
public void waitForVirtualWall()
public void waitForBump()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||