LocalizationSubUnit.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::GlobalPoseSubUnit
17  * @author Raphael ( raphael dot grimm at kit dot edu )
18  * @date 2017
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #pragma once
24 
25 #include <mutex>
26 
27 #include <Eigen/Core>
28 
29 #include <VirtualRobot/MathTools.h>
30 
32 #include <RobotAPI/interface/core/RobotState.h>
33 #include <RobotAPI/interface/units/LocalizationUnitInterface.h>
35 
36 #include "RobotUnitSubUnit.h"
37 
38 namespace armarx
39 {
40 
42  virtual public LocalizationUnitInterface,
43  virtual public SensorActorUnit
44  {
45  public:
46  // inherited from Component
47  std::string
48  getDefaultName() const override
49  {
50  return "LocalizationUnit";
51  }
52 
53  void
54  onInitComponent() override
55  {
56  }
57 
58  void
59  onConnectComponent() override
60  {
61  }
62  };
63 
64 
65  class GlobalRobotPoseCorrectionSensorDevice;
66 
67  TYPEDEF_PTRS_HANDLE(LocalizationSubUnit);
68 
70  virtual public RobotUnitSubUnit,
71  virtual public LocalizationUnit,
72  virtual public LocalizationSubUnitInterface
73  {
74  public:
75  LocalizationSubUnit() = default;
76  ~LocalizationSubUnit() override;
77 
78  void update(const SensorAndControl& sc, const JointAndNJointControllers& c) override;
79 
80  void reportGlobalRobotPoseCorrection(const TransformStamped& global_T_odom,
81  const Ice::Current& = Ice::emptyCurrent) override;
82 
83  /**
84  * This device partially holds the information about the robot's global pose.
85  * It is the transformation from the `global` to the `odometry` frame which can be
86  * obtained by SLAM. In conjunction with the relative pose (pose within the `odometry` frame),
87  * the global pose can be obtained.
88  */
90 
91  private:
92  std::string agentName;
93  std::string robotRootFrame;
94  };
95 } // namespace armarx
armarx::LocalizationSubUnit::globalPositionCorrectionSensorDevice
GlobalRobotPoseCorrectionSensorDevice * globalPositionCorrectionSensorDevice
This device partially holds the information about the robot's global pose.
Definition: LocalizationSubUnit.h:89
armarx::JointAndNJointControllers
Structure used by the RobotUnit to swap lists of Joint and NJoint controllers.
Definition: JointAndNJointControllers.h:32
armarx::TYPEDEF_PTRS_HANDLE
TYPEDEF_PTRS_HANDLE(NJointCartesianNaturalPositionController)
Pose.h
armarx::LocalizationSubUnit::LocalizationSubUnit
LocalizationSubUnit()=default
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43
armarx::RobotUnitSubUnit
Definition: RobotUnitSubUnit.h:35
armarx::LocalizationSubUnit::~LocalizationSubUnit
~LocalizationSubUnit() override
armarx::detail::ControlThreadOutputBufferEntry
Definition: ControlThreadOutputBuffer.h:177
SensorActorUnit.h
RobotUnitSubUnit.h
armarx::LocalizationSubUnit
Definition: LocalizationSubUnit.h:69
armarx::LocalizationUnit
Definition: LocalizationSubUnit.h:41
armarx::GlobalRobotPoseCorrectionSensorDevice
Definition: GlobalRobotPoseSensorDevice.h:56
armarx::LocalizationUnit::onConnectComponent
void onConnectComponent() override
Pure virtual hook for the subclass.
Definition: LocalizationSubUnit.h:59
armarx::SensorActorUnit
Base Class for SensorActorUnits.
Definition: SensorActorUnit.h:42
armarx::LocalizationUnit::onInitComponent
void onInitComponent() override
Pure virtual hook for the subclass.
Definition: LocalizationSubUnit.h:54
armarx::LocalizationUnit::getDefaultName
std::string getDefaultName() const override
Retrieve default name of component.
Definition: LocalizationSubUnit.h:48
armarx::LocalizationSubUnit::update
void update(const SensorAndControl &sc, const JointAndNJointControllers &c) override
Definition: LocalizationSubUnit.cpp:39
armarx::LocalizationSubUnit::reportGlobalRobotPoseCorrection
void reportGlobalRobotPoseCorrection(const TransformStamped &global_T_odom, const Ice::Current &=Ice::emptyCurrent) override
Definition: LocalizationSubUnit.cpp:51
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28