CartesianVelocityControllerWithRamp.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),
5  * Karlsruhe Institute of Technology (KIT), all rights reserved.
6  *
7  * ArmarX is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License version 2 as
9  * published by the Free Software Foundation.
10  *
11  * ArmarX is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  *
19  * @author Sonja Marahrens (sonja dot marahrens)
20  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
21  * GNU General Public License
22  */
23 
24 #pragma once
25 
27 #include "CartesianVelocityRamp.h"
28 #include "JointVelocityRamp.h"
29 
30 #include <VirtualRobot/RobotNodeSet.h>
31 
32 #include <VirtualRobot/IK/DifferentialIK.h>
33 #include <VirtualRobot/Robot.h>
34 #include <Eigen/Dense>
35 
36 
37 namespace armarx
38 {
39  class CartesianVelocityControllerWithRamp;
40  using CartesianVelocityControllerWithRampPtr = std::shared_ptr<CartesianVelocityControllerWithRamp>;
41 
43  {
44  public:
45  CartesianVelocityControllerWithRamp(const VirtualRobot::RobotNodeSetPtr& rns, const Eigen::VectorXf& currentJointVelocity, VirtualRobot::IKSolver::CartesianSelection mode,
46  float maxPositionAcceleration, float maxOrientationAcceleration, float maxNullspaceAcceleration,
47  const VirtualRobot::RobotNodePtr& tcp = nullptr);
48 
51 
52  [[deprecated("computed null space velocity does not match pseudo inverse svd method in simox. never use this function.")]]
53  void setCurrentJointVelocity(const Eigen::Ref<const Eigen::VectorXf>& currentJointVelocity);
54 
55  void switchMode(const Eigen::VectorXf& currentJointVelocity, VirtualRobot::IKSolver::CartesianSelection mode);
57 
58  Eigen::VectorXf calculate(const Eigen::VectorXf& cartesianVel, float jointLimitAvoidanceScale, float dt);
59  Eigen::VectorXf calculate(const Eigen::VectorXf& cartesianVel, const Eigen::VectorXf& nullspaceVel, float dt);
60 
61  void setMaxAccelerations(float maxPositionAcceleration, float maxOrientationAcceleration, float maxNullspaceAcceleration);
62 
66 
67 
69  private:
71  CartesianVelocityRamp cartesianVelocityRamp;
72  JointVelocityRamp nullSpaceVelocityRamp;
73  };
74 }
armarx::CartesianVelocityControllerWithRamp::getMaxPositionAcceleration
float getMaxPositionAcceleration()
Definition: CartesianVelocityControllerWithRamp.cpp:96
armarx::CartesianVelocityController
Definition: CartesianVelocityController.h:36
armarx::CartesianVelocityControllerWithRamp::setMaxAccelerations
void setMaxAccelerations(float maxPositionAcceleration, float maxOrientationAcceleration, float maxNullspaceAcceleration)
Definition: CartesianVelocityControllerWithRamp.cpp:84
armarx::JointVelocityRamp
Definition: JointVelocityRamp.h:35
armarx::CartesianVelocityControllerWithRamp::getMaxNullspaceAcceleration
float getMaxNullspaceAcceleration()
Definition: CartesianVelocityControllerWithRamp.cpp:101
armarx::CartesianVelocityControllerWithRamp::getMode
VirtualRobot::IKSolver::CartesianSelection getMode()
Definition: CartesianVelocityControllerWithRamp.cpp:67
armarx::CartesianVelocityControllerWithRamp::controller
CartesianVelocityController controller
Definition: CartesianVelocityControllerWithRamp.h:68
armarx::CartesianVelocityControllerWithRamp::calculate
Eigen::VectorXf calculate(const Eigen::VectorXf &cartesianVel, float jointLimitAvoidanceScale, float dt)
Definition: CartesianVelocityControllerWithRamp.cpp:72
armarx::NJointTaskSpaceDMPControllerMode::CartesianSelection
CartesianSelection
Definition: ControllerInterface.ice:34
armarx::CartesianVelocityRamp
Definition: CartesianVelocityRamp.h:35
JointVelocityRamp.h
armarx::CartesianVelocityControllerWithRamp::setCurrentJointVelocity
void setCurrentJointVelocity(const Eigen::Ref< const Eigen::VectorXf > &currentJointVelocity)
Definition: CartesianVelocityControllerWithRamp.cpp:41
armarx::CartesianVelocityControllerWithRamp::switchMode
void switchMode(const Eigen::VectorXf &currentJointVelocity, VirtualRobot::IKSolver::CartesianSelection mode)
Definition: CartesianVelocityControllerWithRamp.cpp:60
CartesianVelocityController.h
CartesianVelocityRamp.h
armarx::CartesianVelocityControllerWithRamp::operator=
CartesianVelocityControllerWithRamp & operator=(CartesianVelocityControllerWithRamp &&)=default
armarx::CartesianVelocityControllerWithRamp::getMaxOrientationAcceleration
float getMaxOrientationAcceleration()
Definition: CartesianVelocityControllerWithRamp.cpp:91
armarx::CartesianVelocityControllerWithRamp
Definition: CartesianVelocityControllerWithRamp.h:42
armarx::CartesianVelocityControllerWithRamp::CartesianVelocityControllerWithRamp
CartesianVelocityControllerWithRamp(const VirtualRobot::RobotNodeSetPtr &rns, const Eigen::VectorXf &currentJointVelocity, VirtualRobot::IKSolver::CartesianSelection mode, float maxPositionAcceleration, float maxOrientationAcceleration, float maxNullspaceAcceleration, const VirtualRobot::RobotNodePtr &tcp=nullptr)
Definition: CartesianVelocityControllerWithRamp.cpp:30
armarx::CartesianVelocityControllerWithRampPtr
std::shared_ptr< CartesianVelocityControllerWithRamp > CartesianVelocityControllerWithRampPtr
Definition: CartesianVelocityControllerWithRamp.h:40
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
dt
constexpr T dt
Definition: UnscentedKalmanFilterTest.cpp:42