KVILImpedanceController.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  * @package ...
17  * @author Jianfeng Gao ( jianfeng dot gao at kit dot edu )
18  * @date 2023
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
27 
28 
30 {
31 NJointControllerRegistration<NJointKVILImpedanceMPController> registrationControllerNJointKVILImpedanceMPController("NJointKVILImpedanceMPController");
32 
34  const RobotUnitPtr& robotUnit,
35  const NJointControllerConfigPtr& config,
36  const VirtualRobot::RobotPtr& robot):
38  mp::MPPool{}
39 {
40  {
41  ConfigPtrT cfg = ConfigPtrT::dynamicCast(config);
42  auto configData = ::armarx::fromAronDict<AronDTO, BO>(cfg->config);
43  validateConfigData(configData);
44  bufferUserToAdditionalTask.reinitAllBuffers(configData);
45  bufferAdditionalTaskToUser.reinitAllBuffers(configData);
46  bufferUserToRt.reinitAllBuffers(configData);
47  ARMARX_IMPORTANT << VAROUT(configData.mpList.size());
48  createMPs(configData.mpList);
49 
50 // configureConstraints(configData.constraintList);
51  }
52  ARMARX_IMPORTANT << "NJointTSImpedanceMPController construction done";
53 // const auto& cfg = bufferUserToAdditionalTask.getUpToDateReadBuffer();
54 // createMPs(cfg.mpConfig);
55 // configureConstraints(cfg);
56 }
57 
58 std::string NJointKVILImpedanceMPController::getClassName(const Ice::Current &) const
59 {
60  return "NJointKVILImpedanceMPController";
61 }
62 
63 //void NJointKVILImpedanceMPController::reconfigureController(const std::string &filename, const Ice::Current &)
64 //{
65 // NJointKeypointsImpedanceController::reconfigureController(filename);
66 // reconfigureMPs(filename);
67 //}
68 
70 {
72  if (isFinished("all"))
73  {
74  isMPReady.store(false);
76  reconfigureMPs(cfg.mpList);
77 // configureConstraints(cfg);
78  isMPReady.store(true);
79  }
80 }
81 
82 
84 NJointKVILImpedanceMPController::getConfig(const Ice::Current& iceCurrent)
85 {
86  return ::armarx::toAronDict<AronDTO, BO>(bufferAdditionalTaskToUser.getUpToDateReadBuffer());
87 }
88 
89 
91 {
92 // n_constraints = c.size();
93 // for (int i = 0; i < n_constraints; i ++)
94 // {
95 // std::string name = "mp_"+std::to_string(i);
96 // auto c = mp_cfg[name];
97 // ConstraintPtr constraint(new Constraint());
98 // constraint->type = c["constraint_type"];
99 // ARMARX_INFO << VAROUT(constraint->type);
100 //
101 // constraint->localFrameOrigin = c["local_frame_origin_obs"];
102 // ARMARX_CHECK_EQUAL(constraint->localFrameOrigin.size(), 3);
103 // ARMARX_INFO << VAROUT(constraint->localFrameOrigin);
104 //
105 // constraint->localFrameRotMat = c["local_frame_rot_mat_obs"];
106 // ARMARX_CHECK_EQUAL(constraint->localFrameRotMat.cols(), 3);
107 // ARMARX_CHECK_EQUAL(constraint->localFrameRotMat.rows(), 3);
108 // ARMARX_INFO << VAROUT(constraint->localFrameRotMat);
109 //
110 // constraint->vmpStart = common::getEigenVec(c, c, "vmp_start");
111 // ARMARX_INFO << VAROUT(constraint->vmpStart);
112 // if (c["manifold"] == "linear")
113 // {
114 // constraint->pcaMean = c["pca_mean"];
115 // constraint->pcaComponents = c["pca_components"];
116 // ARMARX_CHECK_EQUAL(constraint->pcaMean.size(), 3);
117 // ARMARX_CHECK_EQUAL(constraint->pcaComponents.cols(), 3);
118 // ARMARX_CHECK_EQUAL(constraint->pcaComponents.rows(), 3);
119 // ARMARX_IMPORTANT << VAROUT(constraint->pcaMean) << VAROUT(constraint->pcaComponents);
120 // }
121 // else
122 // {
123 // constraint->pcaMean.setZero();
124 // constraint->pcaComponents.setZero();
125 // }
126 // if (constraint->type == "p2c")
127 // {
128 // // constraint->pcaMean = c["pca_mean"];
129 // constraint->pm_scale = c["pm_scale"];
130 // constraint->pm_init_proj_point = common::getEigenVec(c, c, "pm_init_proj_point");
131 // constraint->pm_init_tangent_vec = common::getEigenVec(c, c, "pm_init_tangent_vec");
132 // constraint->pm_init_proj_value = c["pm_init_proj_value"];
133 //
134 // ARMARX_INFO << VAROUT(constraint->pm_init_proj_point)
135 // << VAROUT(constraint->pm_init_tangent_vec)
136 // << VAROUT(constraint->pm_init_proj_value);
137 //
138 // NonlinearManifoldInfoStruct curve_info;
139 // curve_info.pm_proj_point = constraint->pm_init_proj_point;
140 // curve_info.pm_proj_point_to_mean_distance = constraint->pm_init_proj_value;
141 // curve_info.pm_tangent_vec = constraint->pm_init_tangent_vec;
142 // nl_mani_buffer.reinitAllBuffers(curve_info);
143 //
144 // p2CStruct p2c_data;
145 // p2c_data.curve_kpt_position = common::getEigenVec(c, c, "pm_imit_kpts_position_local");
146 // kpt_status_buffer.reinitAllBuffers(p2c_data);
147 //
148 // // ARMARX_CHECK_EQUAL(constraint->pcaMean.size(), 3);
149 // // ARMARX_IMPORTANT << VAROUT(constraint->pcaMean);
150 // }
151 // if (constraint->type == "p2l" or constraint->type == "p2P" or constraint->type == "p2c")
152 // {
153 // constraint->priority = c["priority"];
154 // constraint->density_std_dev = c["density_std_dev"];
155 // constraint->density_weights = getEigenVec(c, c, "density_weights");
156 // ARMARX_IMPORTANT << VAROUT(constraint->priority) << VAROUT(constraint->density_std_dev) << VAROUT(constraint->density_weights);
157 // getEigenMatrix(c, "density_mu", constraint->density_mu);
158 // ARMARX_IMPORTANT << VAROUT(constraint->density_mu);
159 // ARMARX_CHECK_EQUAL(constraint->density_mu.rows(), constraint->density_weights.size());
160 // // ARMARX_CHECK_EQUAL(constraint->density_mu.cols(), 1);
161 // }
162 // else
163 // {
164 // constraint->density_mu = Eigen::Matrix1f::Zero();
165 // constraint->density_weights.setZero(0);
166 // }
167 // constraint->spatial_scale = c["spatial_scale"];
168 // constraints.insert({name, constraint});
169 // ARMARX_INFO << " -- added constraint: " << name;
170 // }
171 // ARMARX_IMPORTANT << "--------------------------------------- Done! ---------------------------------------";
172 }
173 
174 void NJointKVILImpedanceMPController::setCurveProjection(const Eigen::Vector3f &curve_proj_point_, float proj_value_, const Eigen::Vector3f &curve_vec_, const Ice::Current &)
175 {
176  nl_mani_buffer.getWriteBuffer().pm_proj_point = curve_proj_point_;
177  nl_mani_buffer.getWriteBuffer().pm_proj_point_to_mean_distance = proj_value_;
178  nl_mani_buffer.getWriteBuffer().pm_tangent_vec = curve_vec_;
179  nl_mani_buffer.commitWrite();
180  // curve_proj_point = curve_proj_point_;
181  // curve_proj_point_to_mean_distance = proj_value_;
182  // vec_to_min_on_curve = curve_vec_;
183  // curve_set.store(true);
184 }
185 
187 {
188  return kpt_status_buffer.getUpToDateReadBuffer().curve_kpt_position;
189 }
190 
192 {
193 // Eigen::VectorXf kptsPosition = controlStatusBuffer.getReadBuffer().filteredKeypointPosition;
194 // Eigen::VectorXf kptsVelocity = controlStatusBuffer.getReadBuffer().currentKeypointVelocity;
195 // double deltaT = controlStatusBuffer.getReadBuffer().deltaT;
196 // ARMARX_CHECK_EQUAL(kptsPosition.size(), n_constraints * 3);
197 // ARMARX_CHECK_EQUAL(kptsVelocity.size(), n_constraints * 3);
198 //
199 // /// parse arguments and run mp
200 //// ARMARX_INFO << VAROUT(controller.s.numPoints) << VAROUT(kptsPosition) << VAROUT(kptsVelocity) << VAROUT(deltaT);
201 // for (int i = 0; i < n_constraints; i++)
202 // {
203 // std::string name = "mp_"+std::to_string(i);
204 // mp::KeypointsMPInputPtr in = std::dynamic_pointer_cast<mp::KeypointsMPInput>(mps[name].input);
205 //
206 // auto c = constraints[name];
207 // Eigen::Vector3f kptPositionLocal = c->localFrameRotMat.transpose() * (kptsPosition.segment(3*i, 3) - c->localFrameOrigin);
208 // Eigen::Vector3f kptVelocityLocal = c->localFrameRotMat.transpose() * kptsVelocity.segment(3*i, 3);
209 // if (c->type == "p2p"/* or c->type == "p2c"*/)
210 // {
211 // in->keypointPosition = kptPositionLocal;
212 // in->keypointVelocity = kptVelocityLocal;
213 // }
214 //
215 //
216 // else if (c->type == "p2c")
217 // {
218 // kpt_status_buffer.getWriteBuffer().curve_kpt_position = kptPositionLocal;
219 // kpt_status_buffer.commitWrite();
220 //
221 // Eigen::Vector3f devi_vec = kptPositionLocal - nl_mani_buffer.getUpToDateReadBuffer().pm_proj_point;
222 // float dist = devi_vec.norm();
223 // devi_vec /= dist;
224 // float vel_proj = kptVelocityLocal.dot(devi_vec);
225 // in->keypointPosition(0) = dist; // c->pcaComponents.row(0).cross(kptPositionLocal - c->pcaMean).norm();
226 // in->keypointVelocity(0) = vel_proj;
227 // }
228 //
229 //
230 //
231 // else if (c->type == "p2l")
232 // {
233 // Eigen::Vector3f line_vec = c->pcaComponents.row(0);
234 // float proj_value = line_vec.dot(kptPositionLocal - c->pcaMean);
235 // Eigen::Vector3f proj_point = c->pcaMean + proj_value * line_vec;
236 // Eigen::Vector3f devi_vec = kptPositionLocal - proj_point;
237 // float dist = devi_vec.norm();
238 // devi_vec /= dist;
239 // float vel_proj = kptVelocityLocal.dot(devi_vec);
240 // in->keypointPosition(0) = dist; // c->pcaComponents.row(0).cross(kptPositionLocal - c->pcaMean).norm();
241 // in->keypointVelocity(0) = vel_proj;
242 // }
243 // else if (c->type == "p2P")
244 // {
245 // Eigen::Vector3f plane_norm_vec = c->pcaComponents.row(2);
246 // in->keypointPosition(0) = plane_norm_vec.dot(kptPositionLocal - c->pcaMean);
247 // in->keypointVelocity(0) = plane_norm_vec.dot(kptVelocityLocal);
248 // }
249 // in->deltaT = deltaT;
250 // }
251 // {
252 // // null space mp
253 // mp::JSMPInputPtr in = std::dynamic_pointer_cast<mp::JSMPInput>(mps["null"].input);
254 // in->angleRadian = controlStatusBuffer.getReadBuffer().qpos;
255 // in->angularVel = controlStatusBuffer.getReadBuffer().qvel;
256 // in->deltaT = controlStatusBuffer.getReadBuffer().deltaT;
257 // }
258 //
259 // runMPs();
260 //
261 // Eigen::VectorXf targetKeypointPosition;
262 // Eigen::VectorXf targetKeypointVelocity;
263 // Eigen::VectorXf targetDensityForce;
264 // targetKeypointPosition.setZero(kptsPosition.size());
265 // targetKeypointVelocity.setZero(kptsPosition.size());
266 // targetDensityForce.setZero(kptsPosition.size());
267 // /// parse mp target
268 // for (int i = 0; i < n_constraints; i++)
269 // {
270 // std::string name = "mp_"+std::to_string(i);
271 // mp::KeypointsMPOutputPtr out = std::dynamic_pointer_cast<mp::KeypointsMPOutput>(mps[name].output);
272 //
273 // auto c = constraints[name];
274 // Eigen::Vector3f kptPositionLocal = c->localFrameRotMat.transpose() * (kptsPosition.segment(3*i, 3) - c->localFrameOrigin);
275 //
276 // Eigen::Vector3f targetPosition;
277 // Eigen::Vector3f targetVelocity;
278 // Eigen::Vector3f density_force = Eigen::Vector3f::Zero();
279 //
280 // if (c->type == "p2p"/* or c->type == "p2c"*/)
281 // {
282 // targetPosition = out->keypointPosition;
283 // targetVelocity = out->keypointVelocity;
284 // }
285 //
286 //
287 // else if (c->type == "p2c")
288 // {
289 //// LockGuardType guard {curveDataMutex};
290 //// if (curve_set.load())
291 //// {
292 //
293 // Eigen::Vector3f curve_proj_point = nl_mani_buffer.getUpToDateReadBuffer().pm_proj_point;
294 // Eigen::Vector3f curve_tangent_vec = nl_mani_buffer.getUpToDateReadBuffer().pm_tangent_vec;
295 // float curve_proj_point_to_mean_distance = nl_mani_buffer.getUpToDateReadBuffer().pm_proj_point_to_mean_distance;
296 //
297 // Eigen::Vector3f devi_vec = kptPositionLocal - curve_proj_point;
298 // float dist = devi_vec.norm();
299 // devi_vec /= dist;
300 //
301 // /// density force
302 // // float kp = 0.0f;
303 // // if (curve_proj_point_to_mean_distance > 100.0f)
304 // // {
305 // // kp = std::signbit(curve_proj_point_to_mean_distance) ? -1 : 1 * 100.0f;
306 // // }
307 // // else
308 // // {
309 // // kp = curve_proj_point_to_mean_distance;
310 // // }
311 // Eigen::Vector3f base_force = - curve_tangent_vec * curve_proj_point_to_mean_distance * 0.0000015f;
312 // base_force = c->localFrameRotMat * base_force;
313 //
314 // Eigen::Vector1f prob_derivative = Eigen::Vector1f::Zero();
315 // Eigen::Vector1f data {curve_proj_point_to_mean_distance};
316 // for (int i = 0; i < c->density_mu.rows(); i++)
317 // {
318 // prob_derivative = prob_derivative + pdf_gradient(c->density_mu.row(i), c->density_std_dev, data);
319 // }
320 // density_force = prob_derivative(0) * curve_tangent_vec * 10.0f;
321 // density_force = c->localFrameRotMat * density_force;
322 //
323 // if (base_force.norm() > density_force.norm())
324 // {
325 // ARMARX_RT_LOGF_INFO("use base force");
326 // density_force = base_force;
327 // }
328 //
329 // /// priority
330 // if (c->priority > 0)
331 // {
332 // if (constraints["mp_0"]->type == "p2p")
333 // {
334 // /// already in root frame
335 // Eigen::Vector3f devi = kptsPosition.segment(3*i, 3) - kptsPosition.segment(0, 3);
336 // Eigen::Vector3f line_vec_root = c->localFrameRotMat * curve_tangent_vec;
337 // Eigen::Vector3f tang_vec = devi.cross(line_vec_root).cross(devi);
338 // tang_vec.normalize();
339 // float force_proj = density_force.dot(tang_vec);
340 // density_force = force_proj * tang_vec;
341 // }
342 // }
343 //
344 // targetPosition = curve_proj_point + devi_vec * out->keypointPosition(0);
345 // targetVelocity = devi_vec * out->keypointVelocity(0);
346 //
347 // // }
348 // // else
349 // // {
350 // // targetPosition = kptsPosition.segment(3*i, 3);
351 // // targetVelocity.setZero();
352 // // }
353 // }
354 //
355 //
356 // else if (c->type == "p2l")
357 // {
358 // Eigen::Vector3f line_vec = c->pcaComponents.row(0);
359 // float proj_value = line_vec.dot(kptPositionLocal - c->pcaMean);
360 // Eigen::Vector3f proj_point = c->pcaMean + proj_value * line_vec;
361 // Eigen::Vector3f devi_vec = kptPositionLocal - proj_point;
362 // float dist = devi_vec.norm();
363 // devi_vec /= dist;
364 //
365 // /// density force
366 // float kp = 0.0f;
367 // if (abs(proj_value) > 100.0f)
368 // {
369 // kp = std::signbit(proj_value) ? -1 : 1 * 100.0f;
370 // }
371 // else
372 // {
373 // kp = proj_value;
374 // }
375 // Eigen::Vector3f base_force = - c->pcaComponents.row(0) * proj_value * 0.0000015f;
376 // base_force = c->localFrameRotMat * base_force;
377 //
378 // Eigen::Vector1f prob_derivative = Eigen::Vector1f::Zero();
379 // Eigen::Vector1f data {proj_value};
380 // for (int i = 0; i < c->density_mu.rows(); i++)
381 // {
382 // prob_derivative = prob_derivative + pdf_gradient(c->density_mu.row(i), c->density_std_dev, data);
383 // }
384 // density_force = prob_derivative(0) * c->pcaComponents.row(0) * 10.0f;
385 // density_force = c->localFrameRotMat * density_force;
386 //
387 // if (base_force.norm() > density_force.norm())
388 // {
389 // ARMARX_RT_LOGF_INFO("use base force");
390 // density_force = base_force;
391 // }
392 //
393 // /// priority
394 // if (c->priority > 0)
395 // {
396 // if (constraints["mp_0"]->type == "p2p")
397 // {
398 // /// already in root frame
399 // Eigen::Vector3f devi = kptsPosition.segment(3*i, 3) - kptsPosition.segment(0, 3);
400 // Eigen::Vector3f line_vec_local = c->pcaComponents.row(0);
401 // Eigen::Vector3f line_vec_root = c->localFrameRotMat * line_vec_local;
402 // Eigen::Vector3f tang_vec = devi.cross(line_vec_root).cross(devi);
403 // tang_vec.normalize();
404 // float force_proj = density_force.dot(tang_vec);
405 // density_force = force_proj * tang_vec;
406 // }
407 // }
408 //
409 // targetPosition = proj_point + devi_vec * out->keypointPosition(0);
410 // targetVelocity = devi_vec * out->keypointVelocity(0);
411 // }
412 // else if (c->type == "p2P")
413 // {
414 // Eigen::Vector3f proj_value_vec = c->pcaComponents * (kptPositionLocal - c->pcaMean);
415 // Eigen::Vector3f plane_norm_vec = c->pcaComponents.row(2);
416 // Eigen::Vector3f proj_point = kptPositionLocal - plane_norm_vec * proj_value_vec(2);
417 //
418 // /// density force
419 // Eigen::Vector2f proj_value_on_plane = proj_value_vec.head(2);
420 // proj_value_on_plane.normalize();
421 //
422 // Eigen::Vector3f base_force = - c->pcaComponents.row(0) * proj_value_on_plane(0) - c->pcaComponents.row(1) * proj_value_on_plane(1);
423 // base_force = c->localFrameRotMat * base_force;
424 //
425 // Eigen::Vector2f prob_derivative = Eigen::Vector2f::Zero();
426 // Eigen::Vector2f data = proj_value_vec.head(2);
427 // for (int i = 0; i < c->density_mu.rows(); i++)
428 // {
429 // prob_derivative = prob_derivative + pdf_gradient(c->density_mu.row(i), c->density_std_dev, data);
430 // }
431 // density_force = (prob_derivative(0) * c->pcaComponents.row(0) + prob_derivative(1) * c->pcaComponents.row(1)) * 10.0f;
432 // density_force = c->localFrameRotMat * density_force;
433 //
434 // if (base_force.norm() > density_force.norm())
435 // {
436 // ARMARX_RT_LOGF_INFO("use base force");
437 // density_force = base_force;
438 // }
439 //
440 // /// handle priority
441 // if (c->priority > 0)
442 // {
443 // if (constraints["mp_0"]->type == "p2p")
444 // {
445 // Eigen::Vector3f devi = kptsPosition.segment(3*i, 3) - kptsPosition.segment(0, 3);
446 // Eigen::Vector3f plane_norm_vec_root = c->localFrameRotMat * plane_norm_vec;
447 // Eigen::Vector3f tang_vec = devi.cross(plane_norm_vec_root);
448 // tang_vec.normalize();
449 // float force_proj = density_force.dot(tang_vec);
450 // density_force = force_proj * tang_vec;
451 // }
452 // }
453 //
454 //
455 // targetPosition = proj_point + plane_norm_vec * out->keypointPosition(0);
456 // targetVelocity = out->keypointVelocity(0) * plane_norm_vec;
457 // }
458 // targetKeypointPosition.segment(3*i, 3) = c->localFrameRotMat * targetPosition + c->localFrameOrigin;
459 // targetKeypointVelocity.segment(3*i, 3) = c->localFrameRotMat * targetVelocity;
460 // targetDensityForce.segment(3*i, 3) = density_force;
461 // }
462 // ARMARX_CHECK_EQUAL(targetKeypointPosition.size(), n_constraints * 3);
463 // ARMARX_CHECK_EQUAL(targetKeypointVelocity.size(), n_constraints * 3);
464 // ARMARX_CHECK_EQUAL(targetDensityForce.size(), n_constraints * 3);
465 // getWriterControlStruct().desiredKeypointPosition = targetKeypointPosition;
466 // getWriterControlStruct().desiredKeypointVelocity = targetKeypointVelocity;
467 // getWriterControlStruct().desiredDensityForce = targetDensityForce;
468 // {
469 // mp::JSMPOutputPtr out = std::dynamic_pointer_cast<mp::JSMPOutput>(mps["null"].output);
470 // getWriterControlStruct().desiredNullspaceJointAngles = out->angleRadian;
471 // }
472 // writeControlStruct();
473 }
474 
476 {
477 // ARMARX_IMPORTANT << "rt pre activate: reinitialize the mp input output, as well as the rt related buffer values";
478 // NJointKeypointsImpedanceController::rtPreActivateController();
479 // for (int i = 0; i < controller.s.numPoints; i++)
480 // {
481 // std::string name = "mp_"+std::to_string(i);
482 //
483 // ARMARX_INFO << "initialize " << name;
484 //
485 // auto in = std::dynamic_pointer_cast<mp::KeypointsMPInput>(mps[name].input);
486 // auto out = std::dynamic_pointer_cast<mp::KeypointsMPOutput>(mps[name].output);
487 // auto c = constraints[name];
488 //
489 // in->keypointPosition = c->vmpStart;
490 // out->keypointPosition = c->vmpStart;
491 //
492 // if (c->type == "p2p")
493 // {
494 // in->keypointVelocity = controller.s.currentKeypointVelocity;
495 // out->keypointVelocity = controller.s.currentKeypointVelocity;
496 // }
497 // else if (c->type == "p2l")
498 // {
499 // in->keypointVelocity = Eigen::Vector1f::Zero();
500 // out->keypointVelocity = Eigen::Vector1f::Zero();
501 // }
502 // else if (c->type == "p2P")
503 // {
504 // in->keypointVelocity = Eigen::Vector1f::Zero();
505 // out->keypointVelocity = Eigen::Vector1f::Zero();
506 // }
507 // else if (c->type == "p2c")
508 // {
509 // in->keypointVelocity = Eigen::Vector1f::Zero();
510 // out->keypointVelocity = Eigen::Vector1f::Zero();
511 // }
512 // }
513 // {
514 // ARMARX_IMPORTANT << "initialize input output buffers between nullspace mp";
515 // auto in = std::dynamic_pointer_cast<mp::JSMPInput>(mps["null"].input);
516 // auto out = std::dynamic_pointer_cast<mp::JSMPOutput>(mps["null"].output);
517 // in->angleRadian = controller.s.qpos;
518 // in->angularVel = controller.s.qvel;
519 // in->deltaT = 0.0;
520 // out->angleRadian = controller.s.qpos;
521 // out->angularVel = controller.s.qvel;
522 // }
523 }
524 } /// namespace armarx::control::njoint_mp_controller::task_space
KVILImpedanceController.h
armarx::control::njoint_controller::task_space::NJointKeypointsImpedanceController::robotUnit
RobotUnitPtr robotUnit
Definition: KeypointsImpedanceController.h:116
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::TripleBuffer::getWriteBuffer
T & getWriteBuffer()
Definition: TripleBuffer.h:90
ARMARX_IMPORTANT
#define ARMARX_IMPORTANT
Definition: Logging.h:183
armarx::control::njoint_controller::task_space::NJointKeypointsImpedanceController
Brief description of class NJointKeypointsImpedanceController.
Definition: KeypointsImpedanceController.h:52
armarx::control::common::control_law::collision::validateConfigData
void validateConfigData(arondto::CollisionAvoidanceConfig &cfg)
Definition: CollisionAvoidance.cpp:1616
armarx::control::njoint_mp_controller::task_space::NJointKVILImpedanceMPController::NJointKVILImpedanceMPController
NJointKVILImpedanceMPController(const RobotUnitPtr &robotUnit, const NJointControllerConfigPtr &config, const VirtualRobot::RobotPtr &)
Definition: KVILImpedanceController.cpp:33
armarx::TripleBuffer::commitWrite
void commitWrite()
Definition: TripleBuffer.h:146
armarx::control::njoint_mp_controller::task_space::ConstraintList
std::vector< Constraint1 > ConstraintList
Definition: KVILImpedanceController.h:57
armarx::control::NJointKVILImpedanceMPControllerInterface::getCurveKeypointPosition
Eigen::Vector3f getCurveKeypointPosition()
armarx::control::njoint_mp_controller::task_space::NJointKVILImpedanceMPController::bufferAdditionalTaskToUser
TripleBuffer< BO > bufferAdditionalTaskToUser
Definition: KVILImpedanceController.h:127
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43
math.h
armarx::control::njoint_mp_controller::task_space::NJointKVILImpedanceMPController::updateConfig
void updateConfig(const ::armarx::aron::data::dto::DictPtr &dto, const Ice::Current &iceCurrent=Ice::emptyCurrent) override
Definition: KVILImpedanceController.cpp:69
armarx::control::njoint_mp_controller::task_space::registrationControllerNJointKVILImpedanceMPController
NJointControllerRegistration< NJointKVILImpedanceMPController > registrationControllerNJointKVILImpedanceMPController("NJointKVILImpedanceMPController")
armarx::control::njoint_mp_controller::task_space::NJointKVILImpedanceMPController::getConfig
::armarx::aron::data::dto::DictPtr getConfig(const Ice::Current &iceCurrent=Ice::emptyCurrent) override
Definition: KVILImpedanceController.cpp:84
utils.h
armarx::control::njoint_mp_controller::task_space
This file is part of ArmarX.
Definition: AdmittanceController.cpp:26
armarx::aron::data::DictPtr
std::shared_ptr< Dict > DictPtr
Definition: Dict.h:41
armarx::control::njoint_mp_controller::task_space::NJointKVILImpedanceMPController::rtPreActivateController
void rtPreActivateController() override
This function is called before the controller is activated.
Definition: KVILImpedanceController.cpp:475
VAROUT
#define VAROUT(x)
Definition: StringHelpers.h:182
armarx::control::njoint_controller::task_space::NJointKeypointsImpedanceController::updateConfig
void updateConfig(const ::armarx::aron::data::dto::DictPtr &dto, const Ice::Current &iceCurrent=Ice::emptyCurrent) override
NJointController interface.
Definition: KeypointsImpedanceController.cpp:191
armarx::control::njoint_mp_controller::task_space::NJointKVILImpedanceMPController::setCurveProjection
void setCurveProjection(const Eigen::Vector3f &curve_proj_point_, float proj_value_, const Eigen::Vector3f &curve_vec_, const Ice::Current &) override
Definition: KVILImpedanceController.cpp:174
armarx::control::njoint_mp_controller::task_space::NJointKVILImpedanceMPController::additionalTask
void additionalTask() override
Definition: KVILImpedanceController.cpp:191
armarx::control::common::mp::MPPool
Definition: MPPool.h:47
armarx::control::njoint_mp_controller::task_space::NJointKVILImpedanceMPController::bufferUserToAdditionalTask
TripleBuffer< BO > bufferUserToAdditionalTask
Definition: KVILImpedanceController.h:126
aron_conversions.h
armarx::TripleBuffer::getUpToDateReadBuffer
const T & getUpToDateReadBuffer() const
Definition: TripleBuffer.h:108
armarx::control::njoint_mp_controller::task_space::NJointKVILImpedanceMPController::getClassName
std::string getClassName(const Ice::Current &) const override
Definition: KVILImpedanceController.cpp:58
armarx::control::njoint_mp_controller::task_space::NJointKVILImpedanceMPController::configureConstraints
void configureConstraints(const ConstraintList &c)
Definition: KVILImpedanceController.cpp:90
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