sas
Modularised monitoring, logging, and control of robots.
Loading...
Searching...
No Matches
sas_datalogger.sas_datalogger.SASDatalogger Class Reference
Inheritance diagram for sas_datalogger.sas_datalogger.SASDatalogger:

Public Member Functions

 __init__ (self, str node_name)
 __enter__ (self)
 __exit__ (self, exc_type, exc_val, exc_tb)
 save (self, str filename)
 log_callback (self, LogDatum msg)

Public Attributes

dict data = {}
 subscription_

Detailed Description

ROS2 data logger node.

Subscribes to the ``/sas_datalogger/log`` topic and stores received values
in an internal dictionary keyed by the message ``name`` field. The stored
data can be persisted to disk with :meth:`save` or automatically when the
instance exits a ``with`` block.

Constructor & Destructor Documentation

◆ __init__()

sas_datalogger.sas_datalogger.SASDatalogger.__init__ ( self,
str node_name )
Create and initialize the SAS data logger node.

Args:
    node_name: Name to use when creating the underlying rclpy.Node.

Member Function Documentation

◆ log_callback()

sas_datalogger.sas_datalogger.SASDatalogger.log_callback ( self,
LogDatum msg )
Callback invoked for incoming :class:`sas_msgs.msg.LogDatum` messages.

◆ save()

sas_datalogger.sas_datalogger.SASDatalogger.save ( self,
str filename )
Persist collected data to a MATLAB ``.mat`` file.

Args:
    filename: Path to the output ``.mat`` file.

Member Data Documentation

◆ subscription_

sas_datalogger.sas_datalogger.SASDatalogger.subscription_
Initial value:
= self.create_subscription(
LogDatum,
"/sas_datalogger/log",
self.log_callback,
100)

The documentation for this class was generated from the following file:
  • src/sas_datalogger/sas_datalogger/sas_datalogger.py