Segment.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 * @author Fabian Reister ( fabian dot reister at kit dot edu )
17 * @author Rainer Kartmann ( rainer dot kartmann at kit dot edu )
18 * @date 2021
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22
23#pragma once
24
25// STD / STL
26#include <map>
27#include <optional>
28#include <string>
29
30// ArmarX
31#include <RobotAPI/interface/units/RobotUnit/RobotUnitInterface.h>
32
33// RobotAPI
39
40namespace armarx
41{
43}
44
46{
48 {
50
51 public:
53 virtual ~Segment() override;
54
56 const std::string& prefix = "") override;
57
58 void init() override;
59
60 void onConnect(RobotUnitInterfacePrx robotUnitPrx);
61
62
64 DebugObserverHelper* debugObserver = nullptr) const;
66 DebugObserverHelper* debugObserver = nullptr) const;
67
69
71
72
73 private:
74 static SensorValues readSensorValues(const wm::EntityInstanceData& data);
75
76
77 private:
78 RobotUnitInterfacePrx robotUnit;
79 armem::MemoryID robotUnitProviderID;
80
81 struct Properties
82 {
83 double predictionTimeWindow = 2;
84 };
85
86 Properties properties;
87
88 // Debug Observer prefix
89 const std::string dp = "Proprioception::getRobotJointPositions() | ";
90 };
91
92} // namespace armarx::armem::server::robot_state::proprioception
std::string timestamp()
Brief description of class DebugObserverHelper.
Helps connecting a Memory server to the Ice interface.
void defineProperties(armarx::PropertyDefinitionsPtr defs, const std::string &prefix="") override
Definition Segment.cpp:35
void onConnect(RobotUnitInterfacePrx robotUnitPrx)
Definition Segment.cpp:56
SensorValuesMap getSensorValues(const armem::Time &timestamp, DebugObserverHelper *debugObserver=nullptr) const
Definition Segment.cpp:96
SensorValuesMap getSensorValuesLocking(const armem::Time &timestamp, DebugObserverHelper *debugObserver=nullptr) const
Definition Segment.cpp:78
Segment(server::MemoryToIceAdapter &iceMemory)
Definition Segment.cpp:24
armem::PredictionResult predictLinear(const armem::PredictionRequest &request) const
Definition Segment.cpp:219
std::unordered_map< std::string, SensorValues > SensorValuesMap
armarx::aron::data::Dict EntityInstanceData
armarx::core::time::DateTime Time
This file offers overloads of toIce() and fromIce() functions for STL container types.
::IceInternal::ProxyHandle<::IceProxy::armarx::RobotUnitInterface > RobotUnitInterfacePrx
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.