BowlerKernel
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
com.neuronrobotics.sdk.dyio.DyIO Class Reference
Inheritance diagram for com.neuronrobotics.sdk.dyio.DyIO:
Inheritance graph
[legend]
Collaboration diagram for com.neuronrobotics.sdk.dyio.DyIO:
Collaboration graph
[legend]

Public Member Functions

 DyIO ()
 
 DyIO (MACAddress address)
 
 DyIO (BowlerAbstractConnection connection)
 
 DyIO (MACAddress address, BowlerAbstractConnection connection)
 
DyIOChannel getChannel (int channel)
 
Object[] send (String NS, BowlerMethod method, String rpcString, Object[] arguments)
 
boolean setMode (int channel, DyIOChannelMode mode)
 
boolean setMode (int channel, DyIOChannelMode mode, boolean async)
 
DyIOChannelMode getMode (int channel)
 
boolean setValue (int channel, int value)
 
boolean setValue (int channel, ByteList value)
 
boolean setValue (int channel, java.math.BigDecimal value)
 
int getValue (int channel)
 
String getInfo ()
 
void setInfo (String info)
 
byte[] getFirmwareRev ()
 
String getFirmwareRevString ()
 
ArrayList< DyIOChannelgetChannels ()
 
void resync (int channel)
 
void checkFirmwareRev () throws DyIOFirmwareOutOfDateException
 
ArrayList< DyIOChannelModegetAllChannelModes ()
 
boolean resync ()
 
void addDyIOEventListener (IDyIOEventListener l)
 
void removeDyIOEventListener (IDyIOEventListener l)
 
void removeAllDyIOEventListeners ()
 
void fireDyIOEvent (IDyIOEvent e)
 
boolean getCachedMode ()
 
void setCachedMode (boolean mode)
 
void flushCache (double seconds)
 
boolean isAvailable () throws InvalidConnectionException
 
DyIOPowerState getBankAState ()
 
DyIOPowerState getBankBState ()
 
double getBatteryVoltage (boolean refresh)
 
void onAsyncResponse (BowlerDatagram data)
 
boolean ConfigureDynamicPIDChannels (DyPIDConfiguration config)
 
DyPIDConfiguration getDyPIDConfiguration (int group)
 
boolean ResetPIDChannel (int group, float valueToSetCurrentTo)
 
boolean ResetPIDChannel (int group)
 
boolean SetPIDSetPoint (int group, float setpoint, double seconds)
 
boolean SetAllPIDSetPoint (float[]setpoints, double seconds)
 
float GetPIDPosition (int group)
 
float[] GetAllPIDPosition ()
 
boolean ConfigurePIDController (PIDConfiguration config)
 
PIDConfiguration getPIDConfiguration (int group)
 
void addPIDEventListener (IPIDEventListener l)
 
void removePIDEventListener (IPIDEventListener l)
 
void flushPIDChannels (double time)
 
PIDChannel getPIDChannel (int group)
 
boolean SetPIDInterpolatedVelocity (int group, int unitsPerSecond, double seconds) throws PIDCommandException
 
boolean SetPDVelocity (int group, int unitsPerSecond, double seconds) throws PIDCommandException
 
boolean killAllPidGroups ()
 
boolean configAdvancedAsyncNotEqual (int pin)
 
boolean configAdvancedAsyncDeadBand (int pin, int deadbandSize)
 
boolean configAdvancedAsyncTreshhold (int pin, int threshholdValue, AsyncThreshholdEdgeType edgeType)
 
boolean configAdvancedAsyncAutoSample (int pin)
 
boolean configAdvancedAsyncNotEqual (int pin, int time)
 
boolean configAdvancedAsyncDeadBand (int pin, int time, int deadbandSize)
 
boolean configAdvancedAsyncTreshhold (int pin, int time, int threshholdValue, AsyncThreshholdEdgeType edgeType)
 
boolean configAdvancedAsyncAutoSample (int pin, int time)
 
boolean connect ()
 
void startHeartBeat (long msHeartBeatTime)
 
int getHeartBeatTime ()
 
void stopHeartBeat ()
 
boolean setServoPowerSafeMode (boolean enable)
 
Boolean isServoPowerSafeMode ()
 
void setMuteResyncOnModeChange (boolean muteResyncOnModeChange)
 
boolean isMuteResyncOnModeChange ()
 
void onDisconnect (BowlerAbstractConnection source)
 
void onConnect (BowlerAbstractConnection source)
 
void setResyncing (boolean resyncing)
 
boolean isResyncing ()
 
String toString ()
 
int[] getAllChannelValues ()
 
boolean ConfigurePDVelovityController (PDVelocityConfiguration config)
 
PDVelocityConfiguration getPDVelocityConfiguration (int group)
 
int getPIDChannelCount ()
 
Integer getDyIOChannelCount ()
 
ArrayList< DyIOChannelModegetAvailibleChannelModes (int channel)
 
GenericPIDDevice getPid ()
 
boolean isLegacyParser ()
 
void setLegacyParser (boolean legacyParser)
 
void flush (double seconds)
 
- Public Member Functions inherited from com.neuronrobotics.sdk.common.BowlerAbstractDevice
void addConnectionEventListener (final IDeviceConnectionEventListener l)
 
void removeConnectionEventListener (IDeviceConnectionEventListener l)
 
void setConnection (BowlerAbstractConnection connection)
 
void disconnect ()
 
BowlerAbstractConnection getConnection ()
 
void setAddress (MACAddress address)
 
MACAddress getAddress ()
 
BowlerDatagram send (BowlerAbstractCommand command) throws NoConnectionAvailableException, InvalidResponseException
 
BowlerDatagram send (BowlerAbstractCommand command, int retry) throws NoConnectionAvailableException, InvalidResponseException
 
Object[] send (String namespace, BowlerMethod method, String rpcString, Object[] arguments, int retry) throws DeviceConnectionException
 
boolean ping ()
 
boolean ping (boolean switchParser)
 
ArrayList< ByteListgetRevisions ()
 
ArrayList< String > getNamespaces ()
 
boolean hasNamespace (String string)
 
void startHeartBeat ()
 
void setThreadedUpstreamPackets (boolean up)
 
ArrayList< RpcEncapsulationgetRpcList (String namespace)
 
void loadRpcList ()
 
void onAllResponse (BowlerDatagram data)
 
boolean isKeepAlive ()
 
void setKeepAlive (boolean keepAlive)
 
long getLastPacketTime ()
 
void setLastPacketTime (long lastPacketTime)
 
String getScriptingName ()
 
void setScriptingName (String scriptingName)
 
ArrayList< IDeviceConnectionEventListenergetDisconnectListeners ()
 

Static Public Member Functions

static void disableFWCheck ()
 
static void enableFWCheck ()
 

Protected Member Functions

void validateChannel (int channel)
 
- Protected Member Functions inherited from com.neuronrobotics.sdk.common.BowlerAbstractDevice
void fireDisconnectEvent ()
 
void fireConnectEvent ()
 

Private Member Functions

boolean haveFirmware ()
 
void powerEvent (BowlerDatagram data)
 
ArrayList< DyIOChannelgetInternalChannels ()
 

Private Attributes

ArrayList< IDyIOEventListenerlisteners = new ArrayList<IDyIOEventListener>()
 
ArrayList< DyIOChannelchannels = new ArrayList<DyIOChannel>()
 
byte[] firmware = {0, 0, 0}
 
String info = "DyIO"
 
DyIOPowerState bankAState
 
DyIOPowerState bankBState
 
double batteryVoltage = 0
 
boolean cachedMode =false
 
boolean muteResyncOnModeChange =false
 
boolean resyncing = false
 
boolean haveBeenSynced =false
 
boolean legacyParser = false
 
Boolean enableBrownOut =null
 
GenericPIDDevice pid = new GenericPIDDevice()
 
Integer dyioChanCount = null
 

Static Private Attributes

static final String NEURONROBOTICS_DYIO_1_0 = "neuronrobotics.dyio.*;1.0"
 
static boolean checkFirmware =false
 

Detailed Description

The DyIO class is an encapsulation of all of the functionality of the DyIO module into one object. This object has one connection to one DyIO module and wraps all of the commands in an accessible API.

Author
Kevin Harrington, Robert Breznak

Definition at line 60 of file DyIO.java.

Constructor & Destructor Documentation

◆ DyIO() [1/4]

com.neuronrobotics.sdk.dyio.DyIO.DyIO ( )

Default Constructor. Builds a generic DyIO that has the default broadcast address and no default connection.

Definition at line 113 of file DyIO.java.

References com.neuronrobotics.sdk.common.MACAddress.BROADCAST, com.neuronrobotics.sdk.dyio.DyIO.getPid(), and com.neuronrobotics.sdk.common.BowlerAbstractDevice.setAddress().

Here is the call graph for this function:

◆ DyIO() [2/4]

com.neuronrobotics.sdk.dyio.DyIO.DyIO ( MACAddress  address)

Builds a DyIO that has the given address and no default connection.

Parameters
addressthe address

Definition at line 123 of file DyIO.java.

References com.neuronrobotics.sdk.common.BowlerAbstractDevice.address, com.neuronrobotics.sdk.dyio.DyIO.getPid(), and com.neuronrobotics.sdk.common.BowlerAbstractDevice.setAddress().

Here is the call graph for this function:

◆ DyIO() [3/4]

com.neuronrobotics.sdk.dyio.DyIO.DyIO ( BowlerAbstractConnection  connection)

◆ DyIO() [4/4]

com.neuronrobotics.sdk.dyio.DyIO.DyIO ( MACAddress  address,
BowlerAbstractConnection  connection 
)

Member Function Documentation

◆ addDyIOEventListener()

void com.neuronrobotics.sdk.dyio.DyIO.addDyIOEventListener ( IDyIOEventListener  l)

Add an IDyIOEventListener that will be contacted with an IDyIOEvent on each incoming data event.

DyIO event listeners are used to get information from all DyIO events. This is how to access the Power events: DyIO power switch change events DyIO external power voltage change events

Parameters
lthe l

Definition at line 543 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.listeners.

◆ addPIDEventListener()

void com.neuronrobotics.sdk.dyio.DyIO.addPIDEventListener ( IPIDEventListener  l)

Allows a user to attach a listener to the device to listen for PID events Events include: PID reset, where the user is notified if the controllers input is reset from software PID limit, if the device generates a Home, Upper limit, or Lower limit event from a hardware event PID position, if the current position of the PID controllers sensor input changes.

Parameters
lthe l

Implements com.neuronrobotics.sdk.namespace.bcs.pid.IPidControlNamespace.

Definition at line 912 of file DyIO.java.

References com.neuronrobotics.sdk.pid.GenericPIDDevice.addPIDEventListener(), and com.neuronrobotics.sdk.dyio.DyIO.getPid().

Here is the call graph for this function:

◆ checkFirmwareRev()

void com.neuronrobotics.sdk.dyio.DyIO.checkFirmwareRev ( ) throws DyIOFirmwareOutOfDateException

Sync the state cache with the live device. This method will query the device for its firmware revision and its info string. The default opperation will be to throw a DyIOFirmwareOutOfDateException is the firmware version does not match the NRDK build version. This can be overridden if DyIO.disableFWCheck() is called BEFORE connection.

Exceptions
DyIOFirmwareOutOfDateExceptionthe dy io firmware out of date exception

Definition at line 353 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.checkFirmware, com.neuronrobotics.sdk.dyio.DyIO.firmware, com.neuronrobotics.sdk.config.SDKBuildInfo.getBuildInfo(), and com.neuronrobotics.sdk.common.Log.info().

Referenced by com.neuronrobotics.sdk.dyio.DyIO.getAllChannelModes(), com.neuronrobotics.sdk.dyio.DyIO.resync(), com.neuronrobotics.sdk.dyio.DyIO.startHeartBeat(), and com.neuronrobotics.sdk.dyio.DyIO.stopHeartBeat().

Here is the call graph for this function:

◆ configAdvancedAsyncAutoSample() [1/2]

boolean com.neuronrobotics.sdk.dyio.DyIO.configAdvancedAsyncAutoSample ( int  pin)

This method configures the advanced async mode for a given DyIO channel to trigger on any event where the value is sampled on a real-time This sets the sample time to 100 ms clock and sent as async regardless of value change.

Parameters
pinthe DyIO channel to configure
Returns
true if success

Definition at line 1005 of file DyIO.java.

Referenced by com.neuronrobotics.sdk.dyio.DyIOChannel.configAdvancedAsyncAutoSample().

◆ configAdvancedAsyncAutoSample() [2/2]

boolean com.neuronrobotics.sdk.dyio.DyIO.configAdvancedAsyncAutoSample ( int  pin,
int  time 
)

This method configures the advanced async mode for a given DyIO channel to trigger on any event where the value is sampled on a real-time clock and sent as async regardless of value change.

Parameters
pinthe DyIO channel to configure
timethe sample time in MiliSeconds
Returns
true if success

Definition at line 1052 of file DyIO.java.

References com.neuronrobotics.sdk.commands.bcs.io.AsyncMode.AUTOSAMP, and com.neuronrobotics.sdk.dyio.DyIO.send().

Here is the call graph for this function:

◆ configAdvancedAsyncDeadBand() [1/2]

boolean com.neuronrobotics.sdk.dyio.DyIO.configAdvancedAsyncDeadBand ( int  pin,
int  deadbandSize 
)

This method configures the advanced async mode for a given DyIO channel to trigger on any event where the values are outside a deadband This sets the sample time to 100 ms.

Parameters
pinthe DyIO channel to configure
deadbandSizethe size in sensor units of the deadband
Returns
true if success

Definition at line 980 of file DyIO.java.

Referenced by com.neuronrobotics.sdk.dyio.DyIOChannel.configAdvancedAsyncDeadBand().

◆ configAdvancedAsyncDeadBand() [2/2]

boolean com.neuronrobotics.sdk.dyio.DyIO.configAdvancedAsyncDeadBand ( int  pin,
int  time,
int  deadbandSize 
)

This method configures the advanced async mode for a given DyIO channel to trigger on any event where the values are outside a deadband.

Parameters
pinthe DyIO channel to configure
timethe sample time in MiliSeconds
deadbandSizethe size in sensor units of the deadband
Returns
true if success

Definition at line 1027 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.send().

Here is the call graph for this function:

◆ configAdvancedAsyncNotEqual() [1/2]

boolean com.neuronrobotics.sdk.dyio.DyIO.configAdvancedAsyncNotEqual ( int  pin)

This method configures the advanced async mode for a given DyIO channel to trigger on any event where the values are not equal. This sets the sample time to 100 ms

Parameters
pinthe DyIO channel to configure
Returns
true is success

Definition at line 968 of file DyIO.java.

Referenced by com.neuronrobotics.sdk.dyio.DyIOChannel.configAdvancedAsyncNotEqual(), and com.neuronrobotics.sdk.dyio.DyIOChannel.setMode().

◆ configAdvancedAsyncNotEqual() [2/2]

boolean com.neuronrobotics.sdk.dyio.DyIO.configAdvancedAsyncNotEqual ( int  pin,
int  time 
)

This method configures the advanced async mode for a given DyIO channel to trigger on any event where the values are not equal.

Parameters
pinthe DyIO channel to configure
timethe sample time in MiliSeconds
Returns
true if success

Definition at line 1015 of file DyIO.java.

References com.neuronrobotics.sdk.commands.bcs.io.AsyncMode.NOTEQUAL, and com.neuronrobotics.sdk.dyio.DyIO.send().

Here is the call graph for this function:

◆ configAdvancedAsyncTreshhold() [1/2]

boolean com.neuronrobotics.sdk.dyio.DyIO.configAdvancedAsyncTreshhold ( int  pin,
int  threshholdValue,
AsyncThreshholdEdgeType  edgeType 
)

This method configures the advanced async mode for a given DyIO channel to trigger on any event where the value crosses a threshhold This sets the sample time to 100 ms.

Parameters
pinthe DyIO channel to configure
threshholdValuea value setpoint that triggers an even when it is crossed
edgeTypeRising, Falling, or both
Returns
true if success

Definition at line 993 of file DyIO.java.

Referenced by com.neuronrobotics.sdk.dyio.DyIOChannel.configAdvancedAsyncTreshhold().

◆ configAdvancedAsyncTreshhold() [2/2]

boolean com.neuronrobotics.sdk.dyio.DyIO.configAdvancedAsyncTreshhold ( int  pin,
int  time,
int  threshholdValue,
AsyncThreshholdEdgeType  edgeType 
)

This method configures the advanced async mode for a given DyIO channel to trigger on any event where the value crosses a threshhold.

Parameters
pinthe DyIO channel to configure
timethe sample time in MiliSeconds
threshholdValuea value setpoint that triggers an even when it is crossed
edgeTypeRising, Falling, or both
Returns
true if success

Definition at line 1040 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.send().

Here is the call graph for this function:

◆ ConfigureDynamicPIDChannels()

boolean com.neuronrobotics.sdk.dyio.DyIO.ConfigureDynamicPIDChannels ( DyPIDConfiguration  config)

This method sends a packet to the DyIO module to set up the linking between a DyIO input channel and a DyIO output channel to a PID controller Inputs are read as the input to the PID calculation Outputs are set as a result of the PID calculation.

Parameters
configthe configuration data object
Returns
true if success

Definition at line 837 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.send().

Here is the call graph for this function:

◆ ConfigurePDVelovityController()

boolean com.neuronrobotics.sdk.dyio.DyIO.ConfigurePDVelovityController ( PDVelocityConfiguration  config)

This method sends a PID configuration object to the device. THe controller can be enabled/disabled with this method All PID parameters are stored in the PIDConfiguration ojbect prior to calling this method will be sent to the device.

Parameters
configthe configuration wrapper object
Returns
true if success

Implements com.neuronrobotics.sdk.namespace.bcs.pid.IPidControlNamespace.

Definition at line 1312 of file DyIO.java.

References com.neuronrobotics.sdk.pid.GenericPIDDevice.ConfigurePDVelovityController(), and com.neuronrobotics.sdk.dyio.DyIO.getPid().

Here is the call graph for this function:

◆ ConfigurePIDController()

boolean com.neuronrobotics.sdk.dyio.DyIO.ConfigurePIDController ( PIDConfiguration  config)

This method sends a PID configuration object to the device. THe controller can be enabled/disabled with this method All PID parameters are stored in the PIDConfiguration ojbect prior to calling this method will be sent to the device.

Parameters
configthe configuration wrapper object
Returns
true if success

Implements com.neuronrobotics.sdk.namespace.bcs.pid.IPidControlNamespace.

Definition at line 900 of file DyIO.java.

References com.neuronrobotics.sdk.pid.GenericPIDDevice.ConfigurePIDController(), and com.neuronrobotics.sdk.dyio.DyIO.getPid().

Here is the call graph for this function:

◆ connect()

boolean com.neuronrobotics.sdk.dyio.DyIO.connect ( )

◆ disableFWCheck()

static void com.neuronrobotics.sdk.dyio.DyIO.disableFWCheck ( )
static

This static method can be called before connection a DyIO object to disable the firmware verification step This can be used to allow older versions of the DyIO firmware to be used with newer NRDK versions.

Definition at line 334 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.checkFirmware.

◆ enableFWCheck()

static void com.neuronrobotics.sdk.dyio.DyIO.enableFWCheck ( )
static

This static method can be called before connection a DyIO object to enable the firmware verification step.

Definition at line 341 of file DyIO.java.

◆ fireDyIOEvent()

void com.neuronrobotics.sdk.dyio.DyIO.fireDyIOEvent ( IDyIOEvent  e)

Contact all of the listeners with the given event.

Parameters
e
  • the event to fire to all listeners

Definition at line 578 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.listeners.

Referenced by com.neuronrobotics.sdk.dyio.DyIO.onAsyncResponse(), and com.neuronrobotics.sdk.dyio.DyIO.powerEvent().

◆ flush()

void com.neuronrobotics.sdk.dyio.DyIO.flush ( double  seconds)

This interface says the device can cache values and flush them in one push

Parameters
secondsthe duration of the flush, from current position and time to cached positions in this many seconds

Implements com.neuronrobotics.sdk.common.IFlushable.

Definition at line 1428 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.flushCache().

Here is the call graph for this function:

◆ flushCache()

void com.neuronrobotics.sdk.dyio.DyIO.flushCache ( double  seconds)

This method will flush the DyIO cache for all channels. All channel values as stored by setting the value from code, or the value stored at the time that the cache/flush mode was enabled. THis method will flush all 24 channel values in one packet allowing for co-ordinated motion.

Parameters
secondsthe seconds

Definition at line 648 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.getInternalChannels(), com.neuronrobotics.sdk.dyio.DyIO.isLegacyParser(), com.neuronrobotics.sdk.common.BowlerMethod.POST, and com.neuronrobotics.sdk.dyio.DyIO.send().

Referenced by com.neuronrobotics.sdk.dyio.DyIO.flush(), and com.neuronrobotics.sdk.dyio.sequencer.CoreScheduler.DyIOFlusher.run().

Here is the call graph for this function:

◆ flushPIDChannels()

void com.neuronrobotics.sdk.dyio.DyIO.flushPIDChannels ( double  time)

This method will read all of the cached or current setpoints for all PID controllers and calls SetAllPIDSetPoint with its internal data.

Parameters
timethe time

Implements com.neuronrobotics.sdk.namespace.bcs.pid.IPidControlNamespace.

Definition at line 925 of file DyIO.java.

References com.neuronrobotics.sdk.pid.GenericPIDDevice.flushPIDChannels(), and com.neuronrobotics.sdk.dyio.DyIO.getPid().

Here is the call graph for this function:

◆ getAllChannelModes()

ArrayList<DyIOChannelMode> com.neuronrobotics.sdk.dyio.DyIO.getAllChannelModes ( )

◆ getAllChannelValues()

int [] com.neuronrobotics.sdk.dyio.DyIO.getAllChannelValues ( )

◆ GetAllPIDPosition()

float [] com.neuronrobotics.sdk.dyio.DyIO.GetAllPIDPosition ( )

This method requests all PID controllers to report back their current value of their input sensors. This method is also used to determine dynamically how many PID control groups are availible on a device.

Returns
and array of values representing the current state of the given cntrollers input

Implements com.neuronrobotics.sdk.namespace.bcs.pid.IPidControlNamespace.

Definition at line 894 of file DyIO.java.

References com.neuronrobotics.sdk.pid.GenericPIDDevice.GetAllPIDPosition(), and com.neuronrobotics.sdk.dyio.DyIO.getPid().

Here is the call graph for this function:

◆ getAvailibleChannelModes()

ArrayList<DyIOChannelMode> com.neuronrobotics.sdk.dyio.DyIO.getAvailibleChannelModes ( int  channel)

◆ getBankAState()

DyIOPowerState com.neuronrobotics.sdk.dyio.DyIO.getBankAState ( )

This method returns the bank switch state of bank A (0-11) This state is updated asynchronously by the DyIOEventListener.

Returns
the current state

Definition at line 704 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.bankAState.

Referenced by com.neuronrobotics.sdk.dyio.DyIOChannel.getAvailableModes().

◆ getBankBState()

DyIOPowerState com.neuronrobotics.sdk.dyio.DyIO.getBankBState ( )

This method returns the bank switch state of bank B (12-23) This state is updated asynchronously by the DyIOEventListener.

Returns
the current state

Definition at line 714 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.bankBState.

Referenced by com.neuronrobotics.sdk.dyio.DyIOChannel.getAvailableModes().

◆ getBatteryVoltage()

double com.neuronrobotics.sdk.dyio.DyIO.getBatteryVoltage ( boolean  refresh)

THis method will return the current voltage on the battery connected to the DyIO external power connector.

Parameters
refreshtrue if you want to query the device, false to just get the cached value from the last async.
Returns
the voltage of the battery in Volts

Definition at line 723 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.batteryVoltage, com.neuronrobotics.sdk.dyio.DyIO.powerEvent(), and com.neuronrobotics.sdk.dyio.DyIO.send().

Referenced by com.neuronrobotics.sdk.dyio.DyIO.resync().

Here is the call graph for this function:

◆ getCachedMode()

boolean com.neuronrobotics.sdk.dyio.DyIO.getCachedMode ( )

This method returns the current state of the DyIO objects cache/flush system for the DyIO channel values.

Returns
true if cache/flush mode is enabled

Definition at line 618 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.cachedMode.

◆ getChannel()

DyIOChannel com.neuronrobotics.sdk.dyio.DyIO.getChannel ( int  channel)

Returns the DyIO channel associated with a channel number.

Parameters
channelinteger representing the index of the channel
  • a channel number
Returns
the channel

Definition at line 160 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.getInternalChannels(), and com.neuronrobotics.sdk.dyio.DyIO.validateChannel().

Referenced by com.neuronrobotics.sdk.dyio.peripherals.AnalogInputChannel.AnalogInputChannel(), com.neuronrobotics.sdk.dyio.peripherals.CounterInputChannel.CounterInputChannel(), com.neuronrobotics.sdk.dyio.peripherals.CounterOutputChannel.CounterOutputChannel(), com.neuronrobotics.sdk.dyio.peripherals.DCMotorOutputChannel.DCMotorOutputChannel(), com.neuronrobotics.sdk.dyio.peripherals.DigitalInputChannel.DigitalInputChannel(), com.neuronrobotics.sdk.dyio.peripherals.DigitalOutputChannel.DigitalOutputChannel(), com.neuronrobotics.sdk.dyio.DyIO.getMode(), com.neuronrobotics.sdk.dyio.DyIO.getValue(), com.neuronrobotics.sdk.dyio.sequencer.ServoOutputScheduleChannel.initInput(), com.neuronrobotics.sdk.dyio.DyIO.onAsyncResponse(), com.neuronrobotics.sdk.dyio.peripherals.PWMOutputChannel.PWMOutputChannel(), com.neuronrobotics.sdk.dyio.DyIO.resync(), com.neuronrobotics.sdk.dyio.peripherals.ServoChannel.ServoChannel(), com.neuronrobotics.sdk.dyio.DyIOChannel.setMode(), com.neuronrobotics.sdk.dyio.DyIO.setMode(), com.neuronrobotics.sdk.dyio.DyIO.setValue(), com.neuronrobotics.sdk.dyio.peripherals.SPIChannel.SPIChannel(), and com.neuronrobotics.sdk.dyio.peripherals.UARTChannel.UARTChannel().

Here is the call graph for this function:

◆ getChannels()

ArrayList<DyIOChannel> com.neuronrobotics.sdk.dyio.DyIO.getChannels ( )

This method creates a new collection and populates it with the DyIO channel objects.

Returns
a collection of DyIOChannel objects

Definition at line 311 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.getInternalChannels().

Referenced by com.neuronrobotics.sdk.dyio.DyIO.getAllChannelValues(), com.neuronrobotics.sdk.dyio.DyIO.onAsyncResponse(), and com.neuronrobotics.sdk.dyio.DyIOChannel.setMode().

Here is the call graph for this function:

◆ getDyIOChannelCount()

Integer com.neuronrobotics.sdk.dyio.DyIO.getDyIOChannelCount ( )

◆ getDyPIDConfiguration()

DyPIDConfiguration com.neuronrobotics.sdk.dyio.DyIO.getDyPIDConfiguration ( int  group)

This method gets the current state of the DyIO channel configuration of a given PID group.

Parameters
groupthe index of the PID group to get information about
Returns
the dy pid configuration

Definition at line 847 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.send().

Here is the call graph for this function:

◆ getFirmwareRev()

byte [] com.neuronrobotics.sdk.dyio.DyIO.getFirmwareRev ( )

This method gets the 3 byte firmware revision code. THis code is used to determine compatibility between the version of firmware on the DyIO and the version of the NRDK being used to communicate with it.

Returns
The firmware version data

Definition at line 292 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.firmware.

◆ getFirmwareRevString()

String com.neuronrobotics.sdk.dyio.DyIO.getFirmwareRevString ( )

This method turns the firmware version number into a formatted string for clear display

Returns
Firmware version string.

Definition at line 301 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.firmware.

Referenced by com.neuronrobotics.sdk.dyio.DyIO.toString().

◆ getHeartBeatTime()

int com.neuronrobotics.sdk.dyio.DyIO.getHeartBeatTime ( )

Gets the heart beat time.

Returns
the heart beat time

Definition at line 1109 of file DyIO.java.

References com.neuronrobotics.sdk.common.ByteList.convertToInt(), com.neuronrobotics.sdk.common.ByteList.getBytes(), com.neuronrobotics.sdk.common.BowlerDatagram.getData(), and com.neuronrobotics.sdk.dyio.DyIO.send().

Here is the call graph for this function:

◆ getInfo()

String com.neuronrobotics.sdk.dyio.DyIO.getInfo ( )

Gets the DyIO's internally stored info string. This is a 16 byte string that can be stored on the DYIO and used as a human-readable, user setable, identifier.

Returns
The current string

Definition at line 265 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.info.

◆ getInternalChannels()

ArrayList<DyIOChannel> com.neuronrobotics.sdk.dyio.DyIO.getInternalChannels ( )
private

◆ getMode()

DyIOChannelMode com.neuronrobotics.sdk.dyio.DyIO.getMode ( int  channel)

THis method returns the state of the given channels I/O mode.

Parameters
channelinteger representing the index of the channel
Returns
the current mode

Definition at line 209 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.getChannel(), and com.neuronrobotics.sdk.dyio.DyIOChannel.getMode().

Referenced by com.neuronrobotics.sdk.dyio.DyIO.toString().

Here is the call graph for this function:

◆ getPDVelocityConfiguration()

PDVelocityConfiguration com.neuronrobotics.sdk.dyio.DyIO.getPDVelocityConfiguration ( int  group)

Gets the current state of the PID group. The PIDConfiguration object will contain the current configuration state of the requested PID controller.

Parameters
groupthe index of the PID group
Returns
the configuration object

Implements com.neuronrobotics.sdk.namespace.bcs.pid.IPidControlNamespace.

Definition at line 1321 of file DyIO.java.

References com.neuronrobotics.sdk.pid.GenericPIDDevice.getPDVelocityConfiguration(), and com.neuronrobotics.sdk.dyio.DyIO.getPid().

Here is the call graph for this function:

◆ getPid()

GenericPIDDevice com.neuronrobotics.sdk.dyio.DyIO.getPid ( )

◆ getPIDChannel()

PIDChannel com.neuronrobotics.sdk.dyio.DyIO.getPIDChannel ( int  group)

Gets the PID channel wrapper for a specific channel. The channel wrappers can be used to cache values for use with the cache/flush system. This wrapper will encapsulate a specific PID channel.

Parameters
groupthe index of the PID group
Returns
a PIDChannel encapsulation object

Implements com.neuronrobotics.sdk.namespace.bcs.pid.IPidControlNamespace.

Definition at line 932 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.getPid(), and com.neuronrobotics.sdk.pid.GenericPIDDevice.getPIDChannel().

Here is the call graph for this function:

◆ getPIDChannelCount()

int com.neuronrobotics.sdk.dyio.DyIO.getPIDChannelCount ( )

Requests the current number of PID channels.

Returns
the PID channel count

Implements com.neuronrobotics.sdk.namespace.bcs.pid.IPidControlNamespace.

Definition at line 1330 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.getPid(), and com.neuronrobotics.sdk.pid.GenericPIDDevice.getPIDChannelCount().

Here is the call graph for this function:

◆ getPIDConfiguration()

PIDConfiguration com.neuronrobotics.sdk.dyio.DyIO.getPIDConfiguration ( int  group)

Gets the current state of the PID group. The PIDConfiguration object will contain the current configuration state of the requested PID controller.

Parameters
groupthe index of the PID group
Returns
the configuration object

Implements com.neuronrobotics.sdk.namespace.bcs.pid.IPidControlNamespace.

Definition at line 906 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.getPid(), and com.neuronrobotics.sdk.pid.GenericPIDDevice.getPIDConfiguration().

Here is the call graph for this function:

◆ GetPIDPosition()

float com.neuronrobotics.sdk.dyio.DyIO.GetPIDPosition ( int  group)

This method requests a single PID controller group value. The value returned represents the current state of the PID controller's input sensor in raw units

Parameters
groupthe index of the PID group
Returns
The current value of the sensor input

Implements com.neuronrobotics.sdk.namespace.bcs.pid.IPidControlNamespace.

Definition at line 888 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.getPid(), and com.neuronrobotics.sdk.pid.GenericPIDDevice.GetPIDPosition().

Here is the call graph for this function:

◆ getValue()

int com.neuronrobotics.sdk.dyio.DyIO.getValue ( int  channel)

This method is used to get the value of a given channel. The data units will be determined by DyIO channel mode, and so should be treated by this method as unit-less.

Parameters
channelinteger representing the index of the channel
Returns
The DyIO channels current value

Definition at line 255 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.getChannel(), and com.neuronrobotics.sdk.dyio.DyIOChannel.getValue().

Here is the call graph for this function:

◆ haveFirmware()

boolean com.neuronrobotics.sdk.dyio.DyIO.haveFirmware ( )
private

Check to see if the firmware has been checked yet.

Returns
true if already checked

Definition at line 525 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.firmware.

Referenced by com.neuronrobotics.sdk.dyio.DyIO.resync().

◆ isAvailable()

boolean com.neuronrobotics.sdk.dyio.DyIO.isAvailable ( ) throws InvalidConnectionException

Determines if the device is available.

Returns
true if the device is avaiable, false if it is not
Exceptions
InvalidConnectionExceptionthe invalid connection exception

Reimplemented from com.neuronrobotics.sdk.common.BowlerAbstractDevice.

Definition at line 684 of file DyIO.java.

References com.neuronrobotics.sdk.common.BowlerAbstractDevice.getConnection(), and com.neuronrobotics.sdk.common.BowlerAbstractConnection.isConnected().

Here is the call graph for this function:

◆ isLegacyParser()

boolean com.neuronrobotics.sdk.dyio.DyIO.isLegacyParser ( )

◆ isMuteResyncOnModeChange()

boolean com.neuronrobotics.sdk.dyio.DyIO.isMuteResyncOnModeChange ( )

This will check if the device is in the muted mode change mode.

Returns
true if in muted mode

Definition at line 1196 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.muteResyncOnModeChange.

◆ isResyncing()

boolean com.neuronrobotics.sdk.dyio.DyIO.isResyncing ( )

Checks to see if the DyIO is currently re-syncing its internal staate.

Returns
true, if is resyncing

Definition at line 1232 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.resyncing.

Referenced by com.neuronrobotics.sdk.dyio.DyIO.resync().

◆ isServoPowerSafeMode()

Boolean com.neuronrobotics.sdk.dyio.DyIO.isServoPowerSafeMode ( )

Tells the application whether or not to use the brownout detect.

Returns
the boolean

Definition at line 1167 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.enableBrownOut, and com.neuronrobotics.sdk.dyio.DyIO.setServoPowerSafeMode().

Here is the call graph for this function:

◆ killAllPidGroups()

boolean com.neuronrobotics.sdk.dyio.DyIO.killAllPidGroups ( )

Sends a single packet to stop all PID groups at once.

Returns
true, if successful

Implements com.neuronrobotics.sdk.namespace.bcs.pid.IPidControlNamespace.

Definition at line 954 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.getPid(), and com.neuronrobotics.sdk.pid.GenericPIDDevice.killAllPidGroups().

Here is the call graph for this function:

◆ onAsyncResponse()

void com.neuronrobotics.sdk.dyio.DyIO.onAsyncResponse ( BowlerDatagram  data)

◆ onConnect()

void com.neuronrobotics.sdk.dyio.DyIO.onConnect ( BowlerAbstractConnection  source)

called on the event of a connection object connect.

Parameters
sourcethe source

Implements com.neuronrobotics.sdk.common.IConnectionEventListener.

Definition at line 1214 of file DyIO.java.

◆ onDisconnect()

void com.neuronrobotics.sdk.dyio.DyIO.onDisconnect ( BowlerAbstractConnection  source)

Called on the event of a connection object disconnect.

Parameters
sourcethe source

Implements com.neuronrobotics.sdk.common.IConnectionEventListener.

Definition at line 1204 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.firmware.

◆ powerEvent()

void com.neuronrobotics.sdk.dyio.DyIO.powerEvent ( BowlerDatagram  data)
private

◆ removeAllDyIOEventListeners()

void com.neuronrobotics.sdk.dyio.DyIO.removeAllDyIOEventListeners ( )

Clears out all current IDyIOEventListeners.

Definition at line 568 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.listeners.

◆ removeDyIOEventListener()

void com.neuronrobotics.sdk.dyio.DyIO.removeDyIOEventListener ( IDyIOEventListener  l)

Removes an IDyIOEventListener from being contacted on each new IDyIOEvent.

Parameters
lthe l

Definition at line 557 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.listeners.

◆ removePIDEventListener()

void com.neuronrobotics.sdk.dyio.DyIO.removePIDEventListener ( IPIDEventListener  l)

Removes a specific IPIDEventListener.

Parameters
lthe l

Implements com.neuronrobotics.sdk.namespace.bcs.pid.IPidControlNamespace.

Definition at line 918 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.getPid(), and com.neuronrobotics.sdk.pid.GenericPIDDevice.removePIDEventListener().

Here is the call graph for this function:

◆ ResetPIDChannel() [1/2]

boolean com.neuronrobotics.sdk.dyio.DyIO.ResetPIDChannel ( int  group)

Reset pid channel.

Parameters
groupthe group
Returns
true, if successful

Definition at line 870 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.getPid(), and com.neuronrobotics.sdk.pid.GenericPIDDevice.ResetPIDChannel().

Here is the call graph for this function:

◆ ResetPIDChannel() [2/2]

boolean com.neuronrobotics.sdk.dyio.DyIO.ResetPIDChannel ( int  group,
float  valueToSetCurrentTo 
)

This method calls a reset of the PID group. This will set the current value of the controllers input to the given value (if possible) and will set the setpoint of the PID group to the current value (stopping the output)

Parameters
groupthe index of the PID group
valueToSetCurrentTothe target value that the controller should be set to.
Returns
true if success

Implements com.neuronrobotics.sdk.namespace.bcs.pid.IPidControlNamespace.

Definition at line 857 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.getPid(), and com.neuronrobotics.sdk.pid.GenericPIDDevice.ResetPIDChannel().

Here is the call graph for this function:

◆ resync() [1/2]

boolean com.neuronrobotics.sdk.dyio.DyIO.resync ( )

This method re-synchronizes the entire state of the DyIO object with the DyIO module. The Firmware version is checked The info string is checked All channel modes are updated

Returns
true if success

Definition at line 441 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.checkFirmwareRev(), com.neuronrobotics.sdk.dyio.DyIOChannelMode.DIGITAL_OUT, com.neuronrobotics.sdk.common.Log.error(), com.neuronrobotics.sdk.dyio.DyIOChannel.fireModeChangeEvent(), com.neuronrobotics.sdk.dyio.DyIO.firmware, com.neuronrobotics.sdk.dyio.DyIOChannelMode.get(), com.neuronrobotics.sdk.dyio.DyIO.getAllChannelModes(), com.neuronrobotics.sdk.dyio.DyIO.getBatteryVoltage(), com.neuronrobotics.sdk.common.BowlerAbstractDevice.getConnection(), com.neuronrobotics.sdk.dyio.DyIOChannel.getCurrentMode(), com.neuronrobotics.sdk.dyio.DyIO.getInternalChannels(), com.neuronrobotics.sdk.common.BowlerAbstractDevice.getRevisions(), com.neuronrobotics.sdk.common.BowlerAbstractDevice.hasNamespace(), com.neuronrobotics.sdk.dyio.DyIO.haveBeenSynced, com.neuronrobotics.sdk.dyio.DyIO.haveFirmware(), com.neuronrobotics.sdk.common.Log.info(), com.neuronrobotics.sdk.dyio.DyIO.isResyncing(), com.neuronrobotics.sdk.dyio.DyIO.NEURONROBOTICS_DYIO_1_0, com.neuronrobotics.sdk.dyio.DyIO.send(), com.neuronrobotics.sdk.dyio.DyIO.setLegacyParser(), com.neuronrobotics.sdk.dyio.DyIO.setMuteResyncOnModeChange(), and com.neuronrobotics.sdk.dyio.DyIO.setResyncing().

Referenced by com.neuronrobotics.sdk.dyio.DyIO.connect(), and com.neuronrobotics.sdk.dyio.DyIO.validateChannel().

Here is the call graph for this function:

◆ resync() [2/2]

void com.neuronrobotics.sdk.dyio.DyIO.resync ( int  channel)

This method synchronizes the DyIO channel mode from the DyIO module with this DyIO channel object This will actively query the DyIO for this information.

Parameters
channelinteger representing the index of the channel

Definition at line 326 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.getChannel(), and com.neuronrobotics.sdk.dyio.DyIOChannel.resync().

Referenced by com.neuronrobotics.sdk.dyio.DyIOChannel.resync(), and com.neuronrobotics.sdk.dyio.DyIOChannel.setMode().

Here is the call graph for this function:

◆ send()

Object [] com.neuronrobotics.sdk.dyio.DyIO.send ( String  namespace,
BowlerMethod  method,
String  rpcString,
Object[]  arguments 
)

THis is the scripting interface to Bowler devices. THis allows a user to describe a namespace, rpc, and array or arguments to be paced into the packet based on the data types of the argument. The response in likewise unpacked into an array of objects.

Parameters
namespaceThe string of the desired namespace
methodthe method
rpcStringThe string of the desired RPC
argumentsAn array of objects corresponding to the data to be stuffed into the packet.
Returns
The return arguments parsed and packet into an array of arguments
Exceptions
DeviceConnectionExceptionIf the desired RPC's are not available then this will be thrown

Reimplemented from com.neuronrobotics.sdk.common.BowlerAbstractDevice.

Definition at line 168 of file DyIO.java.

Referenced by com.neuronrobotics.sdk.dyio.DyIO.configAdvancedAsyncAutoSample(), com.neuronrobotics.sdk.dyio.DyIO.configAdvancedAsyncDeadBand(), com.neuronrobotics.sdk.dyio.DyIO.configAdvancedAsyncNotEqual(), com.neuronrobotics.sdk.dyio.DyIO.configAdvancedAsyncTreshhold(), com.neuronrobotics.sdk.dyio.DyIO.ConfigureDynamicPIDChannels(), com.neuronrobotics.sdk.dyio.DyIO.connect(), com.neuronrobotics.sdk.dyio.peripherals.ServoChannel.disablePowerOverride(), com.neuronrobotics.sdk.dyio.peripherals.ServoChannel.enablePowerOverride(), com.neuronrobotics.sdk.dyio.DyIOChannel.flush(), com.neuronrobotics.sdk.dyio.DyIO.flushCache(), com.neuronrobotics.sdk.dyio.DyIO.getAllChannelModes(), com.neuronrobotics.sdk.dyio.DyIO.getAllChannelValues(), com.neuronrobotics.sdk.dyio.DyIO.getAvailibleChannelModes(), com.neuronrobotics.sdk.dyio.DyIO.getBatteryVoltage(), com.neuronrobotics.sdk.dyio.peripherals.DyIOAbstractPeripheral.getConfigurationFromDevice(), com.neuronrobotics.sdk.dyio.DyIO.getDyIOChannelCount(), com.neuronrobotics.sdk.dyio.DyIO.getDyPIDConfiguration(), com.neuronrobotics.sdk.dyio.DyIO.getHeartBeatTime(), com.neuronrobotics.sdk.dyio.DyIOChannel.getValue(), com.neuronrobotics.sdk.dyio.DyIO.resync(), com.neuronrobotics.sdk.dyio.DyIOChannel.resync(), com.neuronrobotics.sdk.dyio.DyIOChannel.send(), com.neuronrobotics.sdk.dyio.peripherals.SPIChannel.sendSPIStream(), com.neuronrobotics.sdk.dyio.peripherals.PPMReaderChannel.setCrossLink(), com.neuronrobotics.sdk.dyio.DyIOChannel.setMode(), com.neuronrobotics.sdk.dyio.DyIO.setServoPowerSafeMode(), com.neuronrobotics.sdk.dyio.peripherals.UARTChannel.setUARTBaudrate(), com.neuronrobotics.sdk.dyio.DyIOChannel.setValue(), com.neuronrobotics.sdk.dyio.DyIO.startHeartBeat(), com.neuronrobotics.sdk.dyio.DyIO.stopHeartBeat(), com.neuronrobotics.sdk.dyio.peripherals.PPMReaderChannel.updateValues(), and com.neuronrobotics.sdk.dyio.peripherals.SPIChannel.write().

◆ SetAllPIDSetPoint()

boolean com.neuronrobotics.sdk.dyio.DyIO.SetAllPIDSetPoint ( float[]  setpoints,
double  seconds 
)

Same as SetPIDSetPoint, but will set all setpoints at once. This can be used for co-ordinated motion of independant PID control groups.

Parameters
setpointsand array of setpoint values (must match the number of availible PID control groups)
secondsunits in Seconds, the time it takes to make the transition from current to target. Zero will tell the controllers to go as fast as possible.
Returns
true if no errors occur

Implements com.neuronrobotics.sdk.namespace.bcs.pid.IPidControlNamespace.

Definition at line 882 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.getPid(), and com.neuronrobotics.sdk.pid.GenericPIDDevice.SetAllPIDSetPoint().

Here is the call graph for this function:

◆ setCachedMode()

void com.neuronrobotics.sdk.dyio.DyIO.setCachedMode ( boolean  mode)

This method enables the DyIO cache/flush system. When enabled, the system will interrupt all set value method calls and prevent them from sending packets to the DyIO. The channels will then need to either be flushed individually, or as a group. When the entire group is flushed, all channel values are set with a single packet allowing for co-ordinated motion. All channels will read the current state and set it as the cache value on the event of enabling the cache/flush mode

Parameters
modetrue to enable cache/flush mode, false to disable.

Definition at line 628 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.cachedMode, and com.neuronrobotics.sdk.dyio.DyIO.getInternalChannels().

Here is the call graph for this function:

◆ setInfo()

void com.neuronrobotics.sdk.dyio.DyIO.setInfo ( String  info)

Sets the DyIO's internally stored info string. This is a 16 byte string that can be stored on the DYIO and used as a human-readable, user setable, identifier.

Parameters
infoThe String identifier to be stored by the DyIO.

Definition at line 279 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.info.

◆ setLegacyParser()

void com.neuronrobotics.sdk.dyio.DyIO.setLegacyParser ( boolean  legacyParser)

Sets the legacy parser.

Parameters
legacyParserthe new legacy parser

Definition at line 1423 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.legacyParser.

Referenced by com.neuronrobotics.sdk.dyio.DyIO.resync().

◆ setMode() [1/2]

boolean com.neuronrobotics.sdk.dyio.DyIO.setMode ( int  channel,
DyIOChannelMode  mode 
)

This method sets the I/O mode of a specific channel. the DyIO will be sent a packet to update its mode in firmware If the mode is the same as the current mode, nothing happens If the mode is different from the previous mode, a mode change listeners will be fired Asynchronus state will be unaffected

Parameters
channelinteger representing the index of the channel
modethe DyIOChannelMode that this channel should be set to
Returns
true for success

Definition at line 182 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.getChannel(), and com.neuronrobotics.sdk.dyio.DyIOChannel.setMode().

Referenced by com.neuronrobotics.sdk.dyio.peripherals.SPIChannel.SPIChannel().

Here is the call graph for this function:

◆ setMode() [2/2]

boolean com.neuronrobotics.sdk.dyio.DyIO.setMode ( int  channel,
DyIOChannelMode  mode,
boolean  async 
)

This method sets the I/O mode of a specific channel. the DyIO will be sent a packet to update its mode in firmware If the mode is the same as the current mode, nothing happens If the mode is different from the previous mode, a mode change listeners will be fired

Parameters
channelinteger representing the index of the channel
modethe DyIOChannelMode that this channel should be set to
asyncForces the mode into or out of async mode
Returns
true for success

Definition at line 199 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.getChannel(), and com.neuronrobotics.sdk.dyio.DyIOChannel.setMode().

Here is the call graph for this function:

◆ setMuteResyncOnModeChange()

void com.neuronrobotics.sdk.dyio.DyIO.setMuteResyncOnModeChange ( boolean  muteResyncOnModeChange)

This will enable a state where the DyIO will surpress DyIO mode update events.

Parameters
muteResyncOnModeChangetrue to enable the muted mode

Definition at line 1187 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.muteResyncOnModeChange.

Referenced by com.neuronrobotics.sdk.dyio.DyIO.getAllChannelModes(), com.neuronrobotics.sdk.dyio.DyIO.resync(), and com.neuronrobotics.sdk.dyio.DyIOChannel.setMode().

◆ SetPDVelocity()

boolean com.neuronrobotics.sdk.dyio.DyIO.SetPDVelocity ( int  group,
int  unitsPerSecond,
double  seconds 
) throws PIDCommandException

This method will use the internal PD velocity controller to run a PID controller at a constant velocity. Since this is not using the linear interpolation, it can run forever by giving Zero as the 'seconds' parameter.

Parameters
groupthe index of the PID group
unitsPerSeconda velocity in raw units per second
secondsthe amount of time to run at this velocity, or Zero to run forever
Returns
true, if successful
Exceptions
PIDCommandExceptionIf the values are out of range with the given data

Implements com.neuronrobotics.sdk.namespace.bcs.pid.IPidControlNamespace.

Definition at line 947 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.getPid(), and com.neuronrobotics.sdk.pid.GenericPIDDevice.SetPDVelocity().

Here is the call graph for this function:

◆ SetPIDInterpolatedVelocity()

boolean com.neuronrobotics.sdk.dyio.DyIO.SetPIDInterpolatedVelocity ( int  group,
int  unitsPerSecond,
double  seconds 
) throws PIDCommandException

This method will use the linear interpolation system to set an output velocity of the PID controller. This method can be bounded by the maximum value representable by the sensor and can fail if that value is out of range.

Parameters
groupthe index of the PID group
unitsPerSeconda velocity in raw units per second
secondsthe amount of time to run at this velocity
Returns
true if successful
Exceptions
PIDCommandExceptionIf the values are out of range with the given data

Implements com.neuronrobotics.sdk.namespace.bcs.pid.IPidControlNamespace.

Definition at line 940 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.getPid(), and com.neuronrobotics.sdk.pid.GenericPIDDevice.SetPIDInterpolatedVelocity().

Here is the call graph for this function:

◆ SetPIDSetPoint()

boolean com.neuronrobotics.sdk.dyio.DyIO.SetPIDSetPoint ( int  group,
float  setpoint,
double  seconds 
)

This method sets the target setpoint for the specified PID controller group. This method will set up a linear interpolation from current position to target position which will take the specified number of seconds to make that transition

Parameters
groupthe index of the PID group
setpointthe target position for the controller
secondsunits in Seconds, the time it takes to make the transition from current to target. Zero will tell the controller to go as fast as possible.
Returns
true if no errors occur

Implements com.neuronrobotics.sdk.namespace.bcs.pid.IPidControlNamespace.

Definition at line 876 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.getPid(), and com.neuronrobotics.sdk.pid.GenericPIDDevice.SetPIDSetPoint().

Here is the call graph for this function:

◆ setResyncing()

void com.neuronrobotics.sdk.dyio.DyIO.setResyncing ( boolean  resyncing)

Sets the flag to represent if the DyIO is currently re-syncing itself with the device.

Parameters
resyncingthe new resyncing

Definition at line 1223 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.resyncing.

Referenced by com.neuronrobotics.sdk.dyio.DyIO.resync().

◆ setServoPowerSafeMode()

boolean com.neuronrobotics.sdk.dyio.DyIO.setServoPowerSafeMode ( boolean  enable)

This method allows you to disable the brown out detect for the servo subsystem. If true is passed

Parameters
enabletrue to enable the borwnout, false to disable
Returns
True is success

Definition at line 1156 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.enableBrownOut, com.neuronrobotics.sdk.dyio.DyIO.powerEvent(), and com.neuronrobotics.sdk.dyio.DyIO.send().

Referenced by com.neuronrobotics.sdk.dyio.DyIO.isServoPowerSafeMode().

Here is the call graph for this function:

◆ setValue() [1/3]

boolean com.neuronrobotics.sdk.dyio.DyIO.setValue ( int  channel,
ByteList  value 
)

This method sets the value of a channel with a pre-packaged ByteList of the data to send. Since the bytelist is pre-packaged, the data will be sent to the DyIO as it is packet into the ByteList with NO VERIFICATION.

Parameters
channelinteger representing the index of the channel
valueByteList of the data to send to the DyIO
Returns
true for success

Definition at line 234 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.getChannel(), and com.neuronrobotics.sdk.dyio.DyIOChannel.setValue().

Here is the call graph for this function:

◆ setValue() [2/3]

boolean com.neuronrobotics.sdk.dyio.DyIO.setValue ( int  channel,
int  value 
)

This method is a simple value set for a DyIO channel. This method is unit-less and will clip data to fit the channel modes requirements.

Parameters
channelinteger representing the index of the channel
valueUnit-less value to set to the DyIO's channel
Returns
true for success

Definition at line 221 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.getChannel(), and com.neuronrobotics.sdk.dyio.DyIOChannel.setValue().

Referenced by com.neuronrobotics.sdk.dyio.DyIO.setValue().

Here is the call graph for this function:

◆ setValue() [3/3]

boolean com.neuronrobotics.sdk.dyio.DyIO.setValue ( int  channel,
java.math.BigDecimal  value 
)

This method is a simple value set for a DyIO channel. This method is unit-less and will clip data to fit the channel modes requirements.

Parameters
channelinteger representing the index of the channel
valueUnit-less value to set to the DyIO's channel
Returns
true for success

Definition at line 245 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.setValue().

Here is the call graph for this function:

◆ startHeartBeat()

void com.neuronrobotics.sdk.dyio.DyIO.startHeartBeat ( long  msHeartBeatTime)

This method enables the heart beat. It tells the device how often to expect synchronous packet, and if communication fails to send in the given time, then the device should go into its "safe state". This will also set up a thread to ping the device periodically if it has been too long since the last user generated synchronous packet.

Parameters
msHeartBeatTimethe ms heart beat time

Reimplemented from com.neuronrobotics.sdk.common.BowlerAbstractDevice.

Definition at line 1092 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.checkFirmwareRev(), and com.neuronrobotics.sdk.dyio.DyIO.send().

Here is the call graph for this function:

◆ stopHeartBeat()

void com.neuronrobotics.sdk.dyio.DyIO.stopHeartBeat ( )

This method stops the heart beat and tells the device to stop expecting a heart beat. This will DISABLE the safe mode detect.

Reimplemented from com.neuronrobotics.sdk.common.BowlerAbstractDevice.

Definition at line 1119 of file DyIO.java.

References com.neuronrobotics.sdk.dyio.DyIO.checkFirmwareRev(), and com.neuronrobotics.sdk.dyio.DyIO.send().

Here is the call graph for this function:

◆ toString()

String com.neuronrobotics.sdk.dyio.DyIO.toString ( )

◆ validateChannel()

void com.neuronrobotics.sdk.dyio.DyIO.validateChannel ( int  channel)
protected

Validates a that a given channel is in the proper range.

Parameters
channelinteger representing the index of the channel

Definition at line 590 of file DyIO.java.

References com.neuronrobotics.sdk.common.Log.error(), com.neuronrobotics.sdk.dyio.DyIO.getInternalChannels(), com.neuronrobotics.sdk.dyio.DyIO.haveBeenSynced, com.neuronrobotics.sdk.dyio.DyIO.resync(), and com.neuronrobotics.sdk.util.ThreadUtil.wait().

Referenced by com.neuronrobotics.sdk.dyio.DyIO.getChannel().

Here is the call graph for this function:

Member Data Documentation

◆ bankAState

DyIOPowerState com.neuronrobotics.sdk.dyio.DyIO.bankAState
private

The bank a state.

Definition at line 78 of file DyIO.java.

Referenced by com.neuronrobotics.sdk.dyio.DyIO.getBankAState(), and com.neuronrobotics.sdk.dyio.DyIO.powerEvent().

◆ bankBState

DyIOPowerState com.neuronrobotics.sdk.dyio.DyIO.bankBState
private

The bank b state.

Definition at line 81 of file DyIO.java.

Referenced by com.neuronrobotics.sdk.dyio.DyIO.getBankBState(), and com.neuronrobotics.sdk.dyio.DyIO.powerEvent().

◆ batteryVoltage

double com.neuronrobotics.sdk.dyio.DyIO.batteryVoltage = 0
private

The battery voltage.

Definition at line 84 of file DyIO.java.

Referenced by com.neuronrobotics.sdk.dyio.DyIO.getBatteryVoltage(), and com.neuronrobotics.sdk.dyio.DyIO.powerEvent().

◆ cachedMode

boolean com.neuronrobotics.sdk.dyio.DyIO.cachedMode =false
private

◆ channels

ArrayList<DyIOChannel> com.neuronrobotics.sdk.dyio.DyIO.channels = new ArrayList<DyIOChannel>()
private

The channels.

Definition at line 69 of file DyIO.java.

Referenced by com.neuronrobotics.sdk.dyio.DyIO.getInternalChannels().

◆ checkFirmware

boolean com.neuronrobotics.sdk.dyio.DyIO.checkFirmware =false
staticprivate

◆ dyioChanCount

Integer com.neuronrobotics.sdk.dyio.DyIO.dyioChanCount = null
private

The dyio chan count.

Definition at line 1336 of file DyIO.java.

Referenced by com.neuronrobotics.sdk.dyio.DyIO.getDyIOChannelCount().

◆ enableBrownOut

Boolean com.neuronrobotics.sdk.dyio.DyIO.enableBrownOut =null
private

◆ firmware

byte [] com.neuronrobotics.sdk.dyio.DyIO.firmware = {0, 0, 0}
private

◆ haveBeenSynced

boolean com.neuronrobotics.sdk.dyio.DyIO.haveBeenSynced =false
private

◆ info

String com.neuronrobotics.sdk.dyio.DyIO.info = "DyIO"
private

◆ legacyParser

boolean com.neuronrobotics.sdk.dyio.DyIO.legacyParser = false
private

◆ listeners

ArrayList<IDyIOEventListener> com.neuronrobotics.sdk.dyio.DyIO.listeners = new ArrayList<IDyIOEventListener>()
private

◆ muteResyncOnModeChange

boolean com.neuronrobotics.sdk.dyio.DyIO.muteResyncOnModeChange =false
private

◆ NEURONROBOTICS_DYIO_1_0

final String com.neuronrobotics.sdk.dyio.DyIO.NEURONROBOTICS_DYIO_1_0 = "neuronrobotics.dyio.*;1.0"
staticprivate

The Constant NEURONROBOTICS_DYIO_1_0.

Definition at line 63 of file DyIO.java.

Referenced by com.neuronrobotics.sdk.dyio.DyIO.resync().

◆ pid

GenericPIDDevice com.neuronrobotics.sdk.dyio.DyIO.pid = new GenericPIDDevice()
private

◆ resyncing

boolean com.neuronrobotics.sdk.dyio.DyIO.resyncing = false
private

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