|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.dexterind.gopigo.Gopigo
public final class Gopigo
The main class for the Gopigo. It instanciates all the components and behaviours and is in charge to handle the events.
| Field Summary | |
|---|---|
Board |
board
The main object which handles the methods to get access to the resources connected to the board. |
private double |
criticalVoltage
The critical voltage value. |
private Debug |
debug
The debug object. |
Encoders |
encoders
The encoders. |
private static Gopigo |
instance
The instance of the current object. |
IRReceiverSensor |
irReceiverSensor
The IR Receiver sensor. |
private boolean |
isHalt
The flag for the halted status. |
private boolean |
isInit
The flag for the initialized status. |
Led |
ledLeft
The left led. |
Led |
ledRight
The right led. |
private java.util.concurrent.CopyOnWriteArrayList<GopigoListener> |
listeners
The list of the listeners which are listening for some event. |
private double |
minVoltage
The minimum voltage value. |
Motion |
motion
The motion behaviour object. |
Motor |
motorLeft
The left motor. |
Motor |
motorRight
The right motor. |
Servo |
servo
The servo motor. |
UltraSonicSensor |
ultraSonicSensor
The ultrasonic sensor. |
private java.util.Timer |
voltageTimer
The timer which will be in charge to check the voltage value. |
private int |
voltageTimerTime
The time in milliseconds between successive task executions. |
| Constructor Summary | |
|---|---|
Gopigo()
Instanciates the components and the behaviours of the Gopigo. |
|
| Method Summary | |
|---|---|
void |
addListener(GopigoListener listener)
Adds a GopigoListener to the listeners list. |
protected void |
fireEvent(java.util.EventObject event)
Fires an event to the listeners. |
void |
free()
Sets the GoPiGo free. |
java.lang.Double |
getCriticalVoltage()
Returns the critical voltage value. |
static Gopigo |
getInstance()
Provides a global point of access to the Gopigo instance. |
java.lang.Double |
getMinVoltage()
Returns the min. voltage value. |
void |
halt()
Halts the GoPiGo if necessary. |
void |
init()
Initializes the Gopigo and fires an event once the init is done. |
private void |
initVoltageCheck()
Initializes a timer which will checks the voltage and will fires and event in case of low voltage. |
java.lang.Boolean |
isHalt()
It returns the halt status. |
java.lang.Boolean |
isOperative()
It returns the operativity status. |
void |
onHalt()
Fires a "HALT" StatusEvent |
void |
removeListener(GopigoListener listener)
Removes a GopigoListener from the listeners list. |
void |
reset()
Resets the Gopigo. |
void |
setCriticalVoltage(double value)
Sets the critical voltage value. |
void |
setMinVoltage(double value)
Sets the min. voltage value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static Gopigo instance
private boolean isInit
private boolean isHalt
private java.util.Timer voltageTimer
private int voltageTimerTime
private double minVoltage
private double criticalVoltage
public Board board
public Encoders encoders
public Servo servo
public UltraSonicSensor ultraSonicSensor
public IRReceiverSensor irReceiverSensor
public Led ledLeft
public Led ledRight
public Motor motorLeft
public Motor motorRight
public Motion motion
private final java.util.concurrent.CopyOnWriteArrayList<GopigoListener> listeners
private Debug debug
| Constructor Detail |
|---|
public Gopigo()
| Method Detail |
|---|
public static Gopigo getInstance()
Gopigo instance.public void init()
public void reset()
throws java.io.IOException
java.io.IOExceptionpublic void addListener(GopigoListener listener)
GopigoListener to the listeners list.
listener - The GopigoListener to register.public void removeListener(GopigoListener listener)
GopigoListener from the listeners list.
listener - The GopigoListener to remove.protected void fireEvent(java.util.EventObject event)
event - The event to fire.private void initVoltageCheck()
public void free()
public java.lang.Boolean isOperative()
public void halt()
public java.lang.Boolean isHalt()
public void onHalt()
StatusEvent
public void setMinVoltage(double value)
value - The minimum voltage value to set.public java.lang.Double getMinVoltage()
public void setCriticalVoltage(double value)
value - The critical voltage value to set.public java.lang.Double getCriticalVoltage()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||