sas
Modularised monitoring, logging, and control of robots.
Loading...
Searching...
No Matches
sas_datalogger_client.hpp
1#pragma once
2/*
3# Copyright (c) 2012-2020 Murilo Marques Marinho
4#
5# This file is part of sas_datalogger.
6#
7# sas_datalogger is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Lesser General Public License as published by
9# the Free Software Foundation, either version 3 of the License, or
10# (at your option) any later version.
11#
12# sas_datalogger is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Lesser General Public License for more details.
16#
17# You should have received a copy of the GNU Lesser General Public License
18# along with sas_datalogger. If not, see <https://www.gnu.org/licenses/>.
19#
20# ################################################################
21#
22# Author: Murilo M. Marinho, email: murilomarinho@ieee.org
23#
24# ################################################################*/
25
26#include <rclcpp/rclcpp.hpp>
27
29#include <sas_msgs/msg/log_datum.hpp>
30
31#include <eigen3/Eigen/Dense>
32
33using namespace Eigen;
34
35namespace sas
36{
37
47{
48private:
49 //ros::ServiceClient sc_save;
50 //sas_datalogger::Save sm_save;
51
52 rclcpp::Publisher<sas_msgs::msg::LogDatum>::SharedPtr publisher_log_;
53public:
60 DataloggerClient(const rclcpp::Node::SharedPtr& node, const size_t &queue_size=100);
61
68 bool is_enabled() const;
69
76 void log(const std::string& name, const MatrixXd& value);
77
84 void log(const std::string& name, const VectorXd& value);
85
92 void log(const std::string& name, const std::vector<double>& value);
93
100 void log(const std::string& name, const double& value);
101
108 void log(const std::string& name, const std::string& value);
109
115 void save(const std::string &filename);
116};
117
118}
119
Lightweight client for publishing log data.
Definition sas_datalogger_client.hpp:47
void log(const std::string &name, const VectorXd &value)
Log a vector value under the given name.
void log(const std::string &name, const MatrixXd &value)
Log a matrix value under the given name.
Definition sas_datalogger_client.cpp:41
void save(const std::string &filename)
Request saving the logged data to the specified filename.
bool is_enabled() const
Check if the datalogger is enabled (publisher is valid).
Definition sas_datalogger_client.cpp:36
Definition sas_object.hpp:39
Base object class for identification and license utilities.