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
34
namespace
sas
35
{
36
45
class
DataloggerClient
:
private
sas::Object
46
{
47
private
:
48
//ros::ServiceClient sc_save;
49
//sas_datalogger::Save sm_save;
50
51
rclcpp::Publisher<sas_msgs::msg::LogDatum>::SharedPtr publisher_log_;
52
public
:
59
DataloggerClient
(
const
rclcpp::Node::SharedPtr& node,
const
size_t
&queue_size=100);
60
67
bool
is_enabled
(
int
server_count=1)
const
;
68
75
void
log
(
const
std::string& name,
const
Eigen::Ref<const Eigen::MatrixXd>& value);
76
83
void
log
(
const
std::string& name,
const
std::vector<double>& value);
84
91
void
log
(
const
std::string& name,
const
double
& value);
92
99
void
log
(
const
std::string& name,
const
std::string& value);
100
106
void
save
(
const
std::string &filename);
107
};
108
109
}
110
marinholab::sas::core::Object
Base class for SAS objects.
Definition
sas_object.hpp:40
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::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::DataloggerClient::log
void log(const std::string &name, const Eigen::Ref< const Eigen::MatrixXd > &value)
Log a matrix (Eigen::MatrixXd) or vector (Eigen::VectorXd) value under the given name.
Definition
sas_datalogger_client.cpp:41
src
sas_datalogger
include
sas_datalogger
sas_datalogger_client.hpp
Generated by
1.17.0