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 
40 
41 namespace armarx
42 {
43  class DebugObserverHelper;
44 }
46 {
48  {
50 
51  public:
52 
54  virtual ~Segment() override;
55 
56  void defineProperties(armarx::PropertyDefinitionsPtr defs, const std::string& prefix = "") override;
57 
58  void init() override;
59 
60  void onConnect(RobotUnitInterfacePrx robotUnitPrx);
61 
62 
64  const armem::Time& timestamp, DebugObserverHelper* debugObserver = nullptr) const;
66  const armem::Time& timestamp, DebugObserverHelper* debugObserver = nullptr) const;
67 
69 
71 
72 
73  private:
74 
75  static
77  readSensorValues(const wm::EntityInstanceData& data);
78 
79 
80  private:
81 
82  RobotUnitInterfacePrx robotUnit;
83  armem::MemoryID robotUnitProviderID;
84 
85  struct Properties
86  {
87  double predictionTimeWindow = 2;
88  };
89  Properties properties;
90 
91  // Debug Observer prefix
92  const std::string dp = "Proprioception::getRobotJointPositions() | ";
93 
94  };
95 
96 } // namespace armarx::armem::server::robot_state::proprioception
armarx::armem::PredictionRequest
Definition: Prediction.h:49
armarx::armem::server::segment::SpecializedCoreSegment
A base class for core segments.
Definition: SpecializedCoreSegment.h:20
armarx::armem::server::robot_state::proprioception::Segment::getSensorValues
SensorValuesMap getSensorValues(const armem::Time &timestamp, DebugObserverHelper *debugObserver=nullptr) const
Definition: Segment.cpp:100
armarx::armem::server::MemoryToIceAdapter
Helps connecting a Memory server to the Ice interface.
Definition: MemoryToIceAdapter.h:19
MemoryID.h
armarx::armem::server::robot_state::proprioception::Segment
Definition: Segment.h:47
Prediction.h
armarx::armem::server::robot_state::proprioception
Definition: forward_declarations.h:78
armarx::armem::server::robot_state::proprioception::Segment::init
void init() override
Definition: Segment.cpp:46
armarx::armem::server::robot_state::proprioception::SensorValues
Definition: SensorValues.h:43
armarx::armem::PredictionResult
Definition: Prediction.h:58
armarx::armem::server::robot_state::proprioception::Segment::predictLinear
armem::PredictionResult predictLinear(const armem::PredictionRequest &request) const
Definition: Segment.cpp:217
forward_declarations.h
armarx::armem::MemoryID
A memory ID.
Definition: MemoryID.h:47
armarx::armem::server::segment::detail::SegmentBase< server::wm::CoreSegment >
data
uint8_t data[1]
Definition: EtherCATFrame.h:68
armarx::armem::server::robot_state::proprioception::Segment::getRobotUnitProviderID
const armem::MemoryID & getRobotUnitProviderID() const
Definition: Segment.cpp:156
armarx::armem::server::robot_state::proprioception::SensorValuesMap
std::unordered_map< std::string, SensorValues > SensorValuesMap
Definition: forward_declarations.h:85
armarx::core::time::DateTime
Represents a point in time.
Definition: DateTime.h:24
armarx::armem::server::segment::detail::SegmentBase< server::wm::CoreSegment >::iceMemory
MemoryToIceAdapter & iceMemory
Definition: SpecializedSegment.h:60
IceUtil::Handle< class PropertyDefinitionContainer >
IceInternal::ProxyHandle<::IceProxy::armarx::RobotUnitInterface >
armarx::armem::server::robot_state::proprioception::Segment::~Segment
virtual ~Segment() override
SpecializedProviderSegment.h
armarx::armem::server::robot_state::proprioception::Segment::onConnect
void onConnect(RobotUnitInterfacePrx robotUnitPrx)
Definition: Segment.cpp:55
armarx::armem::server::robot_state::proprioception::Segment::getSensorValuesLocking
SensorValuesMap getSensorValuesLocking(const armem::Time &timestamp, DebugObserverHelper *debugObserver=nullptr) const
Definition: Segment.cpp:76
armarx::armem::server::robot_state::proprioception::Segment::Segment
Segment(server::MemoryToIceAdapter &iceMemory)
Definition: Segment.cpp:25
armarx::DebugObserverHelper
Brief description of class DebugObserverHelper.
Definition: DebugObserverHelper.h:50
SpecializedCoreSegment.h
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::aron::data::Dict
Definition: Dict.h:44
armarx::armem::server::robot_state::proprioception::Segment::defineProperties
void defineProperties(armarx::PropertyDefinitionsPtr defs, const std::string &prefix="") override
Definition: Segment.cpp:36