NJointHolonomicPlatformRelativePositionController.h
Go to the documentation of this file.
1/*
2 * This file is part of ArmarX.
3 *
4 * Copyright (C) 2011-2017, 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 ArmarX
19 * @author Mirko Waechter( mirko.waechter at kit dot edu)
20 * @date 2017
21 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22 * GNU General Public License
23 */
24#pragma once
25
26
27#include <atomic>
28
29#include <VirtualRobot/VirtualRobot.h>
30
32
36
40
41namespace armarx
42{
43
45
47 virtual public NJointControllerConfig
48 {
49 public:
50 std::string platformName;
51 float p = 1.0f;
52 float i = 0.0f;
53 float d = 0.0f;
54 float maxVelocity = 300;
55 float maxAcceleration = 500;
58 // float rad2MMFactor = 50.0f;
59 };
60
62 {
63 Eigen::Vector2f target{0, 0}; // x,y
65 float translationAccuracy = 0.0f;
66 float rotationAccuracy = 0.0f;
67 bool newTargetSet = false;
68 };
69
71
72 /**
73 * @brief The NJointHolonomicPlatformRelativePositionController class
74 * @ingroup Library-RobotUnit-NJointControllers
75 */
78 NJointHolonomicPlatformRelativePositionControllerTarget>
79 {
80 public:
81 using ConfigPtrT = NJointHolonomicPlatformRelativePositionControllerConfigPtr;
82
84 RobotUnit* robotUnit,
85 const NJointHolonomicPlatformRelativePositionControllerConfigPtr& cfg,
87
88 inline virtual void rtRun(const IceUtil::Time&,
89 const IceUtil::Time& timeSinceLastIteration) override;
90 inline virtual void rtPreActivateController() override;
91
92 //ice interface
93 inline virtual std::string
94 getClassName(const Ice::Current& = Ice::emptyCurrent) const override
95 {
96 return "NJointHolonomicPlatformRelativePositionController";
97 }
98
99 void
100 setTarget(float x, float y, float yaw, float translationAccuracy, float rotationAccuracy);
101
102
103 protected:
108 Eigen::Vector2f startPosition{0, 0}, currentPosition{0, 0};
111 // float rad2MMFactor;
112 };
113} // namespace armarx
#define TYPEDEF_PTRS_HANDLE(T)
Brief description of class ControlTargetHolonomicPlatformVelocity.
NJointControllerWithTripleBuffer(const NJointHolonomicPlatformRelativePositionControllerTarget &initialCommands=NJointHolonomicPlatformRelativePositionControllerTarget())
virtual std::string getClassName(const Ice::Current &=Ice::emptyCurrent) const override
NJointHolonomicPlatformRelativePositionController(RobotUnit *robotUnit, const NJointHolonomicPlatformRelativePositionControllerConfigPtr &cfg, const VirtualRobot::RobotPtr &)
PositionThroughVelocityControllerWithAccelerationBoundsAndPeriodicPosition oriCtrl
void setTarget(float x, float y, float yaw, float translationAccuracy, float rotationAccuracy)
virtual void rtPreActivateController() override
This function is called before the controller is activated.
virtual void rtRun(const IceUtil::Time &, const IceUtil::Time &timeSinceLastIteration) override
TODO make protected and use attorneys.
The RobotUnit class manages a robot and its controllers.
Definition RobotUnit.h:192
std::shared_ptr< class Robot > RobotPtr
Definition Bus.h:19
This file offers overloads of toIce() and fromIce() functions for STL container types.
MultiDimPIDControllerTemplate<> MultiDimPIDController