|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.dexterind.gopigo.behaviours.Motion
public class Motion
Handles all the methods related to the movement of the GoPigo.
| Field Summary | |
|---|---|
private static Board |
board
The main object which handles the methods to get access to the resources connected to the board. |
private Debug |
debug
The debug object. |
java.util.Map<java.lang.String,java.lang.Integer> |
directions
The HashMap of the directions. |
private static Motion |
instance
The instance of the current object. |
| Constructor Summary | |
|---|---|
Motion()
|
|
| Method Summary | |
|---|---|
int |
backward(boolean usePid)
Moves backward the Gopigo. |
int |
decreaseSpeed()
Decreases the speed of both the motors. |
int |
disableCommunicationTimeout()
Disables the communication timeout. |
int |
enableCommunicationTimeout(int timeout)
Enables the communication timeout. |
int |
forward(boolean usePid)
Moves forward the Gopigo. |
static Motion |
getInstance()
Provides a global point of access to the Motion instance. |
int |
increaseSpeed()
Increases the speed of both the motors. |
int |
left()
Moves the Gopigo to the left. |
int |
leftWithRotation()
Rotates the Gopigo to the left. |
int |
readTimeoutStatus()
Reads the timeout status. |
int |
right()
Moves the Gopigo to the right. |
int |
rightWithRotation()
Rotates the Gopigo to the right. |
int |
setLeftSpeed(int speed)
Sets the speed only for the left motor. |
int |
setRightSpeed(int speed)
Sets the speed only for the right motor. |
int |
setSpeed(int speed)
Sets the speed for both the motors. |
int |
stop()
Stops any kind of movement. |
double |
trimRead()
Reads the current Trim value. |
double |
trimTest(int value)
Executes a Trim test. |
double |
trimWrite(int value)
Sets the Trim value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static Board board
private static Motion instance
public java.util.Map<java.lang.String,java.lang.Integer> directions
private Debug debug
| Constructor Detail |
|---|
public Motion()
throws java.io.IOException,
java.lang.InterruptedException
java.io.IOException
java.lang.InterruptedException| Method Detail |
|---|
public static Motion getInstance()
throws java.io.IOException,
java.lang.InterruptedException
Motion instance.
java.io.IOException
java.lang.InterruptedException
public int forward(boolean usePid)
throws java.io.IOException
usePid - A boolean flag which defines if it's needed to use or not the PID.
java.io.IOException
public int backward(boolean usePid)
throws java.io.IOException
usePid - A boolean flag which defines if it's needed to use or not the PID.
java.io.IOException
public int left()
throws java.io.IOException
java.io.IOException
public int leftWithRotation()
throws java.io.IOException
java.io.IOException
public int right()
throws java.io.IOException
java.io.IOException
public int rightWithRotation()
throws java.io.IOException
java.io.IOException
public int stop()
throws java.io.IOException
java.io.IOException
public int increaseSpeed()
throws java.io.IOException
java.io.IOException
public int decreaseSpeed()
throws java.io.IOException
java.io.IOException
public int setLeftSpeed(int speed)
throws java.io.IOException
speed - A speed value between 0 and 255
java.io.IOException
public int setRightSpeed(int speed)
throws java.io.IOException
speed - A speed value between 0 and 255.
java.io.IOException
public int setSpeed(int speed)
throws java.io.IOException
speed - A speed value between 0 and 255
java.io.IOException
public double trimTest(int value)
throws java.io.IOException
value - The value to test between -100 and 100.
java.io.IOException
public double trimRead()
throws java.io.IOException
java.io.IOException
public double trimWrite(int value)
throws java.io.IOException
value - The Trim value between -100 and 100.
java.io.IOException
public int readTimeoutStatus()
throws java.io.IOException
java.io.IOException
public int enableCommunicationTimeout(int timeout)
throws java.io.IOException
timeout - The value of the timout.
java.io.IOException
public int disableCommunicationTimeout()
throws java.io.IOException
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||