CartesianFeedForwardPositionController.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 Simon Ottenhaus (simon dot ottenhaus at kit dot edu)
20  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
21  * GNU General Public License
22  */
23 
24 #pragma once
25 
26 #include <VirtualRobot/RobotNodeSet.h>
27 #include <VirtualRobot/IK/DifferentialIK.h>
28 #include <VirtualRobot/Robot.h>
29 #include <Eigen/Dense>
30 #include <VirtualRobot/math/AbstractFunctionR1R6.h>
31 
32 namespace armarx
33 {
34  class CartesianFeedForwardPositionController;
35  using CartesianFeedForwardPositionControllerPtr = std::shared_ptr<CartesianFeedForwardPositionController>;
36 
38  {
39  public:
40  CartesianFeedForwardPositionController(const VirtualRobot::RobotNodePtr& tcp);
41  Eigen::VectorXf calculate(const ::math::AbstractFunctionR1R6Ptr& trajectory, float t, VirtualRobot::IKSolver::CartesianSelection mode);
42 
43  float getPositionError(const ::math::AbstractFunctionR1R6Ptr& trajectory, float t);
44  float getOrientationError(const ::math::AbstractFunctionR1R6Ptr& trajectory, float t);
45  Eigen::Vector3f getPositionDiff(const ::math::AbstractFunctionR1R6Ptr& trajectory, float t);
46  Eigen::Vector3f getOrientationDiff(const ::math::AbstractFunctionR1R6Ptr& trajectory, float t);
47 
48  float KpPos = 1;
49  float KpOri = 1;
50  float maxPosVel = -1;
51  float maxOriVel = -1;
52  bool enableFeedForward = true;
53 
54  private:
55  VirtualRobot::RobotNodePtr tcp;
56  };
57 }
armarx::CartesianFeedForwardPositionController::getPositionDiff
Eigen::Vector3f getPositionDiff(const ::math::AbstractFunctionR1R6Ptr &trajectory, float t)
Definition: CartesianFeedForwardPositionController.cpp:96
armarx::CartesianFeedForwardPositionController::calculate
Eigen::VectorXf calculate(const ::math::AbstractFunctionR1R6Ptr &trajectory, float t, VirtualRobot::IKSolver::CartesianSelection mode)
Definition: CartesianFeedForwardPositionController.cpp:35
armarx::CartesianFeedForwardPositionController::getOrientationDiff
Eigen::Vector3f getOrientationDiff(const ::math::AbstractFunctionR1R6Ptr &trajectory, float t)
Definition: CartesianFeedForwardPositionController.cpp:103
armarx::CartesianFeedForwardPositionController::enableFeedForward
bool enableFeedForward
Definition: CartesianFeedForwardPositionController.h:52
armarx::CartesianFeedForwardPositionController::CartesianFeedForwardPositionController
CartesianFeedForwardPositionController(const VirtualRobot::RobotNodePtr &tcp)
Definition: CartesianFeedForwardPositionController.cpp:29
armarx::CartesianFeedForwardPositionController::getOrientationError
float getOrientationError(const ::math::AbstractFunctionR1R6Ptr &trajectory, float t)
Definition: CartesianFeedForwardPositionController.cpp:87
armarx::CartesianFeedForwardPositionController::maxPosVel
float maxPosVel
Definition: CartesianFeedForwardPositionController.h:50
armarx::CartesianFeedForwardPositionControllerPtr
std::shared_ptr< CartesianFeedForwardPositionController > CartesianFeedForwardPositionControllerPtr
Definition: CartesianFeedForwardPositionController.h:35
armarx::NJointTaskSpaceDMPControllerMode::CartesianSelection
CartesianSelection
Definition: ControllerInterface.ice:34
armarx::CartesianFeedForwardPositionController::maxOriVel
float maxOriVel
Definition: CartesianFeedForwardPositionController.h:51
armarx::CartesianFeedForwardPositionController::getPositionError
float getPositionError(const ::math::AbstractFunctionR1R6Ptr &trajectory, float t)
Definition: CartesianFeedForwardPositionController.cpp:80
armarx::CartesianFeedForwardPositionController::KpPos
float KpPos
Definition: CartesianFeedForwardPositionController.h:48
armarx::CartesianFeedForwardPositionController
Definition: CartesianFeedForwardPositionController.h:37
armarx::CartesianFeedForwardPositionController::KpOri
float KpOri
Definition: CartesianFeedForwardPositionController.h:49
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28