Misc Data Types
EventHook Class
- class RobotRaconteur.EventHook
EventHook is used to implement multiple listener events in Robot Raconteur Python. Callback functions are registered with the EventHook and are all notified when the event is fired.
- __iadd__(handler)
Adds a callback function to be notified of events
- __isub__(handler)
Removes a callback function
- fire(*args, **keywargs)
Fires the event
VarValue Class
- RobotRaconteur.VarValue
alias of
RobotRaconteurVarValue
ArrayMemory Class
- class RobotRaconteur.ArrayMemory(memory=None)
The
ArrayMemory
is designed to represent a large array that is read in smaller pieces. It is used with the “memory” member to allow for random access to an array.- Attach(memory)
Attach the memory to an array
- Parameters:
memory (numpy.ndarray) – The data to attach
- property Length
The length of the memory
- Return type:
int
- Read(memorypos, buffer, bufferpos, count)
Reads data from the memory into
buffer
- Parameters:
memorypos (int) – The start position in the memory array
buffer (numpy.ndarray) – The buffer to read the data into
bufferpos (int) – The start position in the supplied buffer
count (int) – The number of elements to read
- Write(memorypos, buffer, bufferpos, count)
Writes data from
buffer
into the memory- Parameters:
memorypos (int) – The start position in the memory array
buffer (numpy.ndarray) – The buffer to write the data from
bufferpos (int) – The start position in the supplied buffer
count (int) – The number of elements to write
- memory
(numpy.ndarray) The underlying array of the memory
MultiDimArrayMemory Class
- class RobotRaconteur.MultiDimArrayMemory(memory=None)
The
MultiDimArrayMemory
is designed to represent a large multi-dimensional array that is read in smaller pieces. It is used with the “memory” member to allow for random access to an multi-dimensional array. It works with numpy.ndarray. For thememorypos
,bufferpos
, andcount
parameters in the functions, a list is used to represent the dimensions. The dimensions are column-major as is numpy.ndarray.- Attach(memory)
Attach the memory to an array
- Parameters:
memory (numpy.ndarray) – The data to attach
- property DimCount
The number of dimensions
- Return type:
int
- property Dimensions
The dimensions of the memory
- Return type:
List[int]
- Read(memorypos, buffer, bufferpos, count)
Reads data from the memory into
buffer
- Parameters:
memorypos (List[int]) – The start position in the array
buffer (numpy.ndarray) – The buffer to read the data into
bufferpos (List[int]) – The start position int he buffer
count (List[int]) – The shape of elements to read
- Write(memorypos, buffer, bufferpos, count)
Writes data into the memory from
buffer
- Parameters:
memorypos (List[int]) – The start position in the array
buffer (numpy.ndarray) – The buffer to write the data from
bufferpos (List[int]) – The start position in the buffer
count (List[int]) – The shape of elements to write
- memory
(numpy.ndarray) The underlying array of the memory
ServiceInfo2 Class
- class RobotRaconteur.ServiceInfo2
Contains information about a service found using discovery
ServiceInfo2 contains information about a service required to connect to the service, metadata, and the service attributes
ServiceInfo2 structures are returned by RobotRaconteurNode.FindServiceByType() and ServiceInfo2Subscription
- Attributes
(Dict[str,Any]) Service attributes
- ConnectionURL
(List[str]) Candidate URLs to connect to the service
- Name
(str) The name of the service
- NodeID
(RobotRaconteur.NodeID) The NodeID of the node that owns the service
- NodeName
(str) The NodeName of the node that owns the service
- RootObjectImplements
(str) The fully qualified types the root object implements
- RootObjectType
(str) The fully qualified types the root object implements
NodeInfo2 Class
- class RobotRaconteur.NodeInfo2
Contains information about a node detected using discovery
NodeInfo2 contains information about a node detected using discovery. Node information is typically not verified, and is used as a first step to detect available services.
NodeInfo2 structures are returned by RobotRaconteurNode.FindNodeByName() and RobotRaconteurNode.FindNodeByID()
- ConnectionURL
(List[str]) Candidate URLs to connect to the node
The URLs for the node typically contain the node transport endpoint and the nodeid. A URL service parameter must be appended to connect to a service.
- NodeID
(RobotRaconteur.NodeID) The NodeID of the detected node
- NodeName
(str) The NodeName of the detected node
TimeSpec Class
- class RobotRaconteur.TimeSpec(seconds=0, nanoseconds=0)
Represents. a point in time. Used by “wire” members to timestamp packets
Time is always in UTC
Time is relative to the UNIX epoch “1970-01-01T00:00:00Z”
- Parameters:
seconds (int) – seconds from epoch
nanoseconds (int) – nanoseconds from epoch
- seconds
Seconds since epoch
- nanoseconds
Nanoseconds from epoch. Normalized to be between 0 and 1e9-1
- cleanup_nanosecs()
normalize nanoseconds to be within 0 and 1e9-1
- __eq__(t2)
equality comparison
- __ne__(t2)
inequality comparison
- __sub__(t2)
subtraction operator
- __add__(t2)
addition operator
- __gt__(t2)
greater-than comparison
- __lt__(t2)
less-then comparison
- __le__(t2)
less-than-or-equal comparison
NodeID Class
- class RobotRaconteur.NodeID(Union[None,str,numpy.ndarray])
NodeID UUID storage and generation
Robot Raconteur uses NodeID and NodeName to uniquely identify a node. NodeID is a UUID (Universally Unique ID), while NodeName is a string. The NodeID is expected to be unique, while the NodeName is set by the user and may not be unique. The NodeID class represents the UUID NodeID.
A UUID is a 128-bit randomly generated number that is statistically guaranteed to be unique to a very high probability. NodeID uses the Boost.UUID library to generate, manage, and store the UUID.
The UUID can be loaded from a string, bytes, or generated randomly at runtime. It can be converted to a string.
The LocalTransport and ServerNodeSetup classes will automatically assign a NodeID to a node when the local transport is started with a specified node name. The generated NodeID is stored on the local system, and is associated with the node name. It will be loaded when a node is started with the same NodeName.
NodeID with all zeros is considered “any” node.
- __eq__(id2)
Return self==value.
- __ne__(id2)
Return self!=value.
- __str__()
Return str(self).
- static FromByteArray(bytes)
Returns a new NodeID from bytes
- Parameters:
bytes (bytearray) – The bytes
- Returns:
The new NodeID instance with the specified UUID
- Return type:
- static GetAny()
Get the “any” NodeId
- Returns:
The “any” NodeID
- Return type:
- IsAnyNode()
Is the NodeID UUID all zeros
The all zero UUID respresents “any” node, or an unset NodeID
- Returns:
True The NodeID UUID is all zeros, representing any node, False The NodeID UUID is not all zeros
- Return type:
bool
- static NewUniqueID()
Generate a new random NodeID UUID
Returned UUID is statistically guaranteed to be unique
- Returns:
NodeID The newly generated UUID
- Return type:
- ToByteArray()
Convert the NodeID UUID to bytes
- Returns:
The UUID as bytes
- Return type:
bytearray