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 
27 #include <Eigen/Dense>
28 #include <map>
29 
30 namespace armarx
31 {
32  class SimpleJsonLoggerEntry;
33  using SimpleJsonLoggerEntryPtr = std::shared_ptr<SimpleJsonLoggerEntry>;
34 
36  {
37  public:
39  void AddAsArr(const std::string& key, const Eigen::Vector3f& vec);
40  void AddAsArr(const std::string& key, const Eigen::VectorXf& vec);
41  void AddAsObj(const std::string& key, const Eigen::Vector3f& vec);
42  void AddAsArr(const std::string& key, const Eigen::Matrix4f& mat);
43  void AddMatrix(const std::string& key, const Eigen::MatrixXf& mat);
44 
45  void Add(const std::string& key, const std::string& value);
46  void Add(const std::string& key, float value);
47  void Add(const std::string& key, const std::vector<float>& value);
48  void Add(const std::string& key, const std::map<std::string, float>& value);
49 
50  static JsonArrayPtr ToArr(const Eigen::VectorXf& vec);
51  static JsonArrayPtr ToArr(const std::vector<float>& vec);
52  static JsonObjectPtr ToObj(Eigen::Vector3f vec);
53  static JsonObjectPtr ToObj(const std::map<std::string, float>& value);
55  static JsonArrayPtr MatrixToArr(Eigen::MatrixXf mat);
56 
57  void AddTimestamp();
58 
60  };
61 }
62 
armarx::SimpleJsonLoggerEntry::AddAsArr
void AddAsArr(const std::string &key, const Eigen::Vector3f &vec)
Definition: SimpleJsonLoggerEntry.cpp:34
armarx::SimpleJsonLoggerEntry::ToArr
static JsonArrayPtr ToArr(const Eigen::VectorXf &vec)
Definition: SimpleJsonLoggerEntry.cpp:80
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:54
JsonObject.h
armarx::SimpleJsonLoggerEntry::SimpleJsonLoggerEntry
SimpleJsonLoggerEntry()
Definition: SimpleJsonLoggerEntry.cpp:29
cxxopts::value
std::shared_ptr< Value > value()
Definition: cxxopts.hpp:926
armarx::SimpleJsonLoggerEntry::obj
JsonObjectPtr obj
Definition: SimpleJsonLoggerEntry.h:59
armarx::SimpleJsonLoggerEntry::AddAsObj
void AddAsObj(const std::string &key, const Eigen::Vector3f &vec)
Definition: SimpleJsonLoggerEntry.cpp:44
armarx::SimpleJsonLoggerEntry::Add
void Add(const std::string &key, const std::string &value)
Definition: SimpleJsonLoggerEntry.cpp:59
armarx::SimpleJsonLoggerEntry::MatrixToArr
static JsonArrayPtr MatrixToArr(Eigen::MatrixXf mat)
Definition: SimpleJsonLoggerEntry.cpp:155
GfxTL::Matrix4f
MatrixXX< 4, 4, float > Matrix4f
Definition: MatrixXX.h:601
armarx::SimpleJsonLoggerEntry::ToObj
static JsonObjectPtr ToObj(Eigen::Vector3f vec)
Definition: SimpleJsonLoggerEntry.cpp:100
armarx::SimpleJsonLoggerEntryPtr
std::shared_ptr< SimpleJsonLoggerEntry > SimpleJsonLoggerEntryPtr
Definition: SimpleJsonLoggerEntry.h:33
armarx::SimpleJsonLoggerEntry
Definition: SimpleJsonLoggerEntry.h:35
armarx::SimpleJsonLoggerEntry::AddTimestamp
void AddTimestamp()
Definition: SimpleJsonLoggerEntry.cpp:170
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::JsonObjectPtr
std::shared_ptr< JsonObject > JsonObjectPtr
Definition: JsonObject.h:34