PlatformSubUnit.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::PlatformSubUnit
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
33#include <RobotAPI/interface/core/RobotState.h>
35
37#include "RobotUnitSubUnit.h"
38
39namespace armarx
40{
42
44
46 virtual public RobotUnitSubUnit,
47 virtual public PlatformUnit,
48 virtual public PlatformSubUnitInterface
49 {
50 public:
51 void update(const SensorAndControl& sc, const JointAndNJointControllers& c) override;
52
53 // PlatformUnitInterface interface
54 void move(Ice::Float vx,
55 Ice::Float vy,
56 Ice::Float vr,
57 const Ice::Current& = Ice::emptyCurrent) override;
58 void moveTo(Ice::Float rx,
59 Ice::Float ry,
60 Ice::Float rr,
61 Ice::Float lac,
62 Ice::Float rac,
63 const Ice::Current& = Ice::emptyCurrent) override;
64 void moveRelative(Ice::Float rx,
65 Ice::Float ry,
66 Ice::Float rr,
67 Ice::Float lac,
68 Ice::Float rac,
69 const Ice::Current& = Ice::emptyCurrent) override;
70 void setMaxVelocities(Ice::Float mxVLin,
71 Ice::Float mxVAng,
72 const Ice::Current& = Ice::emptyCurrent) override;
73
74 // PlatformUnit interface
75 void
77 {
78 }
79
80 void
82 {
83 agentName = robotStateComponent->getRobotName();
84 robotRootFrame = robotStateComponent->getSynchronizedRobot()->getRootNode()->getName();
85 }
86
87 void
89 {
90 }
91
92 void stopPlatform(const Ice::Current& c = Ice::emptyCurrent) override;
93
94 NJointHolonomicPlatformVelocityControllerInterfacePtr pt;
95 NJointHolonomicPlatformRelativePositionControllerPtr relativePosCtrl;
96 NJointHolonomicPlatformGlobalPositionControllerPtr globalPosCtrl;
97
99
100 protected:
101 mutable std::mutex dataMutex;
102
103 Ice::Float maxVLin = std::numeric_limits<Ice::Float>::infinity();
104 Ice::Float maxVAng = std::numeric_limits<Ice::Float>::infinity();
105
106
107 private:
108 std::string agentName;
109 std::string robotRootFrame;
110 };
111} // namespace armarx
#define TYPEDEF_PTRS_HANDLE(T)
constexpr T c
void onInitPlatformUnit() override
void update(const SensorAndControl &sc, const JointAndNJointControllers &c) override
NJointHolonomicPlatformGlobalPositionControllerPtr globalPosCtrl
void onStartPlatformUnit() override
NJointHolonomicPlatformRelativePositionControllerPtr relativePosCtrl
void moveRelative(Ice::Float rx, Ice::Float ry, Ice::Float rr, Ice::Float lac, Ice::Float rac, const Ice::Current &=Ice::emptyCurrent) override
void onExitPlatformUnit() override
NJointHolonomicPlatformVelocityControllerInterfacePtr pt
void setMaxVelocities(Ice::Float mxVLin, Ice::Float mxVAng, const Ice::Current &=Ice::emptyCurrent) override
void move(Ice::Float vx, Ice::Float vy, Ice::Float vr, const Ice::Current &=Ice::emptyCurrent) override
void stopPlatform(const Ice::Current &c=Ice::emptyCurrent) override
void moveTo(Ice::Float rx, Ice::Float ry, Ice::Float rr, Ice::Float lac, Ice::Float rac, const Ice::Current &=Ice::emptyCurrent) override
The PlatformUnit class.
RobotStateComponentInterfacePrx robotStateComponent
This file offers overloads of toIce() and fromIce() functions for STL container types.
detail::ControlThreadOutputBufferEntry SensorAndControl
Structure used by the RobotUnit to swap lists of Joint and NJoint controllers.