BowlerKernel
Public Member Functions | Private Member Functions | Private Attributes | List of all members
com.neuronrobotics.sdk.addons.irobot.Create Class Reference
Inheritance diagram for com.neuronrobotics.sdk.addons.irobot.Create:
Inheritance graph
[legend]
Collaboration diagram for com.neuronrobotics.sdk.addons.irobot.Create:
Collaboration graph
[legend]

Public Member Functions

 Create (UARTChannel chan)
 
void setFullMode ()
 
void InitCreate ()
 
void InitCreateBlocking (int timeout)
 
void move (short velocity, short radius)
 
void driveStraight (short distance)
 
void driveStraight (short velocity, short distance)
 
boolean driveStraightBlocking (int timeout, short velocity, short distance) throws InterruptedException
 
void turn (short angle)
 
void turn (short velocity, short angle)
 
boolean turnBlocking (int timeout, short velocity, short angle) throws InterruptedException
 
void setLed (boolean max, boolean spot)
 
void setStatusLed (int color, int intensity)
 
void requestSensors ()
 
void requestSensors (CreateSensorRequest req)
 
void onChannelEvent (DyIOChannelEvent e)
 
void removeAllCreateSensorListeners ()
 
void removeCreateSensorListener (ICreateSensorListener l)
 
void addCreateSensorListener (ICreateSensorListener l)
 

Private Member Functions

void setLed ()
 
void send (byte[]b) throws Exception
 
void fireCreatePacket (CreateSensors packet)
 

Private Attributes

short myAngle
 
short myDistance
 
short previousRad =0
 
short previousVel =0
 
UARTChannel channel
 
byte[] ledState ={(byte) 139,0,0,0}
 
byte[] sensor = new byte[26]
 
CreateSensorRequest senReq =CreateSensorRequest.NONE
 
ArrayList< ICreateSensorListenerlisteners = new ArrayList<ICreateSensorListener>()
 

Detailed Description

The Class Create.

Definition at line 30 of file Create.java.

Constructor & Destructor Documentation

◆ Create()

com.neuronrobotics.sdk.addons.irobot.Create.Create ( UARTChannel  chan)

Member Function Documentation

◆ addCreateSensorListener()

void com.neuronrobotics.sdk.addons.irobot.Create.addCreateSensorListener ( ICreateSensorListener  l)

addCreateSensorListener.

Parameters
ladd the specified listener

Definition at line 461 of file Create.java.

References com.neuronrobotics.sdk.addons.irobot.Create.listeners.

◆ driveStraight() [1/2]

void com.neuronrobotics.sdk.addons.irobot.Create.driveStraight ( short  distance)

Drive straight.

Parameters
distancemm Distance from current location to drive

Definition at line 150 of file Create.java.

Referenced by com.neuronrobotics.sdk.addons.irobot.Create.driveStraightBlocking().

◆ driveStraight() [2/2]

void com.neuronrobotics.sdk.addons.irobot.Create.driveStraight ( short  velocity,
short  distance 
)

Driving macro. This will drive for a distance and stop.

Parameters
velocitymm/s
distancemm

Definition at line 158 of file Create.java.

References com.neuronrobotics.sdk.addons.irobot.Create.send().

Here is the call graph for this function:

◆ driveStraightBlocking()

boolean com.neuronrobotics.sdk.addons.irobot.Create.driveStraightBlocking ( int  timeout,
short  velocity,
short  distance 
) throws InterruptedException

Drive straight blocking.

Parameters
timeoutthe timeout
velocitymm/s
distancemm
Returns
true, if successful
Exceptions
InterruptedExceptionthe interrupted exception

Definition at line 184 of file Create.java.

References com.neuronrobotics.sdk.addons.irobot.Create.driveStraight(), com.neuronrobotics.sdk.common.Log.error(), com.neuronrobotics.sdk.common.Log.info(), com.neuronrobotics.sdk.addons.irobot.Create.myDistance, and com.neuronrobotics.sdk.addons.irobot.Create.requestSensors().

Here is the call graph for this function:

◆ fireCreatePacket()

void com.neuronrobotics.sdk.addons.irobot.Create.fireCreatePacket ( CreateSensors  packet)
private

◆ InitCreate()

void com.neuronrobotics.sdk.addons.irobot.Create.InitCreate ( )

Inits the create.

Definition at line 93 of file Create.java.

References com.neuronrobotics.sdk.addons.irobot.Create.send().

Here is the call graph for this function:

◆ InitCreateBlocking()

void com.neuronrobotics.sdk.addons.irobot.Create.InitCreateBlocking ( int  timeout)

Inits the create blocking.

Parameters
timeoutthe timeout

Definition at line 107 of file Create.java.

References com.neuronrobotics.sdk.common.Log.info(), and com.neuronrobotics.sdk.addons.irobot.Create.send().

Here is the call graph for this function:

◆ move()

void com.neuronrobotics.sdk.addons.irobot.Create.move ( short  velocity,
short  radius 
)

wrapper for the drive command NOTE, this is not a positional, only velocity. It will run forever until you tell it to stop Special cases for radius param: straight = 32768 = hex 8000 Turn in place clockwise = -1 Turn in place counter-clockwise = 1

Parameters
velocitymm/s 32768 to -32768
radiusmm 32768 to -32768

Definition at line 132 of file Create.java.

References com.neuronrobotics.sdk.addons.irobot.Create.previousRad, com.neuronrobotics.sdk.addons.irobot.Create.previousVel, and com.neuronrobotics.sdk.addons.irobot.Create.send().

Here is the call graph for this function:

◆ onChannelEvent()

void com.neuronrobotics.sdk.addons.irobot.Create.onChannelEvent ( DyIOChannelEvent  e)

◆ removeAllCreateSensorListeners()

void com.neuronrobotics.sdk.addons.irobot.Create.removeAllCreateSensorListeners ( )

removeAllCreateSensorListeners clears the list of async packet listeners.

Definition at line 437 of file Create.java.

References com.neuronrobotics.sdk.addons.irobot.Create.listeners.

◆ removeCreateSensorListener()

void com.neuronrobotics.sdk.addons.irobot.Create.removeCreateSensorListener ( ICreateSensorListener  l)

removeCreateSensorListener.

Parameters
lremove the specified listener

Definition at line 447 of file Create.java.

References com.neuronrobotics.sdk.addons.irobot.Create.listeners.

◆ requestSensors() [1/2]

void com.neuronrobotics.sdk.addons.irobot.Create.requestSensors ( )

◆ requestSensors() [2/2]

void com.neuronrobotics.sdk.addons.irobot.Create.requestSensors ( CreateSensorRequest  req)

Request sensors.

Parameters
reqthe req

Definition at line 340 of file Create.java.

References com.neuronrobotics.sdk.addons.irobot.CreateSensorRequest.getValue(), com.neuronrobotics.sdk.addons.irobot.Create.send(), and com.neuronrobotics.sdk.addons.irobot.Create.senReq.

Here is the call graph for this function:

◆ send()

void com.neuronrobotics.sdk.addons.irobot.Create.send ( byte[]  b) throws Exception
private

◆ setFullMode()

void com.neuronrobotics.sdk.addons.irobot.Create.setFullMode ( )

Sets the full mode.

Definition at line 81 of file Create.java.

References com.neuronrobotics.sdk.addons.irobot.Create.send().

Here is the call graph for this function:

◆ setLed() [1/2]

void com.neuronrobotics.sdk.addons.irobot.Create.setLed ( )
private

◆ setLed() [2/2]

void com.neuronrobotics.sdk.addons.irobot.Create.setLed ( boolean  max,
boolean  spot 
)

Sets the led.

Parameters
maxsets the state of the "max" led
spotsets the state of the "spot" led

Definition at line 308 of file Create.java.

References com.neuronrobotics.sdk.addons.irobot.Create.ledState, and com.neuronrobotics.sdk.addons.irobot.Create.setLed().

Here is the call graph for this function:

◆ setStatusLed()

void com.neuronrobotics.sdk.addons.irobot.Create.setStatusLed ( int  color,
int  intensity 
)

Sets the status led.

Parameters
colorPower Color (0 – 255), 0 = green, 255 = red
intensityPower Intensity (0 – 255), 0 = off, 255 = full intensity

Definition at line 322 of file Create.java.

References com.neuronrobotics.sdk.addons.irobot.Create.ledState, and com.neuronrobotics.sdk.addons.irobot.Create.setLed().

Here is the call graph for this function:

◆ turn() [1/2]

void com.neuronrobotics.sdk.addons.irobot.Create.turn ( short  angle)

Turn.

Parameters
angledegrees Distance from current location to drive

Definition at line 228 of file Create.java.

Referenced by com.neuronrobotics.sdk.addons.irobot.Create.turn(), and com.neuronrobotics.sdk.addons.irobot.Create.turnBlocking().

◆ turn() [2/2]

void com.neuronrobotics.sdk.addons.irobot.Create.turn ( short  velocity,
short  angle 
)

Driving macro. This will drive for a distance and stop.

Parameters
velocitymm/s
angledegrees

Definition at line 236 of file Create.java.

References com.neuronrobotics.sdk.addons.irobot.Create.send(), and com.neuronrobotics.sdk.addons.irobot.Create.turn().

Here is the call graph for this function:

◆ turnBlocking()

boolean com.neuronrobotics.sdk.addons.irobot.Create.turnBlocking ( int  timeout,
short  velocity,
short  angle 
) throws InterruptedException

Turn blocking.

Parameters
timeoutthe timeout
velocitythe velocity
anglethe angle
Returns
true, if successful
Exceptions
InterruptedExceptionthe interrupted exception

Definition at line 263 of file Create.java.

References com.neuronrobotics.sdk.common.Log.error(), com.neuronrobotics.sdk.common.Log.info(), com.neuronrobotics.sdk.addons.irobot.Create.myAngle, com.neuronrobotics.sdk.addons.irobot.Create.requestSensors(), and com.neuronrobotics.sdk.addons.irobot.Create.turn().

Here is the call graph for this function:

Member Data Documentation

◆ channel

UARTChannel com.neuronrobotics.sdk.addons.irobot.Create.channel
private

◆ ledState

byte [] com.neuronrobotics.sdk.addons.irobot.Create.ledState ={(byte) 139,0,0,0}
private

◆ listeners

ArrayList<ICreateSensorListener> com.neuronrobotics.sdk.addons.irobot.Create.listeners = new ArrayList<ICreateSensorListener>()
private

◆ myAngle

short com.neuronrobotics.sdk.addons.irobot.Create.myAngle
private

◆ myDistance

short com.neuronrobotics.sdk.addons.irobot.Create.myDistance
private

◆ previousRad

short com.neuronrobotics.sdk.addons.irobot.Create.previousRad =0
private

The previous rad.

Definition at line 40 of file Create.java.

Referenced by com.neuronrobotics.sdk.addons.irobot.Create.move().

◆ previousVel

short com.neuronrobotics.sdk.addons.irobot.Create.previousVel =0
private

The previous vel.

Definition at line 43 of file Create.java.

Referenced by com.neuronrobotics.sdk.addons.irobot.Create.move().

◆ senReq

CreateSensorRequest com.neuronrobotics.sdk.addons.irobot.Create.senReq =CreateSensorRequest.NONE
private

◆ sensor

byte [] com.neuronrobotics.sdk.addons.irobot.Create.sensor = new byte[26]
private

The sensor.

Definition at line 52 of file Create.java.

Referenced by com.neuronrobotics.sdk.addons.irobot.Create.onChannelEvent().


The documentation for this class was generated from the following file: