sas
Modularised monitoring, logging, and control of robots.
Toggle main menu visibility
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
28
#include <
sas_core/sas_object.hpp
>
29
#include <sas_msgs/msg/log_datum.hpp>
30
31
#include <eigen3/Eigen/Dense>
32
33
using namespace
Eigen;
34
35
namespace
sas
36
{
37
46
class
DataloggerClient
:
private
sas::Object
47
{
48
private
:
49
//ros::ServiceClient sc_save;
50
//sas_datalogger::Save sm_save;
51
52
rclcpp::Publisher<sas_msgs::msg::LogDatum>::SharedPtr publisher_log_;
53
public
:
60
DataloggerClient
(
const
rclcpp::Node::SharedPtr& node,
const
size_t
&queue_size=100);
61
68
bool
is_enabled
(
int
server_count=1)
const
;
69
76
void
log
(
const
std::string& name,
const
Eigen::Ref<const MatrixXd>& value);
77
84
void
log
(
const
std::string& name,
const
std::vector<double>& value);
85
92
void
log
(
const
std::string& name,
const
double
& value);
93
100
void
log
(
const
std::string& name,
const
std::string& value);
101
107
void
save
(
const
std::string &filename);
108
};
109
110
}
111
sas::DataloggerClient::is_enabled
bool is_enabled(int server_count=1) const
Check if the datalogger is enabled (publisher is valid).
Definition
sas_datalogger_client.cpp:36
sas::DataloggerClient::log
void log(const std::string &name, const Eigen::Ref< const MatrixXd > &value)
Log a matrix (MatrixXd) or vector (VectorXd) value under the given name.
Definition
sas_datalogger_client.cpp:41
sas::DataloggerClient::save
void save(const std::string &filename)
Request saving the logged data to the specified filename.
sas::DataloggerClient::DataloggerClient
DataloggerClient(const rclcpp::Node::SharedPtr &node, const size_t &queue_size=100)
Construct a new DataloggerClient.
Definition
sas_datalogger_client.cpp:30
sas::Object
Base class for SAS objects.
Definition
sas_object.hpp:40
sas_object.hpp
Base object class for identification and license utilities.
src
sas_datalogger
include
sas_datalogger
sas_datalogger_client.hpp
Generated by
1.17.0