samna#

Submodules#

Module content#

class samna.SamnaNode#

Bases: pybind11_object

SamnaNode is the class of a local node, must be created first at the beginning.

get_receiver_endpoint(self: samna.SamnaNode) str#

Get the receiver endpoint of the samna node.

Returns:

A string of its receiver endpoint.

get_sender_endpoint(self: samna.SamnaNode) str#

Get the sender endpoint of the samna node.

Returns:

A string of its sender endpoint.

open_dev_kit(self: samna.SamnaNode) samna.speckDevKit.SpeckDevKit#

Open a Speck devkit.

Returns:

A Speck devkit.

exception samna.SinkError(message: str, events)#

Bases: RuntimeError

samna.close_remote_node(arg0: str) None#

Removes the content of an already bound remote store by its name.

Parameters:

name (string): Name with which the remote store was registered.

Returns:

Nothing.

Throws:

If the chosen name doesen’t exist. If the chosen name refers to a module that doesen’t hold a remote store content.

samna.dvs128_configuration_to_event(arg0: samna.dvs128.configuration.Dvs128Configuration) List[samna.dvs128.event.WriteRegisterValue | samna.dvs128.event.ReadRegisterValue | samna.dvs128.event.KillSensorPixel | samna.dvs128.event.ResetSensorPixel | samna.dvs128.event.WriteFilterValue | samna.dvs128.event.ReadFilterValue]#

Get the input events for the given DVS128 configuration.

Parameters:

config (dvs128.configuration.Dvs128Configuration) – The configuration to turn into events.

Returns:

A list of input events.

samna.init_samna(sender_endpoint: str = '', receiver_endpoint: str = '', samna_node_name: str = 'device_node', samna_node_id: int = 1, interpreter_node_id: int = 2, timeout_milliseconds: int = 1000) SamnaNode#

Create a samna node, associate it to the python interpreter, and expose it as a submodule. Endpoints are derived automatically when not provided. Subsequent calls will not overwrite the previous values.

If you need to start up visualizer, you should call this method to set up a local node which is used to communicate with the visualizer. Or you can skip this method.

Parameters:
  • sender_endpoint (string) – TCP endpoint where requests are SENT. Example “tcp://0.0.0.0:12345

  • receiver_endpoint (string) – TCP endpoint where requests are RECEIVED. Example “tcp://0.0.0.0:12345

  • samna_node_name (string) – Name to access the samna node submodule.

  • samna_node_id (int) – ID associated to the samna node.

  • interpreter_node_id (int) – ID associated to the interpreter node.

  • timeout_milliseconds (int) – timeout duration in milliseconds.

Returns:

A reference to samna node.

samna.open_remote_node(id: int = 0, name: str = '', timeout_milliseconds: int = 1000) None#
Retrieves the content of a remote store by its ID.

Creates a submodule ‘name’ with instances that will allow the interaction with objects in the remote store.

Parameters:

nodeId (int): ID associated to the remote node. name (string): Name that should be given to the submodule holding remote content proxies. timeoutMilliseconds: timeout duration in milliseconds, default 1000.

Returns:

Nothing.

Throws:

If the nodeId is not reacheable (tip: check the ZMQ endpoints and their order). If the chosen name is already in use.

samna.setup_local_node(arg0: str, arg1: str, arg2: int) None#

Creates the svejs node associated to the python interpreter.

Parameters:

sender_endpoint (string): TCP endpoint where requests are SENT. Example “tcp://0.0.0.0:12345” requests_endpoint (string): TCP endpoint where requests are RECEIVED. Example “tcp://0.0.0.0:12345” nodeId (int): ID associated to the interpreter node.

Returns:

Nothing.