KeypointsAdmittanceController.cpp
Go to the documentation of this file.
1 #include <fstream>
2 #include <boost/algorithm/clamp.hpp>
3 
4 #include <SimoxUtility/math/convert/mat4f_to_pos.h>
5 #include <SimoxUtility/math/convert/mat4f_to_quat.h>
6 #include <SimoxUtility/math/convert/rpy_to_mat3f.h>
7 #include <SimoxUtility/math/compare/is_equal.h>
8 #include <SimoxUtility/json.h>
9 
10 #include <VirtualRobot/MathTools.h>
13 
14 #include "../utils.h"
16 
17 
18 
20 {
21 
22 void KeypointsAdmittanceController::initialize(const VirtualRobot::RobotNodeSetPtr& rns, const std::string &configFileName)
23 {
25  tcp = rns->getTCP();
27  ik.reset(new VirtualRobot::DifferentialIK(
28  rns, rns->getRobot()->getRootNode(),
29  VirtualRobot::JacobiProvider::eSVDDamped));
30 
31  /// joint space variables
32  numOfJoints = rns->getSize();
33  s.qpos.resize(numOfJoints);
34  s.qvel.resize(numOfJoints);
35  s.desiredJointTorques.resize(numOfJoints);
36 
37  s.currentForceTorque.setZero();
38  s.currentTwist.setZero();
39  s.forceImpedance.setZero();
40  s.virtualVel.setZero();
41  s.virtualAcc.setZero();
42  s.pointTrackingForce.setZero();
43 
44  /// parse configuration files
45  nlohmann::json userConfig;
46  nlohmann::json defaultConfig;
47  std::string filename;
48  {
50  "armarx_control/controller_config/default/njoint_controller/impedance_controller_config.json",
51  filename);
52  ARMARX_INFO << "reading default config from: " << VAROUT(filename);
53  std::ifstream ifs{filename};
54  ifs >> defaultConfig;
55  if (defaultConfig.empty())
56  {
57  ARMARX_ERROR << "default config is empty!";
58  }
59  }
60  if (configFileName.empty())
61  {
62  ARMARX_IMPORTANT << "No control parameter specified by user, use default parameter in \n" << filename;
63  userConfig = defaultConfig;
64  }
65  else
66  {
67  std::ifstream ifs{configFileName};
68  ifs >> userConfig;
69  }
70  if (userConfig.empty())
71  {
72  ARMARX_ERROR << "userConfig is empty!";
73  }
74 
75  if (userConfig.find("control") != userConfig.end())
76  {
77  auto c = userConfig["control"];
78  auto dc = defaultConfig["control"];
79  s.kpImpedance = getEigenVec(c, dc, "impedance_stiffness");
80  s.kdImpedance = getEigenVec(c, dc, "impedance_damping");
81  s.kpAdmittance = getEigenVec(c, dc, "admittance_stiffness");
82  s.kdAdmittance = getEigenVec(c, dc, "admittance_damping");
83  s.kmAdmittance = getEigenVec(c, dc, "admittance_inertia");
84  s.kpNullspace = getEigenVec(c, dc, "nullspace_stiffness", numOfJoints, 10.0f);
85  s.kdNullspace = getEigenVec(c, dc, "nullspace_damping", numOfJoints, 2.0f);
86  s.desiredNullspaceJointAngles = getEigenVec(c, dc, "desired_nullspace_joint_angles");
87  if (s.desiredNullspaceJointAngles.size() != numOfJoints)
88  {
89  ARMARX_IMPORTANT << "default value is not consistent with requested kinematic chain, reinit in preactivation";
90  enablePreactivateInit.store(true);
91  }
92  s.torqueLimit = getValue<float>(c, dc, "torque_limit");
93  s.qvelFilter = getValue<float>(c, dc, "qvel_filter");
94  /// keypoints related
95  s.numPoints = getValue<int> (c, dc, "num_points");
96  s.keypointKp = getEigenVec (c, dc, "keypoint_stiffness");
97  s.keypointKd = getEigenVec (c, dc, "keypoint_damping");
98  s.currentKeypointPosition = getEigenVec (c, dc, "current_keypoint_position");
102  s.keypointPositionFilter = getValue<float>(c, dc, "keypoint_position_filter");
103  s.keypointVelocityFilter = getValue<float>(c, dc, "keypoint_velocity_filter");
104 
105  s.isRigid = getValue<bool> (c, dc, "is_rigid");
106  s.fixedTranslation = getEigenVec (c, dc, "fixed_translation");
109  }
110  else
111  {
112  ARMARX_WARNING << "controller parameters not found, they should be placed in 'control' tag in your json file";
113  }
114 
115  I = Eigen::MatrixXf::Identity(numOfJoints, numOfJoints);
116 }
117 
119 {
120  nlohmann::json userConfig;
121  std::ifstream ifs{configFileName};
122  ifs >> userConfig;
123  auto c = userConfig["control"];
124  Config config = Config();
125  config.kpImpedance = getEigenVecWithDefault (c, s.kpImpedance, "impedance_stiffness");
126  config.kdImpedance = getEigenVecWithDefault (c, s.kdImpedance, "impedance_damping");
127  config.kpAdmittance = getEigenVecWithDefault (c, s.kpAdmittance, "admittance_stiffness");
128  config.kdAdmittance = getEigenVecWithDefault (c, s.kdAdmittance, "admittance_damping");
129  config.kmAdmittance = getEigenVecWithDefault (c, s.kmAdmittance, "admittance_inertia");
130  config.kpNullspace = getEigenVecWithDefault (c, s.kpNullspace, "nullspace_stiffness");
131  config.kdNullspace = getEigenVecWithDefault (c, s.kdNullspace, "nullspace_damping");
132  config.currentForceTorque.setZero();
133  config.desiredNullspaceJointAngles = getEigenVecWithDefault (c, s.desiredNullspaceJointAngles, "desired_nullspace_joint_angles");
134  config.torqueLimit = getValueWithDefault<float>(c, s.torqueLimit, "torque_limit");
135  config.qvelFilter = getValueWithDefault<float>(c, s.qvelFilter, "qvel_filter");
136  /// keypoint related
137  config.numPoints = getValueWithDefault<int> (c, s.numPoints, "num_points");
138  config.keypointKp = getEigenVecWithDefault (c, s.keypointKp, "keypoint_stiffness");
139  config.keypointKd = getEigenVecWithDefault (c, s.keypointKd, "keypoint_damping");
140  config.currentKeypointPosition = getEigenVecWithDefault (c, s.currentKeypointPosition, "current_keypoint_position");
141  config.desiredKeypointPosition = getEigenVecWithDefault (c, config.currentKeypointPosition, "desired_keypoint_position");
142  config.desiredKeypointVelocity.setZero(config.numPoints*3);
143  config.desiredKeypointVelocity = getEigenVecWithDefault (c, config.desiredKeypointVelocity, "desired_keypoint_velocity");
144  config.keypointPositionFilter = getValueWithDefault<float>(c, s.keypointPositionFilter, "keypoint_position_filter");
145  config.keypointVelocityFilter = getValueWithDefault<float>(c, s.keypointVelocityFilter, "keypoint_velocity_filter");
146  config.isRigid = getValueWithDefault<bool> (c, s.isRigid, "is_rigid");
147  config.fixedTranslation = getEigenVecWithDefault (c, s.fixedTranslation, "fixed_translation");
148  return config;
149 }
150 
151 
152 void KeypointsAdmittanceController::preactivateInit(const VirtualRobot::RobotNodeSetPtr& rns)
153 {
154  Eigen::Matrix4f currentPose = rns->getTCP()->getPoseInRootFrame();
155  s.qpos = rns->getJointValuesEigen();
156  s.qvel.setZero(numOfJoints);
157  s.nullspaceTorque.setZero(numOfJoints);
158  s.desiredJointTorques.setZero(numOfJoints);
159 
160  if (s.isRigid)
161  {
162  for (int i = 0; i < s.numPoints; i++)
163  {
164  s.currentKeypointPosition.segment(3*i, 3) = currentPose.block(0, 3, 3, 1);
165  }
167  }
168 
169  s.previousDesiredPose = currentPose;
170  s.desiredPose = currentPose;
171  s.desiredVel.setZero();
172  s.desiredAcc.setZero();
173 
174  s.currentPose = currentPose;
175  s.currentTwist.setZero();
176  s.forceImpedance.setZero();
177 
178  s.virtualPose = currentPose;
179  s.virtualVel.setZero();
180  s.virtualAcc.setZero();
181 
182  s.pointTrackingForce.setZero();
187 
188  if (enablePreactivateInit.load())
189  {
190  s.desiredNullspaceJointAngles = rns->getJointValuesEigen();
191  }
192 }
193 
195 {
198  s.desiredVel.setZero();
199  s.desiredAcc.setZero();
200 
202  s.virtualVel.setZero();
203  s.virtualAcc.setZero();
204 }
205 
207 {
208  bool valid = false;
209  if ((s.previousDesiredPose.block<3, 1>(0, 3) - targetPose.block<3, 1>(0, 3)).norm() > 100.0f)
210  {
211  ARMARX_RT_LOGF_WARN("new target \n\n %s\n\nis too far away from\n\n %s", VAROUT(targetPose), VAROUT(s.previousDesiredPose));
212  // ARMARX_WARNING << "new target \n\n" << targetPose << "\n\nis too far away from\n\n" << VAROUT(s.previousDesiredPose);
213  targetPose = s.previousDesiredPose;
214  s.currentForceTorque.setZero();
215  }
216  else
217  {
218  s.previousDesiredPose = targetPose;
219  valid = true;
220  }
221  return valid;
222 }
223 
225  const Config& cfg,
226  const IceUtil::Time& timeSinceLastIteration,
227  std::vector<const SensorValue1DoFActuatorTorque*> torqueSensors,
228  std::vector<const SensorValue1DoFActuatorVelocity*> velocitySensors,
229  std::vector<const SensorValue1DoFActuatorPosition*> positionSensors
230 )
231 {
232  /// check size and value
233  {
234  ARMARX_CHECK_EQUAL(numOfJoints, torqueSensors.size());
235  ARMARX_CHECK_EQUAL(numOfJoints, velocitySensors.size());
236  ARMARX_CHECK_EQUAL(numOfJoints, positionSensors.size());
237 
238  ARMARX_CHECK_EQUAL(numOfJoints, cfg.kpNullspace.size());
239  ARMARX_CHECK_EQUAL(numOfJoints, cfg.kdNullspace.size());
240  ARMARX_CHECK_EQUAL(numOfJoints, cfg.desiredNullspaceJointAngles.size());
242 
243  ARMARX_CHECK_EQUAL(cfg.numPoints * 3, cfg.keypointKp.size());
244  ARMARX_CHECK_EQUAL(cfg.numPoints * 3, cfg.keypointKd.size());
248  ARMARX_CHECK_EQUAL(cfg.numPoints * 3, cfg.fixedTranslation.size());
249  }
250 
251  /// ----------------------------- get target status from config ---------------------------------------------
252  s.kpImpedance = cfg.kpImpedance;
253  s.kdImpedance = cfg.kdImpedance;
257  s.kpNullspace = cfg.kpNullspace;
258  s.kdNullspace = cfg.kdNullspace;
259 
260  s.torqueLimit = cfg.torqueLimit;
261  s.qvelFilter = cfg.qvelFilter;
262 
265 
266  /// update keypoints related variables
267  s.numPoints = cfg.numPoints;
268  s.keypointKp = cfg.keypointKp;
269  s.keypointKd = cfg.keypointKd;
270 
276 
277  s.isRigid = cfg.isRigid;
279 
280  /// ----------------------------- get current status of robot ---------------------------------------------
281  /// original data in ArmarX use the following units:
282  /// position in mm,
283  /// joint angles and orientation in radian,
284  /// velocity in mm/s and radian/s, etc.
285  /// here we convert mm to m, if you use MP from outside, make sure to convert it back to mm
286 
287  s.currentPose = tcp->getPoseInRootFrame();
288  Eigen::MatrixXf jacobi = ik->getJacobianMatrix(tcp, VirtualRobot::IKSolver::CartesianSelection::All);
289  jacobi.block(0, 0, 3, numOfJoints) = 0.001 * jacobi.block(0, 0, 3, numOfJoints);
290  ARMARX_CHECK_EQUAL(numOfJoints, jacobi.cols());
291  ARMARX_CHECK_EQUAL(6, jacobi.rows());
292  s.jacobi = jacobi;
293 
294  Eigen::VectorXf qvelRaw(numOfJoints);
295  for (size_t i = 0; i < velocitySensors.size(); ++i)
296  {
297  s.qpos(i) = positionSensors[i]->position;
298  qvelRaw(i) = velocitySensors[i]->velocity;
299  }
300 
301  s.qvel = (1 - cfg.qvelFilter) * s.qvel + cfg.qvelFilter * qvelRaw;
302  s.currentTwist = jacobi * s.qvel;
303  s.deltaT = timeSinceLastIteration.toSecondsDouble();
304 
305  /// ----------------------------- keypoint related ---------------------------------------------
306  /// compute (filtered) keypoint position
307  if (s.isRigid)
308  {
309  for (int i = 0; i < s.numPoints; i++)
310  {
311  s.currentKeypointPosition.segment(3*i, 3) = s.currentPose.block(0, 0, 3, 3) * s.fixedTranslation.segment(3*i, 3) + s.currentPose.block<3, 1>(0, 3);
312  }
313  }
316  /// compute filtered keypoint velocity
317  if (s.isRigid)
318  {
319  Eigen::VectorXf currentKeypointVelocity;
320  currentKeypointVelocity.setZero(s.numPoints * 3);
321  for (int i = 0; i < s.numPoints; i++)
322  {
323  Eigen::Vector3f angular_vel = s.currentTwist.tail(3);
324  Eigen::Vector3f dist = s.fixedTranslation.segment(3*i, 3);
325  currentKeypointVelocity.segment(3*i, 3) = angular_vel.cross(dist) + s.currentTwist.head(3);
326  }
328  + s.keypointVelocityFilter * currentKeypointVelocity;
329  }
330  else
331  {
334  }
336 
337  /// ----------------------------- compute keypoint tracking force ---------------------------------------------
339  /// in theory, we can also add s.desiredKeypointVelocity to the damping term
340  Eigen::VectorXf trackingForce = difference.cwiseProduct(s.keypointKp) - s.currentKeypointVelocity.cwiseProduct(s.keypointKd);
341  if (trackingForce.size() != 3 * s.numPoints)
342  {
343  trackingForce.setZero(3 * s.numPoints);
344  }
345 
346  s.pointTrackingForce.setZero();
347  for (int i = 0; i < s.numPoints; i++)
348  {
349  Eigen::Vector3f dist = s.filteredKeypointPosition.segment(3*i, 3) - s.currentPose.block<3, 1>(0, 3);
350  dist = dist * 0.001;
351  Eigen::Vector3f force = trackingForce.segment(3*i, 3);
352  if (force.norm() > 200)
353  {
354  ARMARX_RT_LOGF_WARN("force too large, set to zero");
355  force.setZero();
356  }
357  s.pointTrackingForce.head(3) += force;
358  s.pointTrackingForce.tail(3) += dist.cross(force);
359  }
361  Eigen::Vector6f acc =
362  s.kmAdmittance.cwiseProduct(s.pointTrackingForce) -
363  s.kdAdmittance.cwiseProduct(s.desiredVel);
364 
365  Eigen::Vector6f vel = s.desiredVel + 0.5 * s.deltaT * (acc + s.desiredAcc);
366  Eigen::VectorXf deltaPose = 0.5 * s.deltaT * (vel + s.desiredVel);
367  s.desiredAcc = acc;
368  s.desiredVel = vel;
369 
370  Eigen::Matrix3f deltaPoseMat = VirtualRobot::MathTools::rpy2eigen3f(deltaPose(3), deltaPose(4), deltaPose(5));
371  s.desiredPose.block<3, 1>(0, 3) += deltaPose.head(3);
372  s.desiredPose.block<3, 3>(0, 0) = deltaPoseMat * s.desiredPose.block<3, 3>(0, 0);
373 
375 }
376 
377 void KeypointsAdmittanceController::run(bool rtReady, std::vector<ControlTarget1DoFActuatorTorque *> targets)
378 {
379  /// only when the ft sensor is calibrated can we allow the admittance controller
380  /// to have virtual pose modulation out of force/torque information.
381  if (!rtReady)
382  {
384  s.desiredVel.setZero();
385  s.kmAdmittance.setZero();
386  }
387  /// ---------------------------- admittance control ---------------------------------------------
388  /// calculate pose error between the virtual pose and the target pose
389  Eigen::Matrix3f objDiffMat = s.virtualPose.block<3, 3>(0, 0) * s.desiredPose.block<3, 3>(0, 0).transpose();
390  Eigen::Vector6f poseError;
391  poseError.head(3) = s.virtualPose.block<3, 1>(0, 3) - s.desiredPose.block<3, 1>(0, 3);
392  poseError.tail(3) = VirtualRobot::MathTools::eigen3f2rpy(objDiffMat);
393 
394  /// admittance control law and Euler Integration -> virtual pose
395  Eigen::Vector6f acc =
396  s.kmAdmittance.cwiseProduct(s.currentForceTorque) -
397  s.kpAdmittance.cwiseProduct(poseError) -
398  s.kdAdmittance.cwiseProduct(s.virtualVel);
399 
400  Eigen::Vector6f vel = s.virtualVel + 0.5 * s.deltaT * (acc + s.virtualAcc);
401  Eigen::VectorXf deltaPose = 0.5 * s.deltaT * (vel + s.virtualVel);
402  s.virtualAcc = acc;
403  s.virtualVel = vel;
404 
405  Eigen::Matrix3f deltaPoseMat = VirtualRobot::MathTools::rpy2eigen3f(deltaPose(3), deltaPose(4), deltaPose(5));
406  s.virtualPose.block<3, 1>(0, 3) += deltaPose.head(3);
407  s.virtualPose.block<3, 3>(0, 0) = deltaPoseMat * s.virtualPose.block<3, 3>(0, 0);
408 
409  /// ----------------------------- Impedance control ---------------------------------------------
410  /// calculate pose error between target pose and current pose
411  /// !!! This is very important: you have to keep postion and orientation both
412  /// with UI unit (meter, radian) to calculate impedance force.
413 
414  Eigen::Matrix3f diffMat = s.virtualPose.block<3, 3>(0, 0) * s.currentPose.block<3, 3>(0, 0).transpose();
415  Eigen::Vector6f poseErrorImp;
416  poseErrorImp.head(3) = 0.001 * (s.virtualPose.block<3, 1>(0, 3) - s.currentPose.block<3, 1>(0, 3));
417  poseErrorImp.tail(3) = VirtualRobot::MathTools::eigen3f2rpy(diffMat);
418  s.forceImpedance =
419  s.kpImpedance.cwiseProduct(poseErrorImp) -
420  s.kdImpedance.cwiseProduct(s.currentTwist);
421 
422  /// ----------------------------- Nullspace PD Control --------------------------------------------------
423  Eigen::VectorXf nullspaceTorque =
424  s.kpNullspace.cwiseProduct(s.desiredNullspaceJointAngles - s.qpos) -
425  s.kdNullspace.cwiseProduct(s.qvel);
426 
427  /// ----------------------------- Map TS target force to JS --------------------------------------------------
428  const Eigen::MatrixXf jtpinv = ik->computePseudoInverseJacobianMatrix(s.jacobi.transpose(), lambda);
430  s.jacobi.transpose() * s.forceImpedance +
431  (I - s.jacobi.transpose() * jtpinv) * nullspaceTorque;
432 
433  ARMARX_CHECK_EQUAL(targets.size(), (unsigned)s.desiredJointTorques.size());
434  for (size_t i = 0; i < targets.size(); ++i)
435  {
437  targets.at(i)->torque = s.desiredJointTorques(i);
438  if (!targets.at(i)->isValid())
439  {
440  targets.at(i)->torque = 0;
441  }
442  }
443 }
444 } /// namespace armarx::control::common::control_law
armarx::control::common::control_law::KeypointsAdmittanceController::Status::currentKeypointVelocity
Eigen::VectorXf currentKeypointVelocity
Definition: KeypointsAdmittanceController.h:99
armarx::control::common::control_law::KeypointsAdmittanceController::Status::qpos
Eigen::VectorXf qpos
joint space variable
Definition: KeypointsAdmittanceController.h:76
armarx::control::common::control_law::KeypointsAdmittanceController::Status::desiredAcc
Eigen::Vector6f desiredAcc
Definition: KeypointsAdmittanceController.h:86
armarx::control::common::control_law::KeypointsAdmittanceController::Status::desiredJointTorques
Eigen::VectorXf desiredJointTorques
Definition: KeypointsAdmittanceController.h:80
ARMARX_IMPORTANT
#define ARMARX_IMPORTANT
Definition: Logging.h:183
armarx::control::common::control_law::KeypointsAdmittanceController::firstRun
void firstRun()
Definition: KeypointsAdmittanceController.cpp:194
armarx::control::common::control_law::KeypointsAdmittanceController::Status::virtualVel
Eigen::Vector6f virtualVel
Definition: KeypointsAdmittanceController.h:93
armarx::control::common::control_law::KeypointsAdmittanceController::Config::fixedTranslation
Eigen::VectorXf fixedTranslation
Definition: KeypointsAdmittanceController.h:69
armarx::control::common::control_law::KeypointsAdmittanceController::Config::kdAdmittance
Eigen::Vector6f kdAdmittance
Definition: KeypointsAdmittanceController.h:45
armarx::control::common::getEigenVecWithDefault
Eigen::VectorXf getEigenVecWithDefault(nlohmann::json &userConfig, Eigen::VectorXf defaultValue, const std::string &entryName)
Definition: utils.cpp:76
ARMARX_CHECK_NOT_NULL
#define ARMARX_CHECK_NOT_NULL(ptr)
This macro evaluates whether ptr is not null and if it turns out to be false it will throw an Express...
Definition: ExpressionException.h:206
armarx::control::common::control_law::KeypointsAdmittanceController::Status::jacobi
Eigen::MatrixXf jacobi
others
Definition: KeypointsAdmittanceController.h:102
armarx::control::common::control_law::KeypointsAdmittanceController::Config::kmAdmittance
Eigen::Vector6f kmAdmittance
Definition: KeypointsAdmittanceController.h:46
armarx::control::common::control_law::KeypointsAdmittanceController::reconfigure
Config reconfigure(const std::string &configFileName)
Definition: KeypointsAdmittanceController.cpp:118
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43
armarx::control::common::control_law::KeypointsAdmittanceController::Config::isRigid
bool isRigid
Definition: KeypointsAdmittanceController.h:68
armarx::control::common::control_law::KeypointsAdmittanceController::Config::currentKeypointPosition
Eigen::VectorXf currentKeypointPosition
Definition: KeypointsAdmittanceController.h:62
armarx::control::common::control_law::KeypointsAdmittanceController::Config::keypointPositionFilter
float keypointPositionFilter
Definition: KeypointsAdmittanceController.h:65
armarx::control::common::control_law::KeypointsAdmittanceController::Status::previousDesiredPose
Eigen::Matrix4f previousDesiredPose
task spaace variables
Definition: KeypointsAdmittanceController.h:83
clamp
double clamp(double x, double a, double b)
Definition: point.hpp:125
armarx::control::common::control_law::KeypointsAdmittanceController::Config::keypointKp
Eigen::VectorXf keypointKp
Definition: KeypointsAdmittanceController.h:59
armarx::control::common::control_law::KeypointsAdmittanceController::Status::desiredVel
Eigen::Vector6f desiredVel
Definition: KeypointsAdmittanceController.h:85
GfxTL::Identity
void Identity(MatrixXX< N, N, T > *a)
Definition: MatrixXX.h:523
armarx::control::common::control_law::KeypointsAdmittanceController::Config::kpImpedance
Eigen::Vector6f kpImpedance
Definition: KeypointsAdmittanceController.h:41
if
if(!yyvaluep)
Definition: Grammar.cpp:724
armarx::control::common::control_law::KeypointsAdmittanceController::s
Status s
Definition: KeypointsAdmittanceController.h:117
armarx::control::common::control_law::KeypointsAdmittanceController::preactivateInit
void preactivateInit(const VirtualRobot::RobotNodeSetPtr &rns)
Definition: KeypointsAdmittanceController.cpp:152
armarx::control::common::control_law::KeypointsAdmittanceController::updateControlStatus
bool updateControlStatus(const Config &cfg, const IceUtil::Time &timeSinceLastIteration, std::vector< const SensorValue1DoFActuatorTorque * > torqueSensors, std::vector< const SensorValue1DoFActuatorVelocity * > velocitySensors, std::vector< const SensorValue1DoFActuatorPosition * > positionSensors)
Definition: KeypointsAdmittanceController.cpp:224
armarx::control::common::control_law::KeypointsAdmittanceController::Config::desiredKeypointVelocity
Eigen::VectorXf desiredKeypointVelocity
Definition: KeypointsAdmittanceController.h:64
armarx::control::common::control_law::KeypointsAdmittanceController::run
void run(bool rtReady, std::vector< ControlTarget1DoFActuatorTorque * > targets)
Definition: KeypointsAdmittanceController.cpp:377
armarx::control::common::control_law::KeypointsAdmittanceController::Status::virtualAcc
Eigen::Vector6f virtualAcc
Definition: KeypointsAdmittanceController.h:94
armarx::control::common::control_law::KeypointsAdmittanceController::Config::currentForceTorque
Eigen::Vector6f currentForceTorque
Definition: KeypointsAdmittanceController.h:51
armarx::control::common::control_law::KeypointsAdmittanceController::Status::previousKeypointPosition
Eigen::VectorXf previousKeypointPosition
Definition: KeypointsAdmittanceController.h:98
armarx::control::common::control_law
This file is part of ArmarX.
Definition: aron_conversions.cpp:68
filename
std::string filename
Definition: VisualizationRobot.cpp:83
armarx::control::common::control_law::KeypointsAdmittanceController::Config::kdImpedance
Eigen::Vector6f kdImpedance
Definition: KeypointsAdmittanceController.h:42
armarx::control::common::control_law::KeypointsAdmittanceController::initialize
void initialize(const VirtualRobot::RobotNodeSetPtr &rns, const std::string &configFileName)
Definition: KeypointsAdmittanceController.cpp:22
ARMARX_ERROR
#define ARMARX_ERROR
Definition: Logging.h:189
armarx::control::common::control_law::KeypointsAdmittanceController::Config::keypointKd
Eigen::VectorXf keypointKd
Definition: KeypointsAdmittanceController.h:60
ARMARX_CHECK_GREATER_EQUAL
#define ARMARX_CHECK_GREATER_EQUAL(lhs, rhs)
This macro evaluates whether lhs is greater or equal (>=) rhs and if it turns out to be false it will...
Definition: ExpressionException.h:123
armarx::armem::Time
armarx::core::time::DateTime Time
Definition: forward_declarations.h:13
KeypointsAdmittanceController.h
armarx::control::common::control_law::KeypointsAdmittanceController::Status::virtualPose
Eigen::Matrix4f virtualPose
Definition: KeypointsAdmittanceController.h:92
armarx::control::common::control_law::KeypointsAdmittanceController::Config::keypointVelocityFilter
float keypointVelocityFilter
Definition: KeypointsAdmittanceController.h:66
armarx::control::common::control_law::KeypointsAdmittanceController::Status::currentPose
Eigen::Matrix4f currentPose
Definition: KeypointsAdmittanceController.h:88
armarx::control::common::control_law::KeypointsAdmittanceController::Config::torqueLimit
float torqueLimit
Definition: KeypointsAdmittanceController.h:54
GfxTL::Matrix3f
MatrixXX< 3, 3, float > Matrix3f
Definition: MatrixXX.h:600
GfxTL::Matrix4f
MatrixXX< 4, 4, float > Matrix4f
Definition: MatrixXX.h:601
armarx::control::common::control_law::KeypointsAdmittanceController::Config::qvelFilter
float qvelFilter
Definition: KeypointsAdmittanceController.h:55
armarx::control::common::control_law::KeypointsAdmittanceController::Status::pointTrackingForce
Eigen::Vector6f pointTrackingForce
Definition: KeypointsAdmittanceController.h:96
ARMARX_INFO
#define ARMARX_INFO
Definition: Logging.h:174
armarx::control::common::control_law::KeypointsAdmittanceController::tcp
VirtualRobot::RobotNodePtr tcp
Definition: KeypointsAdmittanceController.h:118
VAROUT
#define VAROUT(x)
Definition: StringHelpers.h:182
armarx::control::common::control_law::KeypointsAdmittanceController::Status::currentTwist
Eigen::Vector6f currentTwist
Definition: KeypointsAdmittanceController.h:89
armarx::control::common::control_law::KeypointsAdmittanceController::Config
you can set the following values from outside of the rt controller via Ice interfaces
Definition: KeypointsAdmittanceController.h:37
armarx::control::common::control_law::KeypointsAdmittanceController::Config::kpAdmittance
Eigen::Vector6f kpAdmittance
Definition: KeypointsAdmittanceController.h:44
armarx::control::common::control_law::KeypointsAdmittanceController::Config::desiredNullspaceJointAngles
Eigen::VectorXf desiredNullspaceJointAngles
Definition: KeypointsAdmittanceController.h:52
Eigen::Matrix< float, 6, 1 >
armarx::control::common::getEigenVec
Eigen::VectorXf getEigenVec(nlohmann::json &userConfig, nlohmann::json &defaultConfig, const std::string &entryName, int size, int value)
Definition: utils.cpp:23
ControlThreadOutputBuffer.h
armarx::ArmarXDataPath::getAbsolutePath
static bool getAbsolutePath(const std::string &relativeFilename, std::string &storeAbsoluteFilename, const std::vector< std::string > &additionalSearchPaths={}, bool verbose=true)
Definition: ArmarXDataPath.cpp:111
armarx::control::common::control_law::KeypointsAdmittanceController::Status::desiredPose
Eigen::Matrix4f desiredPose
Definition: KeypointsAdmittanceController.h:84
armarx::control::common::control_law::KeypointsAdmittanceController::Status::forceImpedance
Eigen::Vector6f forceImpedance
Definition: KeypointsAdmittanceController.h:90
ARMARX_CHECK_EQUAL
#define ARMARX_CHECK_EQUAL(lhs, rhs)
This macro evaluates whether lhs is equal (==) rhs and if it turns out to be false it will throw an E...
Definition: ExpressionException.h:130
ARMARX_WARNING
#define ARMARX_WARNING
Definition: Logging.h:186
ARMARX_RT_LOGF_WARN
#define ARMARX_RT_LOGF_WARN(...)
Definition: ControlThreadOutputBuffer.h:345
armarx::control::common::control_law::KeypointsAdmittanceController::Config::kpNullspace
Eigen::VectorXf kpNullspace
Definition: KeypointsAdmittanceController.h:48
ArmarXDataPath.h
armarx::control::common::control_law::KeypointsAdmittanceController::Status::nullspaceTorque
Eigen::VectorXf nullspaceTorque
Definition: KeypointsAdmittanceController.h:79
armarx::control::common::control_law::KeypointsAdmittanceController::Status::deltaT
double deltaT
Definition: KeypointsAdmittanceController.h:103
armarx::control::common::control_law::KeypointsAdmittanceController::Status::qvel
Eigen::VectorXf qvel
Definition: KeypointsAdmittanceController.h:77
armarx::control::common::control_law::KeypointsAdmittanceController::Config::kdNullspace
Eigen::VectorXf kdNullspace
Definition: KeypointsAdmittanceController.h:49
armarx::control::common::control_law::KeypointsAdmittanceController::Config::desiredKeypointPosition
Eigen::VectorXf desiredKeypointPosition
Definition: KeypointsAdmittanceController.h:63
armarx::control::common::control_law::KeypointsAdmittanceController::Config::numPoints
int numPoints
keypoints related
Definition: KeypointsAdmittanceController.h:58
armarx::control::common::control_law::KeypointsAdmittanceController::Status::filteredKeypointPosition
Eigen::VectorXf filteredKeypointPosition
Definition: KeypointsAdmittanceController.h:97
armarx::control::common::control_law::KeypointsAdmittanceController::validateTargetPose
bool validateTargetPose(Eigen::Matrix4f &targetPose)
Definition: KeypointsAdmittanceController.cpp:206