public class BasicEncoder extends java.lang.Object implements Encoder
Modifier and Type | Field and Description |
---|---|
protected int |
dimensions |
protected DynamicalSystem |
dynamics |
protected Integrator |
integrator |
static java.lang.String |
me |
protected MultiTermination |
multiTermination |
protected org.ros.node.ConnectedNode |
myRosNode |
protected java.lang.String |
name |
protected NeuralModule |
parent |
Backend |
ros |
Constructor and Description |
---|
BasicEncoder(NeuralModule parent,
DynamicalSystem dynamics,
Integrator integrator,
java.lang.String name,
java.lang.String dataType,
Units u,
ModemContainer modem,
Backend ros)
Constructor of Basic Encoder which can hold one or more Terminations.
|
BasicEncoder(NeuralModule parent,
int[] dimensionsizes,
DynamicalSystem dynamics,
Integrator integrator,
java.lang.String name,
java.lang.String dataType,
Units u,
ModemContainer modem,
Backend ros)
Constructor of Basic Encoder which can hold one or more Terminations.
|
Modifier and Type | Method and Description |
---|---|
int |
getDimensions()
Get dimensions of this encoder.
|
MultiTermination |
getMultiTermination()
Return own MultiTermination, this allows user to add new Terminations
to it.
|
java.lang.String |
getName()
Return the name of Encoder, this name corresponds
to ROS Topic on which the messages are published and
is used to generate names for own Terminations.
|
NeuralModule |
getParent()
Get the parent of Encoder
|
void |
reset(boolean randomize) |
void |
run(float startTime,
float endTime)
Run encoder for a given time, that is
Combine values on all my Terminations
Encode the result into the ROS message
Publish the ROS message on a topic which corresponds
to the name of Encoder
Note that parent NeuralModule is responsible for running all
Terminations before running Encoders, so that Terminations
contain new values while calling this method.
|
public static final java.lang.String me
protected int dimensions
protected DynamicalSystem dynamics
protected Integrator integrator
protected NeuralModule parent
protected java.lang.String name
protected org.ros.node.ConnectedNode myRosNode
protected MultiTermination multiTermination
public Backend ros
public BasicEncoder(NeuralModule parent, DynamicalSystem dynamics, Integrator integrator, java.lang.String name, java.lang.String dataType, Units u, ModemContainer modem, Backend ros) throws StructuralException, ConnectionException
parent
- NeuralModule to which this belongs (will register Terminations to it)dynamics
- defines dynamics of all Terminations registered and used by meintegrator
- defines dynamics of all my Terminationsname
- name of this Encoder (also name of my ROS topic and base name for my Terminations)dataType
- type of data to decodeu
- Nengo units used heremodem
- my modem, should be already runningros
- ROS backend which defines how Nengo RealOutput is converted into ROS messagesStructuralException
- e.g. problem with registering the TerminationConnectionException
- ROS network problemctu.nengoros.comm.rosBackend.backend.impl
public BasicEncoder(NeuralModule parent, int[] dimensionsizes, DynamicalSystem dynamics, Integrator integrator, java.lang.String name, java.lang.String dataType, Units u, ModemContainer modem, Backend ros) throws StructuralException, ConnectionException
parent
- NeuralModule to which this belongs (will register Terminations to it)dimensionsizes
- sizes of each dimensiondynamics
- defines dynamics of all Terminations registered and used by meintegrator
- defines dynamics of all my Terminationsname
- name of this Encoder (also name of my ROS topic and base name for my Terminations)dataType
- type of data to decodeu
- Nengo units used heremodem
- my modem, should be already runningros
- ROS backend which defines how Nengo RealOutput is converted into ROS messagesStructuralException
- e.g. problem with registering the TerminationConnectionException
- ROS network problemctu.nengoros.comm.rosBackend.backend.impl
public void run(float startTime, float endTime) throws SimulationException
Encoder
run
in interface Encoder
SimulationException
public void reset(boolean randomize)
reset
in interface Resettable
randomize
- True indicates that the object should be reset to a
randomly selected initial state (the object must be aware of the
distribution from which to draw from). False indicates that the
object should be reset to a fixed initial state (which it must
also know). Some objects may not support randomization of the initial
state, in which case a fixed state will be used in either case.public NeuralModule getParent()
Encoder
public java.lang.String getName()
Encoder
public int getDimensions()
Encoder
getDimensions
in interface Encoder
public MultiTermination getMultiTermination() throws StructuralException
Encoder
getMultiTermination
in interface Encoder
StructuralException