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 
30 #include <RobotAPI/interface/core/RobotState.h>
31 #include <RobotAPI/interface/units/LocalizationUnitInterface.h>
33 
34 #include "RobotUnitSubUnit.h"
35 
36 namespace armarx
37 {
38 
40  virtual public LocalizationUnitInterface,
41  virtual public SensorActorUnit
42  {
43  public:
44  // inherited from Component
45  std::string
46  getDefaultName() const override
47  {
48  return "LocalizationUnit";
49  }
50 
51  void
52  onInitComponent() override
53  {
54  }
55 
56  void
57  onConnectComponent() override
58  {
59  }
60  };
61 
62 
63  class GlobalRobotPoseCorrectionSensorDevice;
64 
65  TYPEDEF_PTRS_HANDLE(LocalizationSubUnit);
66 
68  virtual public RobotUnitSubUnit,
69  virtual public LocalizationUnit,
70  virtual public LocalizationSubUnitInterface
71  {
72  public:
73  LocalizationSubUnit() = default;
74  ~LocalizationSubUnit() override;
75 
76  void update(const SensorAndControl& sc, const JointAndNJointControllers& c) override;
77 
78  void reportGlobalRobotPoseCorrection(const TransformStamped& global_T_odom,
79  const Ice::Current& = Ice::emptyCurrent) override;
80 
81  /**
82  * This device partially holds the information about the robot's global pose.
83  * It is the transformation from the `global` to the `odometry` frame which can be
84  * obtained by SLAM. In conjunction with the relative pose (pose within the `odometry` frame),
85  * the global pose can be obtained.
86  */
88 
89  private:
90  std::string agentName;
91  std::string robotRootFrame;
92  };
93 } // namespace armarx
armarx::LocalizationSubUnit::globalPositionCorrectionSensorDevice
GlobalRobotPoseCorrectionSensorDevice * globalPositionCorrectionSensorDevice
This device partially holds the information about the robot's global pose.
Definition: LocalizationSubUnit.h:87
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:46
armarx::RobotUnitSubUnit
Definition: RobotUnitSubUnit.h:35
armarx::LocalizationSubUnit::~LocalizationSubUnit
~LocalizationSubUnit() override
armarx::detail::ControlThreadOutputBufferEntry
Definition: ControlThreadOutputBuffer.h:182
SensorActorUnit.h
RobotUnitSubUnit.h
armarx::LocalizationSubUnit
Definition: LocalizationSubUnit.h:67
armarx::LocalizationUnit
Definition: LocalizationSubUnit.h:39
armarx::GlobalRobotPoseCorrectionSensorDevice
Definition: GlobalRobotPoseSensorDevice.h:56
armarx::LocalizationUnit::onConnectComponent
void onConnectComponent() override
Pure virtual hook for the subclass.
Definition: LocalizationSubUnit.h:57
armarx::SensorActorUnit
Base Class for SensorActorUnits.
Definition: SensorActorUnit.h:43
armarx::LocalizationUnit::onInitComponent
void onInitComponent() override
Pure virtual hook for the subclass.
Definition: LocalizationSubUnit.h:52
armarx::LocalizationUnit::getDefaultName
std::string getDefaultName() const override
Retrieve default name of component.
Definition: LocalizationSubUnit.h:46
armarx::LocalizationSubUnit::update
void update(const SensorAndControl &sc, const JointAndNJointControllers &c) override
Definition: LocalizationSubUnit.cpp:40
armarx::LocalizationSubUnit::reportGlobalRobotPoseCorrection
void reportGlobalRobotPoseCorrection(const TransformStamped &global_T_odom, const Ice::Current &=Ice::emptyCurrent) override
Definition: LocalizationSubUnit.cpp:52
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27