TaskspaceImpedanceController.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 * @author Jianfeng Gao ( jianfeng dot gao at kit dot edu )
17 * @date 2021
18 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
19 * GNU General Public License
20 */
21
22#pragma once
23
24#include <Eigen/Core>
25
26#include <VirtualRobot/VirtualRobot.h>
27
28#include <armarx/control/common/control_law/aron/TaskspaceImpedanceControllerConfig.aron.generated.h>
31#include <armarx/control/common/ft/aron/FTConfig.aron.generated.h>
32
34{
35
37 {
38 public:
39 using FTConfig = common::ft::arondto::FTConfig;
40 using Config = common::control_law::arondto::TaskspaceImpedanceControllerConfig;
41 using ConfigDict = common::control_law::arondto::TaskspaceImpedanceControllerConfigDict;
42
43 // /// internal status of the controller, containing intermediate variables, mutable targets
44 // struct RtStatus : public RobotStatus
45 // {
46 // /// targets
47 // Eigen::VectorXf desiredJointTorque;
48 // Eigen::VectorXf nullspaceTorque;
49 //
50 // /// force torque
51 // Eigen::Vector6f currentForceTorque;
52 // Eigen::Vector6f safeFTGuardOffset;
53 //
54 // /// task space variables
55 // Eigen::Vector6f forceImpedance;
56 //
57 // /// current status
58 // Eigen::VectorXf qvelFiltered;
59 // Eigen::Matrix4f currentPose;
60 // Eigen::Vector6f currentTwist;
61 // Eigen::Matrix4f desiredPose;
62 // Eigen::Matrix4f desiredPoseUnsafe;
63 //
64 // /// intermediate results
65 // Eigen::Matrix3f poseDiffMatImp;
66 // Eigen::Vector6f poseErrorImp;
67 // Eigen::AngleAxisf oriDiffAngleAxis;
68 //
69 // /// others
70 // Eigen::MatrixXf jacobi;
71 // Eigen::MatrixXf jtpinv;
72 // bool rtSafe;
73 // bool rtTargetSafe = true;
74 // bool forceTorqueSafe = true;
75 //
76 // void reset(const unsigned int nDoF);
77 // void rtPreActivate(const Eigen::Matrix4f& currentPose);
78 // };
79
80 // unsigned int numOfJoints; // for nonRT use case
81 private:
82 // Eigen::MatrixXf I;
83
84 VirtualRobot::DifferentialIKPtr ik;
85
86 // const float lambda = 2.0f;
87
88 public:
89 VirtualRobot::RobotNodePtr tcp;
90 VirtualRobot::RobotNodePtr rtTCP;
92
93 // void updateFT(const FTConfig& c, RtStatus& rtStatus);
94 void initialize(const VirtualRobot::RobotNodeSetPtr& rns,
95 const VirtualRobot::RobotNodeSetPtr& rtRns);
96 void preactivateInit(const VirtualRobot::RobotNodeSetPtr& rns);
97
98 void run(Config& c, TSCtrlRtStatus& robotStatus);
99 void firstRun();
100 };
101} // namespace armarx::control::common::control_law
constexpr T c
void initialize(const VirtualRobot::RobotNodeSetPtr &rns, const VirtualRobot::RobotNodeSetPtr &rtRns)
common::control_law::arondto::TaskspaceImpedanceControllerConfig Config
common::control_law::arondto::TaskspaceImpedanceControllerConfigDict ConfigDict