BiKAC.cpp
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 2023
18  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
19  * GNU General Public License
20  */
21 
22 #include "BiKAC.h"
23 
24 #include <VirtualRobot/MathTools.h>
25 // #include <armarx/control/common/aron_conversions.h>
27 // #include <armarx/control/njoint_mp_controller/task_space/aron/aron_conversions.h>
28 
29 
31 {
32  NJointControllerRegistration<NJointBiKAC> registrationControllerNJointBiKAC("NJointBiKAC");
33 
34 
36  const RobotUnitPtr& robotUnit,
37  const NJointControllerConfigPtr& config,
38  const VirtualRobot::RobotPtr& robot):
40  mp::MPPool{}
41  {
42  mpConfig = MPListConfig();
43  ARMARX_IMPORTANT << getClassName() + " construction done";
44  }
45 
46  std::string
47  NJointBiKAC::getClassName(const Ice::Current &) const
48  {
49  return "NJointBiKAC";
50  }
51 
52  void
54  {
55  ARMARX_IMPORTANT << "Updating MP Config";
56  if (isFinished("all"))
57  {
58  auto configData = MPListConfig::FromAron(dto);
59  isMPReady.store(false);
60  while (additionalTaskRunning.load())
61  {
62  usleep(1000);
63  }
64  for (const auto& _mp : configData.mpList)
65  {
66  if (limb.find(_mp.nodeSetName) == limb.end())
67  {
68  ARMARX_WARNING << "You have to make sure the RobotNodeSet " << _mp.nodeSetName
69  << " in your MP config "
70  << "corresponds to one of the RobotNodeSet in the controllers";
71  return;
72  }
73  }
74  mpConfig = configData;
76  // isMPReady.store(true);
77 
79  ARMARX_INFO << "-- successfully updated MP config.";
80  }
81  else
82  {
83  ARMARX_WARNING << "MP is not finished yet, cannot reset MP\n"
84  "If you want to force reset, please call \n\n"
85  " ctrl->stop('all') \n\n"
86  "before you continue";
87  }
88  }
89 
91  NJointBiKAC::getMPConfig(const Ice::Current& iceCurrent)
92  {
93  return mpConfig.toAronDTO();
94  }
95 
96  void
98  {
99  ARMARX_IMPORTANT << "---------------------------------- Updating BiKAC Config -------------------------------------------";
100  if (isFinished("all"))
101  {
102  auto configData = ::armarx::fromAronDict<arondto::BiKACConfig, BiKACConfig>(dto);
103  isConstraintReady.store(false);
104  for (const auto& _c : configData.cList)
105  {
106  ARMARX_INFO << "reinit mp in/output data, and checking " << _c.idx << "-th constraint with type " << _c.type;
107  if(limb.find(_c.rnsKpt) == limb.end())
108  {
109  ARMARX_WARNING << "You have to make sure the RobotNodeSet "
110  << _c.rnsFrame << " in your " << _c.idx << "-th constraint config for a keypoint "
111  << "corresponds to one of the RobotNodeSet in the controllers";
112  return;
113  }
114 
115  auto& _mp = mps.at(_c.mpName);
116  if (_c.type == "pose")
117  {
118  ARMARX_IMPORTANT << "constraint " << _c.idx << " is of type " << _c.type;
119 
120  if (_mp.mp->getClassName() != "TSMP")
121  {
122  ARMARX_WARNING << "the pose constraint must have a TSMP";
123  return;
124  }
125  std::dynamic_pointer_cast<mp::TSMPInput>(_mp.input)->pose = _c.currentKptPoseLocal;
126  std::dynamic_pointer_cast<mp::TSMPOutput>(_mp.output)->pose = _c.currentKptPoseLocal;
127  continue;
128  }
129  else
130  {
131  ARMARX_IMPORTANT << "constraint " << _c.idx << " is of type " << _c.type;
132 
133  std::dynamic_pointer_cast<mp::JSMPInput>(_mp.input)->angleRadian = _c.currentKptPoseLocal.block<3, 1>(0, 3);
134  std::dynamic_pointer_cast<mp::JSMPInput>(_mp.input)->angularVel = Eigen::Vector3f::Zero();
135  std::dynamic_pointer_cast<mp::JSMPOutput>(_mp.output)->angleRadian = _c.currentKptPoseLocal.block<3, 1>(0, 3);
136  std::dynamic_pointer_cast<mp::JSMPOutput>(_mp.output)->angularVel = Eigen::Vector3f::Zero();
137  }
138 
139  if(_c.rnsFrame != "static" and limb.find(_c.rnsFrame) == limb.end())
140  {
141  ARMARX_WARNING << "You have to make sure the RobotNodeSet "
142  << _c.rnsFrame << " in your " << _c.idx << "-th constraint config for a frame "
143  << "corresponds to one of the RobotNodeSet in the controllers";
144  return;
145  }
146 
147  }
148  ARMARX_INFO << "Some debug output";
149  for (const auto& c: configData.cList)
150  {
151  ARMARX_IMPORTANT << "----------------------- c -----------------------------";
152  ARMARX_INFO << VAROUT(c.idx) << VAROUT(c.type) << VAROUT(c.rnsFrame) << VAROUT(c.rnsKpt);
153  ARMARX_INFO << VAROUT(c.currentFrameRoot);
154  ARMARX_INFO << VAROUT(c.currentKptPoseRoot);
155  ARMARX_INFO << VAROUT(c.currentKptVelocityRoot);
156  ARMARX_INFO << VAROUT(c.trackingForceRoot);
157  ARMARX_IMPORTANT << "-------------------------------------------------------";
158  }
159  biKacConfig = configData;
160  bufferBiKACConfig.reinitAllBuffers(biKacConfig);
162  isConstraintReady.store(true);
163  isMPReady.store(true);
164  }
165  else
166  {
167  ARMARX_WARNING << "MP is not finished yet, cannot reset constraints \n"
168  "If you want to force reset, please call \n\n"
169  " ctrl->stop('all') \n\n"
170  "before you continue";
171  }
172  ARMARX_IMPORTANT << "---------------------------------- BiKAC Config Updated -------------------------------------------";
173 
174  }
175 
177  NJointBiKAC::getBiKACConfig(const Ice::Current &iceCurrent)
178  {
179  return ::armarx::toAronDict<arondto::BiKACConfig, BiKACConfig>(biKacConfig);
180  }
181 
182 
183  void NJointBiKAC::updateConstraintStatus(const bool rtSafe)
184  {
185  double deltaT = 0;
186  for (auto& c: biKacConfig.cList)
187  {
188  auto& _mp = mps.at(c.mpName);
189  auto& slaveArm = limb.at(c.rnsKpt);
190  slaveArm->rtStatusInNonRT = slaveArm->bufferRtToNonRt.getUpToDateReadBuffer();
191  const auto currentSlaveTCPPose = slaveArm->controller.tcp->getPoseInRootFrame();
192  c.currentKptPoseRoot = currentSlaveTCPPose * c.poseDiffKptLocal;
193  deltaT = slaveArm->rtStatusInNonRT.deltaT;
194 
195  if (c.type == "pose")
196  {
197  // c.currentFrameRoot = itself, should not be updated
198  const auto masterFrameInv = c.currentFrameRoot.inverse();
199  c.currentKptPoseLocal = masterFrameInv * c.currentKptPoseRoot;
200  c.currentKptVelocityRoot = (1 - c.keypointVelocityFilter) * c.currentKptVelocityRoot +
201  c.keypointVelocityFilter * slaveArm->rtStatusInNonRT.currentTwist.head(3);
202  if (rtSafe)
203  {
204  c.currentKptVelocityLocal.head(3) = c.currentFrameRoot.block<3, 3>(0, 0).transpose() * c.currentKptVelocityRoot.head(3);
205  c.currentKptVelocityLocal.tail(3) = c.currentFrameRoot.block<3, 3>(0, 0).transpose() * c.currentKptVelocityRoot.tail(3);
206 
207  mp::TSMPInputPtr in = std::dynamic_pointer_cast<mp::TSMPInput>(_mp.input);
208  in->pose = c.currentKptPoseLocal;
209  in->vel = c.currentKptVelocityLocal;
210  in->deltaT = deltaT;
211 
212  _mp.mp->run(_mp.input, _mp.output);
213 
214  mp::TSMPOutputPtr out = std::dynamic_pointer_cast<mp::TSMPOutput>(_mp.output);
215  c.targetKptPoseLocal = out->pose;
216  c.targetKptPoseRoot = c.currentFrameRoot * out->pose;
217 
218  Eigen::Vector6f vel = Eigen::Vector6f::Zero();
219  vel.head(3) = c.currentFrameRoot.block<3, 3>(0, 0) * out->vel.head(3);
220  vel.tail(3) = c.currentFrameRoot.block<3, 3>(0, 0) * out->vel.tail(3);
221 
222  slaveArm->nonRtData.c.desiredPose = c.targetKptPoseRoot * c.poseDiffKptLocal.inverse();
223  slaveArm->nonRtData.c.desiredTwist = vel;
224  ARMARX_TRACE;
225  }
226  }
227  else
228  {
229  // differently from c.type==pose, here we need to explicitly update the master's local frame
230  if (c.rnsFrame != "static")
231  {
232  auto& masterArm = limb.at(c.rnsFrame);
233  const auto currentMasterTCPPose = masterArm->controller.tcp->getPoseInRootFrame();
234  c.currentFrameRoot = currentMasterTCPPose * c.poseDiffFrameLocal;
235  }
236  const auto masterFrameInv = c.currentFrameRoot.inverse();
237  c.currentKptPoseLocal = masterFrameInv * c.currentKptPoseRoot;
238 
239  Eigen::Vector3f angular_vel = slaveArm->rtStatusInNonRT.currentTwist.tail(3);
240  Eigen::Vector3f vecRoot = currentSlaveTCPPose.block<3, 3>(0, 0) * c.poseDiffKptLocal.block<3, 1>(0, 3);
241  c.currentKptVelocityRoot.head(3) =
242  (1 - c.keypointVelocityFilter) * c.currentKptVelocityRoot.head(3) +
243  c.keypointVelocityFilter * (angular_vel.cross(vecRoot) +
244  slaveArm->rtStatusInNonRT.currentTwist.head(3));
245  /// if the local frame is moving, this is not accurate anymore
246  c.currentKptVelocityLocal.head(3) = c.currentFrameRoot.block<3, 3>(0, 0).transpose() * c.currentKptVelocityRoot.head(3);
247  ARMARX_TRACE;
248 
249  if (rtSafe)
250  {
251  mp::JSMPInputPtr in = std::dynamic_pointer_cast<mp::JSMPInput>(_mp.input);
252  in->angleRadian = c.currentKptPoseLocal.block<3, 1>(0, 3);
253  in->angularVel = c.currentKptVelocityLocal.head(3);
254  in->deltaT = deltaT;
255 
256  _mp.mp->run(_mp.input, _mp.output);
257 
258  mp::JSMPOutputPtr out = std::dynamic_pointer_cast<mp::JSMPOutput>(_mp.output);
259  c.targetKptPoseLocal.block<3, 1>(0, 3) = out->angleRadian;
260  }
261 
262  ARMARX_TRACE;
263  Eigen::Vector3f modified_target = c.targetKptPoseLocal.block<3, 1>(0, 3);
264  if (c.p2pIdx >= 0 and c.type != "p2p")
265  {
266  const auto& p2p = biKacConfig.cList.at(c.p2pIdx);
267  Eigen::Vector3f p2p_local = (masterFrameInv * p2p.currentKptPoseRoot).block<3, 1>(0, 3);
268  const auto x_ = c.targetKptPoseLocal.block<3, 1>(0, 3);
269  float radius = (c.currentKptPoseLocal.block<3, 1>(0, 3) - p2p_local).norm();
270  // modified_target = (x_ - p2p_local).normalized() * radius + p2p_local;
271  if (c.type == "p2l")
272  {
273  Eigen::Vector3f line_vec = c.pcaComponentsLocal.row(0);
274 
275  auto vec_mean_to_p2p = p2p_local - c.pcaMeanLocal;
276  float proj_p2p = vec_mean_to_p2p.dot(line_vec);
277  auto proj_point_p2p = c.pcaMeanLocal + line_vec * proj_p2p;
278 
279  Eigen::Vector3f line_norm_to_p2p = (p2p_local - proj_point_p2p).normalized();
280  float proj_x_ = (x_ - p2p_local).dot(line_norm_to_p2p);
281  Eigen::Vector3f proj_point = p2p_local + proj_x_ * line_norm_to_p2p;
282 
283  Eigen::Vector3f radial_vec = (x_ - proj_point).normalized();
284  proj_x_ = std::min(std::max(proj_x_, -radius), radius);
285  proj_point = p2p_local + proj_x_ * line_norm_to_p2p;
286  modified_target = sqrt(radius * radius - proj_x_ * proj_x_) * radial_vec + proj_point;
287  }
288  else if (c.type == "p2P")
289  {
290  Eigen::Vector3f plane_norm_vec = c.pcaComponentsLocal.row(2);
291  float proj_x_ = (x_ - p2p_local).dot(plane_norm_vec);
292  Eigen::Vector3f proj_point = p2p_local + proj_x_ * plane_norm_vec;
293 
294  Eigen::Vector3f radial_vec = (x_ - proj_point).normalized();
295  proj_x_ = std::min(std::max(proj_x_, -radius), radius);
296  proj_point = p2p_local + proj_x_ * plane_norm_vec;
297  modified_target = sqrt(radius * radius - proj_x_ * proj_x_) * radial_vec + proj_point;
298  }
299  }
300  c.targetKptPoseLocal.block<3, 1>(0, 3) = modified_target;
301  c.targetKptPoseRoot = c.currentFrameRoot * c.targetKptPoseLocal;
302  ARMARX_TRACE;
303  Eigen::Vector3f kpt_error = modified_target - c.currentKptPoseLocal.block<3, 1>(0, 3);
304  /// the force is in Newton since the error is in mm and the kpt_kp is scaled 1000 times smaller
305  c.trackingForceLocal =
306  (1- c.keypointForceFilter) * c.trackingForceLocal +
307  c.keypointForceFilter * (
308  c.kptKp.cwiseProduct(kpt_error) - c.kptKd.cwiseProduct(c.currentKptVelocityLocal.head(3)));
309  c.trackingForceRoot = c.currentFrameRoot.block<3, 3>(0, 0) * c.trackingForceLocal;
310  ARMARX_TRACE;
311  }
312  }
313 
314  for (auto& pair: biKacConfig.admittanceData)
315  {
316  auto& force_torque = pair.second.forceTorque;
317  Eigen::Vector6f force_torque_current;
318  force_torque_current.setZero();
319  Eigen::Vector3f meanKeypointPositionRoot = Eigen::Vector3f::Zero();
320  for (auto i: pair.second.constraintIdxList)
321  {
322  meanKeypointPositionRoot = meanKeypointPositionRoot + biKacConfig.cList.at(i).currentKptPoseRoot.block<3, 1>(0, 3);
323  }
324  meanKeypointPositionRoot = meanKeypointPositionRoot / pair.second.constraintIdxList.size();
325 
326  for (auto i: pair.second.constraintIdxList)
327  {
328  Eigen::Vector3f devi = biKacConfig.cList.at(i).currentKptPoseRoot.block<3, 1>(0, 3) - meanKeypointPositionRoot;
329  devi = devi * 0.001;
330  auto& force = biKacConfig.cList.at(i).trackingForceRoot;
331  if (force.norm() > 100.0)
332  {
333  ARMARX_RT_LOGF_WARN("force too large, set to zero");
334  force.setZero();
335  }
336  force_torque_current.head(3) += force;
337  force_torque_current.tail(3) += devi.cross(force);
338  }
339  force_torque = 0.1 * force_torque + 0.9 * force_torque_current;
340  ARMARX_TRACE;
341 
342  Eigen::Vector6f acc =
343  biKacConfig.kmAdmittance.cwiseProduct(force_torque) -
344  biKacConfig.kdAdmittance.cwiseProduct(pair.second.desiredVel);
345 
346  Eigen::Vector6f vel = pair.second.desiredVel + 0.5 * static_cast<float>(deltaT) * (acc + pair.second.desiredAcc);
347  Eigen::VectorXf deltaPose = 0.5 * static_cast<float>(deltaT) * (vel + pair.second.desiredVel);
348  pair.second.desiredAcc = acc;
349  pair.second.desiredVel = vel;
350 
351  Eigen::Matrix3f deltaPoseMat = VirtualRobot::MathTools::rpy2eigen3f(deltaPose(3), deltaPose(4), deltaPose(5));
352  pair.second.desiredPose.block<3, 1>(0, 3) += deltaPose.head(3);
353  pair.second.desiredPose.block<3, 3>(0, 0) = deltaPoseMat * pair.second.desiredPose.block<3, 3>(0, 0);
354 
355  ARMARX_TRACE;
356  auto& slaveArm = limb.at(pair.first);
357  slaveArm->nonRtData.c.desiredPose = pair.second.desiredPose;
358  slaveArm->nonRtData.c.desiredTwist = pair.second.desiredVel;
359  }
360  bufferBiKACConfig.getWriteBuffer() = biKacConfig;
361  bufferBiKACConfig.commitWrite();
362  }
363 
364 
366  {
367  bool rtSafe = true;
368  for (auto& pair: limb)
369  {
370  rtSafe = rtSafe and pair.second->bufferRtToNonRt.getUpToDateReadBuffer().rtSafe;
371  }
372 
373  robotUnit->updateVirtualRobot(nonRtRobot);
374  if (isConstraintReady.load() and isMPReady.load())
375  {
376  updateConstraintStatus(rtSafe);
377  }
378  for (auto& pair : limb)
379  {
380  limbNonRT(pair.second);
381  }
382  }
383 
384  void
386  {
387  arm->bufferConfigNonRtToRt.getWriteBuffer() = arm->nonRtConfig;
388  arm->bufferConfigNonRtToRt.commitWrite();
389  }
390 
391  // void
392  // NJointBiKAC::reInitMPInputOutputData()
393  // {
394  // ARMARX_IMPORTANT << "reconfigure MP: reinitialize the mp input output, as well as the rt related buffer values";
395  // for (auto& _mp: mps)
396  // {
397  // const auto& nodeSetName = _mp.second.mp->getNodeSetName();
398  // ARMARX_CHECK_EQUAL(nodeSetName, limb.at(nodeSetName)->kinematicChainName);
399  // VirtualRobot::RobotNodeSetPtr rns = rtGetRobot()->getRobotNodeSet(nodeSetName);
400  // Eigen::Matrix4f currentPose = rns->getTCP()->getPoseInRootFrame();
401  //
402  // if (_mp.second.mp->getClassName() == "TSMP")
403  // {
404  // ARMARX_IMPORTANT << "init input output data for " << _mp.second.mp->getMPName();
405  // std::dynamic_pointer_cast<mp::TSMPInput>(_mp.second.input)->pose = currentPose;
406  // std::dynamic_pointer_cast<mp::TSMPOutput>(_mp.second.output)->pose = currentPose;
407  // }
408  // else if (_mp.second.mp->getClassName() == "JSMP")
409  // {
410  // ARMARX_IMPORTANT << "init input output data for " << _mp.second.mp->getMPName();
411  // std::dynamic_pointer_cast<mp::JSMPInput>(_mp.second.input)->angleRadian = rns->getJointValuesEigen();
412  // std::dynamic_pointer_cast<mp::JSMPInput>(_mp.second.input)->angularVel = Eigen::VectorXf::Zero(rns->getJointValues().size());
413  // std::dynamic_pointer_cast<mp::JSMPOutput>(_mp.second.output)->angleRadian = rns->getJointValuesEigen();
414  // std::dynamic_pointer_cast<mp::JSMPOutput>(_mp.second.output)->angularVel = Eigen::VectorXf::Zero(rns->getJointValues().size());
415  // }
416  // }
417  // }
418 
419  void
422  const DebugObserverInterfacePrx& debugObs)
423  {
424  for (auto& pair : limb)
425  {
426  limbPublish(pair.second, debugObs);
427  }
428 
429  StringVariantBaseMap datafields;
430  biKacConfigForDebug = bufferBiKACConfig.getUpToDateReadBuffer();
431  for (const auto& c: biKacConfigForDebug.cList)
432  {
433  const std::string idx = std::to_string(c.idx);
434  common::debugEigenPose(datafields, "c_frame_root_" + idx, c.currentFrameRoot);
435  common::debugEigenVec(datafields, "c_kpt_posi_root_" + idx, c.currentKptPoseRoot.block<3, 1>(0, 3));
436  common::debugEigenVec(datafields, "c_kpt_posi_local_" + idx, c.currentKptPoseLocal.block<3, 1>(0, 3));
437  common::debugEigenVec(datafields, "t_kpt_posi_root_" + idx, c.targetKptPoseRoot.block<3, 1>(0, 3));
438  common::debugEigenVec(datafields, "t_kpt_posi_local_" + idx, c.targetKptPoseLocal.block<3, 1>(0, 3));
439  common::debugEigenVec(datafields, "c_force_root" + idx, c.trackingForceRoot);
440  common::debugEigenVec(datafields, "c_force_local" + idx, c.trackingForceLocal);
441  // ARMARX_IMPORTANT << "----------------------- c -----------------------------";
442  // ARMARX_INFO << VAROUT(c.idx) << VAROUT(c.type) << VAROUT(c.rnsFrame) << VAROUT(c.rnsKpt);
443  // ARMARX_INFO << VAROUT(c.currentFrameRoot);
444  // ARMARX_INFO << VAROUT(c.currentKptPoseRoot);
445  // ARMARX_INFO << VAROUT(c.currentKptVelocityRoot);
446  // ARMARX_INFO << VAROUT(c.trackingForce);
447  // ARMARX_IMPORTANT << "-------------------------------------------------------";
448 
449  }
450  for (const auto& pair: biKacConfigForDebug.admittanceData)
451  {
452  common::debugEigenVec(datafields, "ft_" + pair.first, pair.second.forceTorque);
453  common::debugEigenPose(datafields, "virt_pose_" + pair.first, pair.second.desiredPose);
454  common::debugEigenVec(datafields, "virt_vel_" + pair.first, pair.second.desiredVel);
455  }
456 
457  debugObs->setDebugChannel("BiKAC", datafields);
458  }
459 } // namespace armarx::control::njoint_mp_controller::task_space
GfxTL::sqrt
VectorXD< D, T > sqrt(const VectorXD< D, T > &a)
Definition: VectorXD.h:662
armarx::control::njoint_mp_controller::task_space::BiKACConfig::kdAdmittance
Eigen::Vector6f kdAdmittance
Definition: BiKAC.h:84
armarx::control::njoint_mp_controller::task_space::registrationControllerNJointBiKAC
NJointControllerRegistration< NJointBiKAC > registrationControllerNJointBiKAC("NJointBiKAC")
armarx::control::common::debugEigenPose
void debugEigenPose(StringVariantBaseMap &datafields, const std::string &name, Eigen::Matrix4f pose)
Definition: utils.cpp:113
armarx::control::njoint_controller::task_space::NJointTaskspaceImpedanceController
Brief description of class NJointTaskspaceImpedanceController.
Definition: ImpedanceController.h:51
armarx::control::njoint_mp_controller::task_space::NJointBiKAC::mpConfig
MPListConfig mpConfig
this variable is only needed when constructing the MP instances, therefore you don't need to use trip...
Definition: BiKAC.h:131
armarx::control::common::mp::MPPool::isMPReady
std::atomic< bool > isMPReady
Definition: MPPool.h:129
armarx::control::common::mp::MPPool::reconfigureMPs
void reconfigureMPs(const MPListConfig &mpListConfig)
Definition: MPPool.cpp:76
armarx::control::njoint_mp_controller::task_space::NJointBiKAC::biKacConfig
BiKACConfig biKacConfig
Definition: BiKAC.h:132
armarx::StringVariantBaseMap
std::map< std::string, VariantBasePtr > StringVariantBaseMap
Definition: ManagedIceObject.h:111
ARMARX_IMPORTANT
#define ARMARX_IMPORTANT
Definition: Logging.h:183
armarx::control::common::mp::JSMPInputPtr
std::shared_ptr< JSMPInput > JSMPInputPtr
Definition: JSMP.h:47
armarx::control::njoint_mp_controller::task_space::NJointBiKAC::additionalTask
void additionalTask() override
Definition: BiKAC.cpp:365
armarx::control::njoint_mp_controller::task_space::BiKACConfig::cList
std::vector< Constraint > cList
Definition: BiKAC.h:89
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43
armarx::control::njoint_controller::task_space::NJointTaskspaceImpedanceController::limbPublish
void limbPublish(ArmPtr &arm, const DebugObserverInterfacePrx &debugObs)
Definition: ImpedanceController.cpp:502
armarx::control::njoint_mp_controller::task_space::NJointBiKAC::bufferBiKACConfig
TripleBuffer< BiKACConfig > bufferBiKACConfig
Definition: BiKAC.h:143
armarx::control::common::mp::JSMPOutputPtr
std::shared_ptr< JSMPOutput > JSMPOutputPtr
Definition: JSMP.h:48
armarx::MPPoolInterface::getMPConfig
armarx::aron::data::dto::Dict getMPConfig()
armarx::control::njoint_mp_controller::task_space::BiKACConfig::kmAdmittance
Eigen::Vector6f kmAdmittance
Definition: BiKAC.h:85
armarx::detail::ControlThreadOutputBufferEntry
Definition: ControlThreadOutputBuffer.h:177
armarx::control::njoint_controller::task_space::NJointTaskspaceImpedanceController::ArmPtr
std::unique_ptr< ArmData > ArmPtr
Definition: ImpedanceController.h:97
ARMARX_TRACE
#define ARMARX_TRACE
Definition: trace.h:69
armarx::control::njoint_mp_controller::task_space::BiKACConfig::admittanceData
std::map< std::string, AdmittanceData > admittanceData
Definition: BiKAC.h:86
armarx::control::common::mp::TSMPOutputPtr
std::shared_ptr< TSMPOutput > TSMPOutputPtr
Definition: TSMP.h:47
armarx::control::njoint_mp_controller::task_space::NJointBiKAC::updateBiKACConfig
void updateBiKACConfig(const ::armarx::aron::data::dto::DictPtr &dto, const Ice::Current &iceCurrent=Ice::emptyCurrent) override
Definition: BiKAC.cpp:97
armarx::control::njoint_mp_controller::task_space::NJointBiKAC::NJointBiKAC
NJointBiKAC(const RobotUnitPtr &robotUnit, const NJointControllerConfigPtr &config, const VirtualRobot::RobotPtr &)
Definition: BiKAC.cpp:35
armarx::control::njoint_controller::task_space::NJointTaskspaceImpedanceController::nonRtRobot
VirtualRobot::RobotPtr nonRtRobot
Definition: ImpedanceController.h:161
armarx::control::common::mp::MPPool::reInitMPInputOutputData
void reInitMPInputOutputData(const std::map< std::string, VirtualRobot::RobotNodeSetPtr > &rnsMap)
Definition: MPPool.cpp:545
max
T max(T t1, T t2)
Definition: gdiam.h:48
armarx::control::njoint_mp_controller::task_space::NJointBiKAC::onPublish
void onPublish(const SensorAndControl &, const DebugDrawerInterfacePrx &, const DebugObserverInterfacePrx &) override
Definition: BiKAC.cpp:420
armarx::to_string
const std::string & to_string(const std::string &s)
Definition: StringHelpers.h:40
armarx::control::common::debugEigenVec
void debugEigenVec(StringVariantBaseMap &datafields, const std::string &name, Eigen::VectorXf vec)
Definition: utils.cpp:125
utils.h
armarx::control::njoint_mp_controller::task_space
This file is part of ArmarX.
Definition: AdmittanceController.cpp:26
armarx::control::njoint_mp_controller::task_space::NJointBiKAC::getClassName
std::string getClassName(const Ice::Current &=Ice::emptyCurrent) const override
Definition: BiKAC.cpp:47
armarx::aron::data::DictPtr
std::shared_ptr< Dict > DictPtr
Definition: Dict.h:41
GfxTL::Matrix3f
MatrixXX< 3, 3, float > Matrix3f
Definition: MatrixXX.h:600
ARMARX_INFO
#define ARMARX_INFO
Definition: Logging.h:174
VAROUT
#define VAROUT(x)
Definition: StringHelpers.h:182
armarx::control::NJointBiKACInterface::getBiKACConfig
armarx::aron::data::dto::Dict getBiKACConfig()
armarx::control::njoint_controller::task_space::NJointTaskspaceImpedanceController::limb
std::map< std::string, ArmPtr > limb
Definition: ImpedanceController.h:160
IceInternal::ProxyHandle<::IceProxy::armarx::DebugDrawerInterface >
dot
double dot(const Point &x, const Point &y)
Definition: point.hpp:53
armarx::control::common::mp::MPPool
Definition: MPPool.h:47
BiKAC.h
Eigen::Matrix< float, 6, 1 >
armarx::control::njoint_mp_controller::task_space::NJointBiKAC::limbNonRT
void limbNonRT(ArmPtr &arm)
Definition: BiKAC.cpp:385
armarx::control::common::mp::MPPool::mps
std::map< std::string, MPInputOutput > mps
Definition: MPPool.h:127
armarx::control::common::mp::TSMPInputPtr
std::shared_ptr< TSMPInput > TSMPInputPtr
Definition: TSMP.h:46
min
T min(T t1, T t2)
Definition: gdiam.h:42
ARMARX_WARNING
#define ARMARX_WARNING
Definition: Logging.h:186
ARMARX_RT_LOGF_WARN
#define ARMARX_RT_LOGF_WARN(...)
Definition: ControlThreadOutputBuffer.h:345
armarx::transpose
std::vector< std::vector< T > > transpose(const std::vector< std::vector< T >> &src, Thrower thrower)
Definition: SimoxCSpace.cpp:706
armarx::control::njoint_mp_controller::task_space::NJointBiKAC::biKacConfigForDebug
BiKACConfig biKacConfigForDebug
Definition: BiKAC.h:144
armarx::control::njoint_controller::task_space::NJointTaskspaceImpedanceController::robotUnit
RobotUnitPtr robotUnit
Definition: ImpedanceController.h:162
armarx::control::njoint_mp_controller::task_space::NJointBiKAC::updateMPConfig
void updateMPConfig(const ::armarx::aron::data::dto::DictPtr &dto, const Ice::Current &iceCurrent=Ice::emptyCurrent) override
Definition: BiKAC.cpp:53
VirtualRobot::RobotPtr
std::shared_ptr< class Robot > RobotPtr
Definition: Bus.h:18
armarx::control::common::mp::MPPool::isFinished
bool isFinished(const std::string &mpName="all", const Ice::Current &iceCurrent=Ice::emptyCurrent) override
Definition: MPPool.cpp:317
armarx::control::njoint_mp_controller::task_space::NJointBiKAC::updateConstraintStatus
void updateConstraintStatus(const bool rtSafe)
Definition: BiKAC.cpp:183