TaskspaceAdmittanceController.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 2022
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/TaskspaceAdmittanceControllerConfig.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::TaskspaceAdmittanceControllerConfig;
41 using ConfigDict = common::control_law::arondto::TaskspaceAdmittanceControllerConfigDict;
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 // /// variables that need to be kept locally by the rt thread
51 // Eigen::Matrix4f virtualPose;
52 // Eigen::Vector6f virtualVel;
53 // Eigen::Vector6f virtualAcc;
54 //
55 // Eigen::Matrix3f poseDiffMatAdm;
56 // Eigen::Vector6f poseErrorAdm;
57 // Eigen::Vector6f acc;
58 // Eigen::Vector6f vel;
59 // Eigen::Vector6f pos;
60 //
61 // /// force torque
62 // Eigen::Vector6f currentForceTorque;
63 //
64 // /// task space variables
65 // Eigen::Vector6f forceImpedance;
66 //
67 // /// current status
68 // Eigen::VectorXf qpos;
69 // Eigen::VectorXf qvel;
70 // Eigen::VectorXf qvelFiltered;
71 // Eigen::Matrix4f currentPose;
72 // Eigen::Vector6f currentTwist;
73 // Eigen::Matrix4f desiredPose;
74 //
75 // /// intermediate results
76 // Eigen::Matrix3f poseDiffMatImp;
77 // Eigen::Vector6f poseErrorImp;
78 // Eigen::AngleAxisf oriDiffAngleAxis;
79 //
80 // /// others
81 // Eigen::MatrixXf jacobi;
82 // Eigen::MatrixXf jtpinv;
83 // bool rtSafe;
84 // bool rtTargetSafe = true;
85 //
86 // void reset(const unsigned int nDoF);
87 // void rtPreActivate(const Eigen::Matrix4f& currentPose);
88 // };
89
90 // unsigned int numOfJoints; // for nonRT use case
91 private:
92 // Eigen::MatrixXf I;
93
94 VirtualRobot::DifferentialIKPtr ik;
95
96 // const float lambda = 2.0f;
97
98 public:
99 VirtualRobot::RobotNodePtr tcp;
100 VirtualRobot::RobotNodePtr rtTCP;
102
103 // void updateFT(const FTConfig& c, RtStatus& rtStatus);
104 void initialize(const VirtualRobot::RobotNodeSetPtr& rns,
105 const VirtualRobot::RobotNodeSetPtr& rtRns);
106 void preactivateInit(const VirtualRobot::RobotNodeSetPtr& rns);
107
108 void run(Config& c, TSCtrlRtStatus& robotStatus);
109 void firstRun();
110 };
111} // namespace armarx::control::common::control_law
constexpr T c
void initialize(const VirtualRobot::RobotNodeSetPtr &rns, const VirtualRobot::RobotNodeSetPtr &rtRns)
common::control_law::arondto::TaskspaceAdmittanceControllerConfig Config
common::control_law::arondto::TaskspaceAdmittanceControllerConfigDict ConfigDict