Lightweight client for publishing log data.
More...
#include <sas_datalogger_client.hpp>
|
| | DataloggerClient (const rclcpp::Node::SharedPtr &node, const size_t &queue_size=100) |
| | Construct a new DataloggerClient.
|
| |
| bool | is_enabled () const |
| | Check if the datalogger is enabled (publisher is valid).
|
| |
| void | log (const std::string &name, const MatrixXd &value) |
| | Log a matrix value under the given name.
|
| |
| void | log (const std::string &name, const VectorXd &value) |
| | Log a vector value under the given name.
|
| |
| void | log (const std::string &name, const std::vector< double > &value) |
| | Log a std::vector<double> value under the given name.
|
| |
| void | log (const std::string &name, const double &value) |
| | Log a scalar double value under the given name.
|
| |
| void | log (const std::string &name, const std::string &value) |
| | Log a string value under the given name.
|
| |
| void | save (const std::string &filename) |
| | Request saving the logged data to the specified filename.
|
| |
Lightweight client for publishing log data.
DataloggerClient provides helpers to publish various types (matrices, vectors, scalars and strings) as sas_msgs::msg::LogDatum messages. It is intended for runtime logging and can also request saving logged data to a file via the save method.
◆ DataloggerClient()
| sas::DataloggerClient::DataloggerClient |
( |
const rclcpp::Node::SharedPtr & |
node, |
|
|
const size_t & |
queue_size = 100 |
|
) |
| |
Construct a new DataloggerClient.
- Parameters
-
| node | Shared pointer to the ROS2 node used for publishing. |
| queue_size | Publisher queue size (default: 100). |
◆ is_enabled()
| bool sas::DataloggerClient::is_enabled |
( |
| ) |
const |
Check if the datalogger is enabled (publisher is valid).
- Returns
- true when enabled and ready to publish messages.
-
false otherwise.
◆ log() [1/5]
| void sas::DataloggerClient::log |
( |
const std::string & |
name, |
|
|
const double & |
value |
|
) |
| |
Log a scalar double value under the given name.
- Parameters
-
| name | Key/name under which the value will be logged. |
| value | The double value to log. |
◆ log() [2/5]
| void sas::DataloggerClient::log |
( |
const std::string & |
name, |
|
|
const MatrixXd & |
value |
|
) |
| |
Log a matrix value under the given name.
- Parameters
-
| name | Key/name under which the value will be logged. |
| value | The Eigen::MatrixXd value to log. |
◆ log() [3/5]
| void sas::DataloggerClient::log |
( |
const std::string & |
name, |
|
|
const std::string & |
value |
|
) |
| |
Log a string value under the given name.
- Parameters
-
| name | Key/name under which the value will be logged. |
| value | The string value to log. |
◆ log() [4/5]
| void sas::DataloggerClient::log |
( |
const std::string & |
name, |
|
|
const std::vector< double > & |
value |
|
) |
| |
Log a std::vector<double> value under the given name.
- Parameters
-
| name | Key/name under which the value will be logged. |
| value | The std::vector<double> value to log. |
◆ log() [5/5]
| void sas::DataloggerClient::log |
( |
const std::string & |
name, |
|
|
const VectorXd & |
value |
|
) |
| |
Log a vector value under the given name.
- Parameters
-
| name | Key/name under which the value will be logged. |
| value | The Eigen::VectorXd value to log. |
◆ save()
| void sas::DataloggerClient::save |
( |
const std::string & |
filename | ) |
|
Request saving the logged data to the specified filename.
- Parameters
-
| filename | Path to the file where data should be saved. |
The documentation for this class was generated from the following files: