Remote Controls

The framework for remote control systems within AnimatLab is intended to simplify the task of connecting standard user IO devices, like joysticks, keyboards, and so on, to AnimatLab so it can interface directly with the neural control systems. Currently, it has support for the Xbee Commander joystick and the generic Animat serial protocol, but I plan to quickly add support for standard joystick and keyboard systems. The RemoteControl class is derived from RobotIOController. A remote control object contains a number of RemoteControlLinkage objects. Each one of these links a given command feature on the input system to drive a neural response. For example, the XBee commander has two joysticks with vertical and horizontal output values and several buttons. Using a linkage you can drive current into a neuron that is proportional to the horizontal value of one of the joysticks, or when one of the buttons are pressed. You can add as many different types of linkages as you need, and multiple linkages can use the same input data and drive the same neuron. So for example, you can have one linkage that is driven by the horizontal value of the joystick and only provides current to neuron A when the value is above 0, or when it is moving left. You can then have a second linkage that only provides current to neuron B when the value is below 0, or when it is moving right. Or you could have both linkages provide positive current when it moves left or right. It is entirely up to user on how they want this configured.

There are currently two types of linkages available. Each one can be added as an input from the hardware to the simulation, or as an output from the simulation back to the hardware. The first is the pass through linkage. It will take the input value from your linked item, convert that using a gain function, and then apply it as a current to a selected neuron. This is targeted towards continuous input data streams like the joystick position where you have always have analog value between A and B. The second linkage type is for pulsed data that only comes in sporadically. An example of this is shown with the XBee Commander system. It has functionality to detect when a user starts and stops moving the joystick and produces a single pulse. So you could use a pulsed linkage to look for that pulse. When it finds one then it will apply a specified current to the linked neuron for a given duration. If multiple pulses come in it will keep track of up to 100 pulses and apply each of them for the correct duration. Another example of where this type of linkage would be useful is if you have another system like Spike2 that is analyzing spike trains and then sending out brief data spikes each time it finds a matching waveform. You can assign a given waveform to have a unique ID and then use pulsed linkages to stimulate corresponding neurons within your simulation. So you could have multiple neurons that are stimulated when the same waveform is detected, but each with a different current magnitude and duration, or you could have a different waveform detection stimulate a unique neuron. Again, it is entirely user configurable how you want to set this up.

To add a remote control you need to right click on the robot interface and select Add Robot IO control. Then you need to select an IO control that is a remote control. Currently, this is can be the XBee Commander control or the AnimatSerial control. When that new part is selected you will see a Links item in the property grid that will say "Click to Edit." When you click on the button it will open an editor that will allow you to add/remove/edit linkages. You can add the linkage as an input to the simulation or as an output to the hardware. The XBee commander is defaulted with linkages for all the buttons and joysticks, but they are not linked to any outputs. Click the Add button to add new linkages, or the remove button to delete the selected one. Clicking on one of the linkages in the list will display its properties in the grid for editing. Below is a description of the properties for the two different types of linkages.


Passthrough Linkage: Converts the floating point source data into an output value and applies it at every time step. Essentially, converts the source and passes it through to the neural component. A typical example of where this would be used is in a joystick horizontal or vertical control. 
    Linked Node: This is a link to the neuron that you want to stimulate.
    Source data type: This is the source data type from the remote control object that will be used to stimulate the linked neuron.
    Gain: This is used to convert the source data into a current that will be applied to the linked node.
    Enabled:
Enables or disables this linkage.
  Pulsed Linkage: This is for sporadic types of inputs like button presses. When a given event like a button down happens it will apply a fixed amount of current for a fixed duration to the specified neural component.
    Linked Node: This is a link to the neuron that you want to stimulate.
    Source data type: This is the source data type from the remote control object that will be used to stimulate the linked neuron.
    Match Value: This is the integer value you are trying to match. When the source data is equal to this value you will get a match found. The IO runs in a separate thread, so it is possible that you could several matches between the one simulation time step and the next. Each match that is found in the IO step is added up and used in the simulation loop to add the appropriate amount of current.
    Match On Change: If this is true then you will only get a match signalled when the source data has changed. For example, if you were looking at a de-bounced switch push. Then the switch value would go from 0 to 1 and stay 1 as long as the button is down, and then go to 0 when it is released. If you only want to apply a current pulse on the rising edge then set this property to true and set the Match Value to 1. Then when the value changes from 0 to 1 a match would be found. While it stays 1, and when it transitions from 1 to 0 no matches will be found.
    Pulse current: This is the amount of current that should be applied for a single matching value. If multiple matches are found then pulse current will be multiplied by the number of matches.
    Pulse duration: This is the duration for a single pulse. The linkage keeps a list of of up to 100 pulses and at each time step it decrements them. When an entry goes to 0 it is removed from the list. The total current applied is determined by the number of entries in the list. This ensures that each pulse is applied for the correct pulse duration regardless of when it came in.
    Enabled:
Enables or disables this linkage.

Here is a list of available remote control systems.

  XBee Commander: Interfaces with the XBee commander joystick controller.
  Animat Serial: Generic serial protocol to allow AnimatLab simulations to interface directly with hardware. An example Arduino sketch is provided to show how this works.