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 
32 namespace armarx
33 {
34  class SimpleJsonLoggerEntry;
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);
57  static JsonArrayPtr MatrixToArr(Eigen::MatrixXf mat);
58 
59  void AddTimestamp();
60 
62  };
63 } // namespace armarx
armarx::SimpleJsonLoggerEntry::AddAsArr
void AddAsArr(const std::string &key, const Eigen::Vector3f &vec)
Definition: SimpleJsonLoggerEntry.cpp:35
GfxTL::Matrix4f
MatrixXX< 4, 4, float > Matrix4f
Definition: MatrixXX.h:650
armarx::SimpleJsonLoggerEntry::ToArr
static JsonArrayPtr ToArr(const Eigen::VectorXf &vec)
Definition: SimpleJsonLoggerEntry.cpp:89
armarx::JsonArrayPtr
std::shared_ptr< JsonArray > JsonArrayPtr
Definition: JsonArray.h:32
armarx::SimpleJsonLoggerEntry::AddMatrix
void AddMatrix(const std::string &key, const Eigen::MatrixXf &mat)
Definition: SimpleJsonLoggerEntry.cpp:59
JsonObject.h
armarx::SimpleJsonLoggerEntry::SimpleJsonLoggerEntry
SimpleJsonLoggerEntry()
Definition: SimpleJsonLoggerEntry.cpp:30
cxxopts::value
std::shared_ptr< Value > value()
Definition: cxxopts.hpp:855
armarx::SimpleJsonLoggerEntry::obj
JsonObjectPtr obj
Definition: SimpleJsonLoggerEntry.h:61
armarx::SimpleJsonLoggerEntry::AddAsObj
void AddAsObj(const std::string &key, const Eigen::Vector3f &vec)
Definition: SimpleJsonLoggerEntry.cpp:47
armarx::SimpleJsonLoggerEntry::Add
void Add(const std::string &key, const std::string &value)
Definition: SimpleJsonLoggerEntry.cpp:65
armarx::SimpleJsonLoggerEntry::MatrixToArr
static JsonArrayPtr MatrixToArr(Eigen::MatrixXf mat)
Definition: SimpleJsonLoggerEntry.cpp:169
armarx::SimpleJsonLoggerEntry::ToObj
static JsonObjectPtr ToObj(Eigen::Vector3f vec)
Definition: SimpleJsonLoggerEntry.cpp:111
armarx::SimpleJsonLoggerEntryPtr
std::shared_ptr< SimpleJsonLoggerEntry > SimpleJsonLoggerEntryPtr
Definition: SimpleJsonLoggerEntry.h:35
armarx::SimpleJsonLoggerEntry
Definition: SimpleJsonLoggerEntry.h:37
armarx::SimpleJsonLoggerEntry::AddTimestamp
void AddTimestamp()
Definition: SimpleJsonLoggerEntry.cpp:185
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
armarx::JsonObjectPtr
std::shared_ptr< JsonObject > JsonObjectPtr
Definition: JsonObject.h:34