SimpleJsonLoggerEntry.h
Go to the documentation of this file.
1/*
2 * This file is part of ArmarX.
3 *
4 * Copyright (C) 2012-2016, High Performance Humanoid Technologies (H2T),
5 * Karlsruhe Institute of Technology (KIT), all rights reserved.
6 *
7 * ArmarX is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * ArmarX is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 *
19 * @author Simon Ottenhaus (simon dot ottenhaus at kit dot edu)
20 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
21 * GNU General Public License
22 */
23
24#pragma once
25
26#include <map>
27
28#include <Eigen/Dense>
29
31
32namespace armarx
33{
35 using SimpleJsonLoggerEntryPtr = std::shared_ptr<SimpleJsonLoggerEntry>;
36
38 {
39 public:
41 void AddAsArr(const std::string& key, const Eigen::Vector3f& vec);
42 void AddAsArr(const std::string& key, const Eigen::VectorXf& vec);
43 void AddAsObj(const std::string& key, const Eigen::Vector3f& vec);
44 void AddAsArr(const std::string& key, const Eigen::Matrix4f& mat);
45 void AddMatrix(const std::string& key, const Eigen::MatrixXf& mat);
46
47 void Add(const std::string& key, const std::string& value);
48 void Add(const std::string& key, float value);
49 void Add(const std::string& key, const std::vector<float>& value);
50 void Add(const std::string& key, const std::map<std::string, float>& value);
51
52 static JsonArrayPtr ToArr(const Eigen::VectorXf& vec);
53 static JsonArrayPtr ToArr(const std::vector<float>& vec);
54 static JsonObjectPtr ToObj(Eigen::Vector3f vec);
55 static JsonObjectPtr ToObj(const std::map<std::string, float>& value);
56 static JsonArrayPtr ToArr(Eigen::Matrix4f mat);
57 static JsonArrayPtr MatrixToArr(Eigen::MatrixXf mat);
58
59 void AddTimestamp();
60
62 };
63} // namespace armarx
void AddAsObj(const std::string &key, const Eigen::Vector3f &vec)
static JsonArrayPtr MatrixToArr(Eigen::MatrixXf mat)
static JsonArrayPtr ToArr(const Eigen::VectorXf &vec)
void AddMatrix(const std::string &key, const Eigen::MatrixXf &mat)
void Add(const std::string &key, const std::string &value)
static JsonObjectPtr ToObj(Eigen::Vector3f vec)
void AddAsArr(const std::string &key, const Eigen::Vector3f &vec)
This file offers overloads of toIce() and fromIce() functions for STL container types.
std::shared_ptr< JsonObject > JsonObjectPtr
Definition JsonObject.h:34
std::shared_ptr< JsonArray > JsonArrayPtr
Definition JsonArray.h:32
std::shared_ptr< SimpleJsonLoggerEntry > SimpleJsonLoggerEntryPtr