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 (int server_count=1) const |
| | Check if the datalogger is enabled (publisher is valid).
|
| void | log (const std::string &name, const Eigen::Ref< const MatrixXd > &value) |
| | Log a matrix (MatrixXd) or vector (VectorXd) 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.
|
Client for publishing log data.
DataloggerClient provides methods 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 |
( |
int | server_count = 1 | ) |
const |
Check if the datalogger is enabled (publisher is valid).
- Returns
- true when enabled and ready to publish messages.
-
false otherwise.
◆ log() [1/4]
| 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/4]
| void sas::DataloggerClient::log |
( |
const std::string & | name, |
|
|
const Eigen::Ref< const MatrixXd > & | value ) |
Log a matrix (MatrixXd) or vector (VectorXd) value under the given name.
- Parameters
-
| name | Key/name under which the value will be logged. |
| value | the Eigen::Ref<const MatrixXd> value to log. |
◆ log() [3/4]
| 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/4]
| 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. |
◆ 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: