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/Robot.h>
26 
28 
29 #include "../ControlTargets/ControlTargetHolonomicPlatformVelocity.h"
31 
32 namespace armarx
33 {
34 
36  {
37  public:
38  Cartesian2DimVelocityRamp(float maxPositionAcceleration, float maxOrientationAcceleration);
39  void init(const Eigen::Vector3f& state);
40 
41  Eigen::Vector3f update(const Eigen::Vector3f& target, float dt);
42 
43  void setMaxPositionAcceleration(float maxPositionAcceleration);
44  void setMaxOrientationAcceleration(float maxOrientationAcceleration);
45 
46  private:
47  float maxPositionAcceleration = 0;
48  float maxOrientationAcceleration = 0;
49 
50  Eigen::Vector3f state; // [velX,velY,velRotation]
51  };
52 
54 
56  virtual public NJointControllerConfig
57  {
58  public:
59  std::string platformName;
60 
63  };
64 
66 
69  {
70  public:
71  using ConfigPtrT = NJointHolonomicPlatformVelocityControllerWithRampConfigPtr;
72 
74  ConfigPtrT config,
75  const VirtualRobot::RobotPtr&);
76 
77  void rtRun(const IceUtil::Time& sensorValuesTimestamp,
78  const IceUtil::Time& timeSinceLastIteration) override;
79 
80 
81  void setMaxAccelerations(float maxPositionAcceleration, float maxOrientationAcceleration);
82 
83  //ice interface
84  std::string
85  getClassName(const Ice::Current& = Ice::emptyCurrent) const override
86  {
87  return "NJointHolonomicPlatformVelocityControllerWithRamp";
88  }
89 
90  protected:
91  void rtPreActivateController() override;
92 
93  protected:
95 
96  Eigen::Vector3f activationVelocity;
98 
101  };
102 } // namespace armarx
armarx::ControlTargetHolonomicPlatformVelocity
Brief description of class ControlTargetHolonomicPlatformVelocity.
Definition: ControlTargetHolonomicPlatformVelocity.h:38
armarx::NJointHolonomicPlatformVelocityControllerWithRamp::rtRun
void rtRun(const IceUtil::Time &sensorValuesTimestamp, const IceUtil::Time &timeSinceLastIteration) override
TODO make protected and use attorneys.
Definition: NJointHolonomicPlatformVelocityControllerWithRamp.cpp:63
armarx::NJointHolonomicPlatformVelocityControllerInterface
Definition: NJointHolonomicPlatformVelocityControllerInterface.h:43
NJointControllerWithTripleBuffer.h
NJointHolonomicPlatformVelocityControllerInterface.h
armarx::TYPEDEF_PTRS_HANDLE
TYPEDEF_PTRS_HANDLE(NJointCartesianNaturalPositionController)
armarx::Cartesian2DimVelocityRamp
Definition: NJointHolonomicPlatformVelocityControllerWithRamp.h:35
armarx::Cartesian2DimVelocityRamp::update
Eigen::Vector3f update(const Eigen::Vector3f &target, float dt)
Definition: NJointHolonomicPlatformVelocityControllerWithRamp.cpp:129
armarx::NJointHolonomicPlatformVelocityControllerWithRamp
Definition: NJointHolonomicPlatformVelocityControllerWithRamp.h:67
armarx::NJointHolonomicPlatformVelocityControllerWithRampConfig::maxPositionAcceleration
float maxPositionAcceleration
Definition: NJointHolonomicPlatformVelocityControllerWithRamp.h:61
boost::target
Vertex target(const detail::edge_base< Directed, Vertex > &e, const PCG &)
Definition: point_cloud_graph.h:688
armarx::NJointHolonomicPlatformVelocityControllerWithRampConfig::platformName
std::string platformName
Definition: NJointHolonomicPlatformVelocityControllerWithRamp.h:59
armarx::NJointHolonomicPlatformVelocityControllerWithRamp::NJointHolonomicPlatformVelocityControllerWithRamp
NJointHolonomicPlatformVelocityControllerWithRamp(RobotUnit *prov, ConfigPtrT config, const VirtualRobot::RobotPtr &)
Definition: NJointHolonomicPlatformVelocityControllerWithRamp.cpp:32
armarx::NJointHolonomicPlatformVelocityControllerWithRamp::ramp
Cartesian2DimVelocityRamp ramp
Definition: NJointHolonomicPlatformVelocityControllerWithRamp.h:94
armarx::NJointControllerBase::ConfigPtrT
NJointControllerConfigPtr ConfigPtrT
Definition: NJointControllerBase.h:586
armarx::NJointHolonomicPlatformVelocityControllerWithRamp::velocitySensor
const SensorValueHolonomicPlatformVelocity * velocitySensor
Definition: NJointHolonomicPlatformVelocityControllerWithRamp.h:100
armarx::NJointHolonomicPlatformVelocityControllerWithRamp::setMaxAccelerations
void setMaxAccelerations(float maxPositionAcceleration, float maxOrientationAcceleration)
Definition: NJointHolonomicPlatformVelocityControllerWithRamp.cpp:103
armarx::SensorValueHolonomicPlatformVelocity
Definition: SensorValueHolonomicPlatform.h:30
armarx::Cartesian2DimVelocityRamp::init
void init(const Eigen::Vector3f &state)
Definition: NJointHolonomicPlatformVelocityControllerWithRamp.cpp:123
armarx::NJointHolonomicPlatformVelocityControllerWithRamp::target
ControlTargetHolonomicPlatformVelocity * target
Definition: NJointHolonomicPlatformVelocityControllerWithRamp.h:99
armarx::armem::Time
armarx::core::time::DateTime Time
Definition: forward_declarations.h:13
armarx::NJointHolonomicPlatformVelocityControllerWithRamp::activationTime
IceUtil::Time activationTime
Definition: NJointHolonomicPlatformVelocityControllerWithRamp.h:97
armarx::RobotUnit
The RobotUnit class manages a robot and its controllers.
Definition: RobotUnit.h:180
armarx::NJointHolonomicPlatformVelocityControllerWithRampConfig::maxOrientationAcceleration
float maxOrientationAcceleration
Definition: NJointHolonomicPlatformVelocityControllerWithRamp.h:62
armarx::Cartesian2DimVelocityRamp::setMaxOrientationAcceleration
void setMaxOrientationAcceleration(float maxOrientationAcceleration)
Definition: NJointHolonomicPlatformVelocityControllerWithRamp.cpp:156
armarx::NJointHolonomicPlatformVelocityControllerWithRampConfig
Definition: NJointHolonomicPlatformVelocityControllerWithRamp.h:55
armarx::Cartesian2DimVelocityRamp::setMaxPositionAcceleration
void setMaxPositionAcceleration(float maxPositionAcceleration)
Definition: NJointHolonomicPlatformVelocityControllerWithRamp.cpp:150
armarx::NJointHolonomicPlatformVelocityControllerWithRamp::rtPreActivateController
void rtPreActivateController() override
This function is called before the controller is activated.
Definition: NJointHolonomicPlatformVelocityControllerWithRamp.cpp:51
armarx::NJointHolonomicPlatformVelocityControllerWithRamp::getClassName
std::string getClassName(const Ice::Current &=Ice::emptyCurrent) const override
Definition: NJointHolonomicPlatformVelocityControllerWithRamp.h:85
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::Cartesian2DimVelocityRamp::Cartesian2DimVelocityRamp
Cartesian2DimVelocityRamp(float maxPositionAcceleration, float maxOrientationAcceleration)
Definition: NJointHolonomicPlatformVelocityControllerWithRamp.cpp:115
armarx::NJointHolonomicPlatformVelocityControllerWithRamp::activationVelocity
Eigen::Vector3f activationVelocity
Definition: NJointHolonomicPlatformVelocityControllerWithRamp.h:96
dt
constexpr T dt
Definition: UnscentedKalmanFilterTest.cpp:42
VirtualRobot::RobotPtr
std::shared_ptr< class Robot > RobotPtr
Definition: Bus.h:18