D6 – ROSjava – Logic Gates

This demo shows employing custom ROS nodes implementing simple external computation, where data are sent/received by Nengo.

Each ROS node here implements simple logic operation, e.g. AND, XOR, NOT, NAND, OR.. Because the Nengo communicates with real-valued numbers, these nodes use custom encoders which simply “round” received data to the nearest boolean. Data published by nodes are converted to float in the corresponding decoder.

Running the Script

The source code is located under the logic/gates project and the script can be ran by:

run nr-demo/gates/logic_crisp_gates.py

This script does:

  • Launches several Neural Modules, where each represent ROS node implementing some funciton
  • Adds two function generators
  • Represents the result of each logic operation by neural ensemble.


After launching the interactive simulation, the behavior of resulting network can be seen. One can observe rounding values passed to the ROS nodes or change of neural activity in the connected neural ensembles.


ROS Network

The corresponding RQT visualization looks as follows:


Again, each gate has own unique auto-generated namespace, publishes to one topic and is subscribed to one or two different topic. Modem connects the communication with the Nengo simulator.