RobotStatePredictionClient.h
Go to the documentation of this file.
1/*
2 * This file is part of ArmarX.
3 *
4 * ArmarX is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * ArmarX is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * @package RobotAPI::ArmarXObjects::RobotStatePredictionClientExample
17 * @author Rainer Kartmann ( rainer dot kartmann at kit dot edu )
18 * @date 2022
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22
23
24#pragma once
25
26#include <optional>
27#include <vector>
28
29#include <Eigen/Geometry>
30
34
36{
37
39 {
40 public:
42
44 {
45 std::optional<Eigen::Affine3f> globalPose;
46 std::optional<std::map<std::string, float>> jointPositions;
47 };
48
50 predictWholeBody(const std::vector<armem::MemoryID>& localizationEntityIDs,
51 const std::vector<armem::MemoryID>& proprioceptionEntityIDs,
52 armem::Time predictedTime,
53 const std::string& robotName,
54 const std::string& engineID = "Linear");
55
56 std::optional<Eigen::Affine3f>
57 predictGlobalPose(const std::vector<armem::MemoryID>& entityIDs,
58 armem::Time predictedTime,
59 const std::string& engineID = "Linear");
60
61 std::optional<std::map<std::string, float>>
62 predictJointPositions(const std::vector<armem::MemoryID>& entityIDs,
63 armem::Time predictedTime,
64 const std::string& robotName,
65 const std::string& engineID = "Linear");
66
67
68 std::vector<armem::PredictionResult> predict(const std::vector<armem::MemoryID>& entityIDs,
69 armem::Time predictedTime,
70 const std::string& engineID = "Linear");
71 std::vector<armem::PredictionResult>
72 predict(const std::vector<armem::PredictionRequest>& requests);
73
74
75 std::vector<armem::MemoryID> queryLocalizationEntityIDs();
76 std::vector<armem::MemoryID> queryProprioceptionEntityIDs();
77
78 std::vector<armem::PredictionRequest>
79 makePredictionRequests(const std::vector<armem::MemoryID>& entityIDs,
80 armem::Time predictedTime,
81 const std::string& engineID = "Linear");
82
83 std::optional<Eigen::Affine3f>
84 lookupGlobalPose(const std::vector<armem::PredictionResult>& localizationPredictionResults,
85 const std::vector<armem::MemoryID>& localizationEntityIDs,
86 armem::Time predictedTime);
87
88 std::optional<std::map<std::string, float>> lookupJointPositions(
89 const std::vector<armem::PredictionResult>& proprioceptionPredictionResults,
90 const std::string& robotName);
91
92
93 private:
94 std::vector<armem::MemoryID> _queryEntityIDs(const std::string& coreSegmentName);
95
96 public:
97 struct Remote
98 {
100 std::optional<armem::robot_state::VirtualRobotReader> robotReader;
101 };
102
104 };
105
106} // namespace armarx::armem::robot_state
Reads data from a memory server.
Definition Reader.h:25
std::optional< Eigen::Affine3f > predictGlobalPose(const std::vector< armem::MemoryID > &entityIDs, armem::Time predictedTime, const std::string &engineID="Linear")
std::optional< std::map< std::string, float > > predictJointPositions(const std::vector< armem::MemoryID > &entityIDs, armem::Time predictedTime, const std::string &robotName, const std::string &engineID="Linear")
std::vector< armem::PredictionResult > predict(const std::vector< armem::MemoryID > &entityIDs, armem::Time predictedTime, const std::string &engineID="Linear")
std::optional< std::map< std::string, float > > lookupJointPositions(const std::vector< armem::PredictionResult > &proprioceptionPredictionResults, const std::string &robotName)
std::vector< armem::PredictionRequest > makePredictionRequests(const std::vector< armem::MemoryID > &entityIDs, armem::Time predictedTime, const std::string &engineID="Linear")
std::optional< Eigen::Affine3f > lookupGlobalPose(const std::vector< armem::PredictionResult > &localizationPredictionResults, const std::vector< armem::MemoryID > &localizationEntityIDs, armem::Time predictedTime)
WholeBodyPrediction predictWholeBody(const std::vector< armem::MemoryID > &localizationEntityIDs, const std::vector< armem::MemoryID > &proprioceptionEntityIDs, armem::Time predictedTime, const std::string &robotName, const std::string &engineID="Linear")
armarx::core::time::DateTime Time
std::optional< armem::robot_state::VirtualRobotReader > robotReader