|
RoboJDETM v2.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ridgesoft.robotics.behaviors.AbstractBehavior2
com.ridgesoft.robotics.behaviors.GoToBehavior
public class GoToBehavior
Implements a behavior that will cause a robot to strive to navigate to a particular x, y location when the behavior is enabled.
BehaviorArbiter
Field Summary |
---|
Fields inherited from class com.ridgesoft.robotics.behaviors.AbstractBehavior2 |
---|
mEnabled, mIsActive, mListener |
Constructor Summary | |
---|---|
GoToBehavior(Navigator navigator,
float x,
float y,
boolean enabled)
Constructs a GoToBehavior object. |
Method Summary | |
---|---|
void |
navigationOperationTerminated(boolean completed)
Listener method that enables this behavior to listen for termination of commands it issues to the navigator. |
boolean |
poll()
This method is invoked at regular intervals to determine if the behavior desires to control the robot. |
void |
setDestination(float x,
float y)
Sets the goal (x, y destination) of this behavior. |
Methods inherited from class com.ridgesoft.robotics.behaviors.AbstractBehavior2 |
---|
setActive, setEnabled, setListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait |
Constructor Detail |
---|
public GoToBehavior(Navigator navigator, float x, float y, boolean enabled)
navigator
- the robot's navigatorx
- the x coordinate of the point to go toy
- the y coordinate of the point to go toenabled
- initial enabled state of the behaviorMethod Detail |
---|
public void navigationOperationTerminated(boolean completed)
navigationOperationTerminated
in interface NavigatorListener
completed
- true if the operation completed, false otherwisepublic boolean poll()
If active, this method will also instruct the robot to destination.
poll
in interface Behavior
poll
in class AbstractBehavior2
public void setDestination(float x, float y)
x
- the x coordinate of the point to go toy
- the y coordinate of the point to go to
|
RoboJDETM v2.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |