NJointHolonomicPlatformVelocityControllerWithRamp.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::NJointHolonomicPlatformVelocityControllerInterface
17 * @author Tobias Gröger ( tobias dot groeger at student dot kit dot edu )
18 * @date 2024
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22
23#pragma once
24
25#include <VirtualRobot/VirtualRobot.h>
26
28
29// #include "NJointControllerWithTripleBuffer.h"
30
31namespace armarx
32{
35
37 {
38 public:
39 Cartesian2DimVelocityRamp(float maxPositionAcceleration, float maxOrientationAcceleration);
40 void init(const Eigen::Vector3f& state);
41
42 Eigen::Vector3f update(const Eigen::Vector3f& target, float dt);
43
44 void setMaxPositionAcceleration(float maxPositionAcceleration);
45 void setMaxOrientationAcceleration(float maxOrientationAcceleration);
46
47 private:
48 float maxPositionAcceleration = 0;
49 float maxOrientationAcceleration = 0;
50
51 Eigen::Vector3f state; // [velX,velY,velRotation]
52 };
53
55
57 virtual public NJointControllerConfig
58 {
59 public:
60 std::string platformName;
61
64 };
65
67
70 {
71 public:
72 using ConfigPtrT = NJointHolonomicPlatformVelocityControllerWithRampConfigPtr;
73
75 ConfigPtrT config,
77
78 void rtRun(const IceUtil::Time& sensorValuesTimestamp,
79 const IceUtil::Time& timeSinceLastIteration) override;
80
81
82 void setMaxAccelerations(float maxPositionAcceleration, float maxOrientationAcceleration);
83
84 //ice interface
85 std::string
86 getClassName(const Ice::Current& = Ice::emptyCurrent) const override
87 {
88 return "NJointHolonomicPlatformVelocityControllerWithRamp";
89 }
90
91 protected:
92 void rtPreActivateController() override;
93
94 protected:
96
97 Eigen::Vector3f activationVelocity;
98 IceUtil::Time activationTime;
99
102 };
103} // namespace armarx
#define TYPEDEF_PTRS_HANDLE(T)
constexpr T dt
Eigen::Vector3f update(const Eigen::Vector3f &target, float dt)
Cartesian2DimVelocityRamp(float maxPositionAcceleration, float maxOrientationAcceleration)
Brief description of class ControlTargetHolonomicPlatformVelocity.
std::string getClassName(const Ice::Current &=Ice::emptyCurrent) const override
void setMaxAccelerations(float maxPositionAcceleration, float maxOrientationAcceleration)
void rtRun(const IceUtil::Time &sensorValuesTimestamp, const IceUtil::Time &timeSinceLastIteration) override
TODO make protected and use attorneys.
NJointHolonomicPlatformVelocityControllerWithRamp(RobotUnit *prov, ConfigPtrT config, const VirtualRobot::RobotPtr &)
void rtPreActivateController() override
This function is called before the controller is activated.
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.