public class BasicDecoder extends SyncedUnit implements Decoder
Modifier and Type | Field and Description |
---|---|
protected float |
fcn |
protected ModemContainer |
modem |
protected ConfigurationImpl |
myConfiguration |
protected int |
myDimension |
protected org.ros.message.MessageListener<std_msgs.Float32MultiArray> |
myListener |
protected java.lang.String |
myName |
protected Node |
myNode |
protected Noise |
myNoise |
protected Noise[] |
myNoises |
protected boolean |
myRequiredOnCPU |
protected org.ros.node.ConnectedNode |
myRosNode |
protected org.ros.node.topic.Subscriber<std_msgs.Float32MultiArray> |
mySubscription |
protected Units |
myUnits |
protected InstantaneousOutput |
myValues |
protected static org.apache.log4j.Logger |
ourLogger |
Backend |
ros |
protected static long |
serialVersionUID |
protected float |
startTime |
synchronous
Constructor and Description |
---|
BasicDecoder(Node node,
java.lang.String name,
java.lang.String dataType,
int[] dimensionSizes,
Units units,
ModemContainer modem,
Backend ros) |
BasicDecoder(Node node,
java.lang.String name,
java.lang.String dataType,
int[] dimensionSizes,
Units units,
ModemContainer modem,
Backend ros,
boolean synchronous)
The same, but we can choose whether the Decoder will be synchronous or not
|
Modifier and Type | Method and Description |
---|---|
Origin |
clone() |
Origin |
clone(Node node)
Clone method that changes necessary parameters to point to a new parent,
for use in cloning ensembles, etc.
|
Configuration |
getConfiguration() |
int |
getDimensions() |
float |
getEndTime() |
java.lang.String |
getName()
get name of the termination
this name corresponds to a ROS topic subscribed
|
Node |
getNode() |
Noise |
getNoise() |
boolean |
getRequiredOnCPU() |
float |
getStartTime()
TODO: problem how to sync Nengo and ROS time references
|
Units |
getUnits() |
InstantaneousOutput |
getValues() |
protected void |
initConfiguration() |
void |
onNewRosMessage(org.ros.internal.message.Message rosMessage)
ROS fires onNewRosMessage events, so here is my subscription:
each new ROS message accept, decode and update my values to them.
|
void |
reset(boolean randomize) |
void |
setDimensions(int dim) |
void |
setName(java.lang.String name) |
void |
setNoise(Noise noise)
Note that noise is only applied to RealOutput.
|
void |
setRequiredOnCPU(boolean val) |
void |
setUnits(Units units) |
void |
setValues(float startTime,
float endTime,
float[] values)
--This method should not be called from the outside--
setValues is called by my own Event listener
This method is normally called by the Node that contains this Origin, to set the input that is
read by other nodes from getValues().
|
void |
setValues(InstantaneousOutput values)
--This method should not be called from the outside--
setValues is called by my own Event listener
This method is normally called by the Node that contains this Origin, to set the input that is
read by other nodes from getValues().
|
addChild, discardChildsReady, isReady, removeChild, setReady, setSynchronous
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addChild, discardChildsReady, isReady, removeChild, setReady, setSynchronous
protected static final long serialVersionUID
protected static org.apache.log4j.Logger ourLogger
protected Node myNode
protected java.lang.String myName
protected int myDimension
protected Units myUnits
protected InstantaneousOutput myValues
protected Noise myNoise
protected Noise[] myNoises
protected transient ConfigurationImpl myConfiguration
protected boolean myRequiredOnCPU
protected ModemContainer modem
protected org.ros.node.ConnectedNode myRosNode
protected org.ros.node.topic.Subscriber<std_msgs.Float32MultiArray> mySubscription
protected org.ros.message.MessageListener<std_msgs.Float32MultiArray> myListener
protected float fcn
protected float startTime
public Backend ros
public BasicDecoder(Node node, java.lang.String name, java.lang.String dataType, int[] dimensionSizes, Units units, ModemContainer modem, Backend ros) throws MessageFormatException, StructuralException
public BasicDecoder(Node node, java.lang.String name, java.lang.String dataType, int[] dimensionSizes, Units units, ModemContainer modem, Backend ros, boolean synchronous) throws MessageFormatException, StructuralException
public void onNewRosMessage(org.ros.internal.message.Message rosMessage)
onNewRosMessage
in interface MyEventListenerInterface
protected void initConfiguration()
public Configuration getConfiguration()
Configurable.getConfiguration()
public void setValues(float startTime, float endTime, float[] values)
startTime
- Start time of step for which outputs are being definedendTime
- End time of step for which outputs are being definedvalues
- Values underlying RealOutput that is to be output by this Origin in subsequent
calls to getValues()public void setValues(InstantaneousOutput values)
public int getDimensions()
getDimensions
in interface Origin
Origin.getDimensions()
public void setDimensions(int dim)
dim
- Origin dimensionalitypublic java.lang.String getName()
Decoder
getName
in interface Origin
getName
in interface Decoder
getName
in interface SyncedUnitInterface
getName
in class SyncedUnit
Origin.getName()
public void setName(java.lang.String name)
setName
in interface SyncedUnitInterface
setName
in class SyncedUnit
name
- Origin namepublic Units getUnits()
public void setUnits(Units units)
units
- Units used by this originpublic InstantaneousOutput getValues() throws SimulationException
getValues
in interface Origin
SimulationException
- if there is any problem retrieving valuesOrigin.getValues()
public Noise getNoise()
Noise.Noisy.getNoise()
public void setNoise(Noise noise)
public Node getNode()
getNode
in interface Origin
Origin.getNode()
public Origin clone() throws java.lang.CloneNotSupportedException
public void reset(boolean randomize)
Resettable.reset(boolean)
public void setRequiredOnCPU(boolean val)
setRequiredOnCPU
in interface Origin
public boolean getRequiredOnCPU()
getRequiredOnCPU
in interface Origin
public float getStartTime()
Decoder
getStartTime
in interface Decoder
public float getEndTime()
getEndTime
in interface Decoder