RobotPoseUnit.h
Go to the documentation of this file.
1/*
2 * This file is part of ArmarX.
3 *
4 * Copyright (C) 2012-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5 *
6 * ArmarX is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ArmarX is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 *
18 * @package ArmarXCore::units
19 * @author Nikolaus Vahrenkamp (vahrenkamp at kit dot edu)
20 * @date 2016
21 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22 * GNU General Public License
23 */
24
25#pragma once
26
27#include <vector>
28
31
33#include <RobotAPI/interface/units/RobotPoseUnitInterface.h>
34
35namespace armarx
36{
37 /**
38 * \class RobotPoseUnitPropertyDefinitions
39 * \brief Defines all necessary properties for armarx::RobotPoseUnit
40 */
42 {
43 public:
45 {
47 "RobotName",
48 "Robot",
49 "Name of the Robot (will publish values on RobotName + '6DPoseState')");
50 }
51 };
52
53 /**
54 * \defgroup Component-RobotPoseUnit RobotPoseUnit
55 * \ingroup RobotAPI-SensorActorUnits
56 * \brief Base unit for high-level access to robot poses.
57 *
58 * This class defines an interface for providing high level access to the robot's pose in the world.
59 * This unit usually does not exiust on a real robot (instead, use the @see PlatformUnit for moving a platform based robot around).
60 * In simulated worlds, this unit allows to position the robot globally in the envirnoment (@see RobotPoseUnitDynamicSimulation).
61 * It uses the RobotPoseUnitListener Ice interface to report updates of its current state.
62 */
63
64 /**
65 * @ingroup Component-RobotPoseUnit
66 * @brief The RobotPoseUnit class
67 */
68 class RobotPoseUnit : virtual public RobotPoseUnitInterface, virtual public SensorActorUnit
69 {
70 public:
71 // inherited from Component
72 std::string
73 getDefaultName() const override
74 {
75 return "RobotPoseUnit";
76 }
77
78 /**
79 * Retrieve proxy for publishing State information and call
80 * armarx::RobotPoseUnit::onInitRobotPoseUnit().
81 * \see armarx::Component::onInitComponent()
82 */
83 void onInitComponent() override;
84 /**
85 * Calls armarx::RobotPoseUnit::onStartRobotPoseUnit().
86 * \see armarx::Component::onConnectComponent()
87 */
88 void onConnectComponent() override;
89
90 void onDisconnectComponent() override;
91 /**
92 * Calls armarx::RobotPoseUnit::onExitRobotPoseUnit().
93 * \see armarx::Component::onExitComponent()
94 */
95 void onExitComponent() override;
96
97 virtual void onInitRobotPoseUnit() = 0;
98 virtual void onStartRobotPoseUnit() = 0;
99
100 virtual void
102 {
103 }
104
105 virtual void onExitRobotPoseUnit() = 0;
106
107 /**
108 * moveTo moves the robot to a global pose specified by:
109 * @param targetPose Global target pose
110 * @param postionalAccuracy Robot stops translating if distance to target position gets lower than this threshhold.
111 * @param orientationalAccuracy Robot stops rotating if distance from current to target orientation gets lower than this threshhold.
112 **/
113 virtual void moveTo(PoseBasePtr targetPose,
114 Ice::Float positionalAccuracy,
115 Ice::Float orientationalAccuracy,
116 const Ice::Current& c = Ice::emptyCurrent);
117
118 void
119 stopMovement(const Ice::Current& c = Ice::emptyCurrent) override
120 {
121 }
122
123 /**
124 * \see armarx::PropertyUser::createPropertyDefinitions()
125 */
127
128 protected:
129 /**
130 * RobotPoseUnitListener proxy for publishing state updates
131 */
132 RobotPoseUnitListenerPrx listenerPrx;
133 /**
134 * Ice Topic name on which armarx::RobotPoseUnit::listenerPrx publishes information
135 */
137 };
138} // namespace armarx
constexpr T c
ComponentPropertyDefinitions(std::string prefix, bool hasObjectNameParameter=true)
Definition Component.cpp:46
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
PropertyDefinition< PropertyType > & defineOptionalProperty(const std::string &name, PropertyType defaultValue, const std::string &description="", PropertyDefinitionBase::PropertyConstness constness=PropertyDefinitionBase::eConstant)
RobotPoseUnitPropertyDefinitions(std::string prefix)
The RobotPoseUnit class.
void onInitComponent() override
Retrieve proxy for publishing State information and call armarx::RobotPoseUnit::onInitRobotPoseUnit()...
virtual void moveTo(PoseBasePtr targetPose, Ice::Float positionalAccuracy, Ice::Float orientationalAccuracy, const Ice::Current &c=Ice::emptyCurrent)
moveTo moves the robot to a global pose specified by:
void stopMovement(const Ice::Current &c=Ice::emptyCurrent) override
virtual void onInitRobotPoseUnit()=0
void onDisconnectComponent() override
Hook for subclass.
virtual void onStopRobotPoseUnit()
RobotPoseUnitListenerPrx listenerPrx
RobotPoseUnitListener proxy for publishing state updates.
virtual void onStartRobotPoseUnit()=0
void onConnectComponent() override
Calls armarx::RobotPoseUnit::onStartRobotPoseUnit().
PropertyDefinitionsPtr createPropertyDefinitions() override
std::string listenerChannelName
Ice Topic name on which armarx::RobotPoseUnit::listenerPrx publishes information.
virtual void onExitRobotPoseUnit()=0
void onExitComponent() override
Calls armarx::RobotPoseUnit::onExitRobotPoseUnit().
std::string getDefaultName() const override
Retrieve default name of component.
SensorActorUnit()
Constructs a SensorActorUnit.
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.