ZeroTorqueOrVelocityController.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 2024
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22
24
25#include <VirtualRobot/MathTools.h>
26#include <VirtualRobot/Nodes/RobotNode.h>
27#include <VirtualRobot/RobotNodeSet.h>
28
34
38
41
43{
44 NJointControllerRegistration<NJointTaskspaceZeroTorqueOrVelocityController>
46 "NJointTaskspaceZeroTorqueOrVelocityController");
47
48 void
50 ArmPtr& arm,
51 Config cfg,
52 VirtualRobot::RobotPtr& nonRtRobotPtr)
53 {
54 arm->kinematicChainName = nodeSetName;
55 VirtualRobot::RobotNodeSetPtr rtRns =
56 rtGetRobot()->getRobotNodeSet(arm->kinematicChainName);
57 VirtualRobot::RobotNodeSetPtr nonRtRns =
58 nonRtRobotPtr->getRobotNodeSet(arm->kinematicChainName);
59 ARMARX_CHECK_EXPRESSION(rtRns) << arm->kinematicChainName;
60 ARMARX_CHECK_EXPRESSION(nonRtRns) << arm->kinematicChainName;
62 << "Creating Taskspace Zero Torque or Velocity Controller with kinematic chain: "
63 << arm->kinematicChainName << " with num of joints: (RT robot) " << rtRns->getSize()
64 << ", and (non-RT robot) " << nonRtRns->getSize();
65
66 std::vector<size_t> jointIDTorqueMode;
67 std::vector<size_t> jointIDVelocityMode;
68 arm->jointNames.clear();
69 for (size_t i = 0; i < rtRns->getSize(); ++i)
70 {
71
72 std::string jointName = rtRns->getNode(i)->getName();
73 arm->jointNames.push_back(jointName);
74
75 bool foundControlDevice = false;
76 auto it = std::find(
77 cfg.jointNameListTorque.begin(), cfg.jointNameListTorque.end(), jointName);
78 if (it != cfg.jointNameListTorque.end())
79 {
80 ControlTargetBase* ct = useControlTarget(jointName, ControlModes::ZeroTorque1DoF);
82 auto* casted_ct = ct->asA<ControlTarget1DoFActuatorZeroTorque>();
83 ARMARX_CHECK_EXPRESSION(casted_ct);
84 arm->targetsTorque.push_back(casted_ct);
85 jointIDTorqueMode.push_back(i);
86 foundControlDevice = true;
87 }
88
89 it = std::find(
90 cfg.jointNameListVelocity.begin(), cfg.jointNameListVelocity.end(), jointName);
91 if (it != cfg.jointNameListVelocity.end())
92 {
93 ControlTargetBase* ct = useControlTarget(jointName, ControlModes::ZeroVelocity1DoF);
95 auto* casted_ct = ct->asA<ControlTarget1DoFActuatorZeroVelocity>();
96 ARMARX_CHECK_EXPRESSION(casted_ct);
97 arm->targetsVel.push_back(casted_ct);
98 jointIDVelocityMode.push_back(i);
99 foundControlDevice = true;
100 }
101 if (not foundControlDevice)
102 {
103 ARMARX_INFO << jointName << " is not selected for " << arm->kinematicChainName;
104 }
105 auto namesTorque = armarx::control::common::sVecToString(cfg.jointNameListTorque);
106 auto namesVelocity = armarx::control::common::sVecToString(cfg.jointNameListVelocity);
107 ARMARX_INFO << "Robot node set '" << arm->kinematicChainName
108 << "' has torque controlled joints [" << namesTorque
109 << "] and velocity controlled joints [" << namesVelocity << "].";
110
111 const SensorValueBase* sv = useSensorValue(jointName);
113 const auto* torqueSensor = sv->asA<SensorValue1DoFActuatorTorque>();
114 const auto* velocitySensor = sv->asA<SensorValue1DoFActuatorVelocity>();
115 const auto* positionSensor = sv->asA<SensorValue1DoFActuatorPosition>();
116
117 if (torqueSensor == nullptr)
118 {
119 ARMARX_WARNING << "No Torque sensor available for " << jointName;
120 }
121 if (velocitySensor == nullptr)
122 {
123 ARMARX_WARNING << "No velocity sensor available for " << jointName;
124 }
125 if (positionSensor == nullptr)
126 {
127 ARMARX_WARNING << "No position sensor available for " << jointName;
128 }
129
130
131 arm->sensorDevices.torqueSensors.push_back(torqueSensor);
132 arm->sensorDevices.velocitySensors.push_back(velocitySensor);
133 arm->sensorDevices.positionSensors.push_back(positionSensor);
134 };
135 ARMARX_DEBUG << "Number of torque controlled joints " << jointIDTorqueMode.size();
136 ARMARX_DEBUG << "Number of velocity controlled joints " << jointIDVelocityMode.size();
137 // ARMARX_CHECK_EQUAL(rtRns->getNodeNames().size(),
138 // jointIDTorqueMode.size() + jointIDVelocityMode.size());
139
140 arm->controller.initialize(nonRtRns, rtRns, jointIDTorqueMode, jointIDVelocityMode);
141 arm->controller.ftsensor.initialize(rtRns, robotUnit, cfg.ftConfig);
142
143 validateConfigData(cfg, arm);
144 arm->rtConfig = cfg;
145 arm->nonRtConfig = cfg;
146 }
147
149 const RobotUnitPtr& robotUnit,
150 const NJointControllerConfigPtr& config,
151 const VirtualRobot::RobotPtr&) :
153 {
155
156 ConfigPtrT cfg = ConfigPtrT::dynamicCast(config);
159
161 nonRtRobot = robotUnit->cloneRobot();
162 robotUnit->updateVirtualRobot(nonRtRobot);
163
164 for (auto& pair : userConfig.limbs)
165 {
166 limb.emplace(pair.first, std::make_unique<ArmData>());
167 limbInit(pair.first, limb.at(pair.first), pair.second, nonRtRobot);
168 }
169 }
170
171 std::string
173 {
174 return "NJointTaskspaceZeroTorqueOrVelocityController";
175 }
176
177 void
181
182 void
184 {
185 double timeMeasure = IceUtil::Time::now().toMicroSecondsDouble();
186 arm->rtConfig = arm->bufferNonRtToRt.getUpToDateReadBuffer();
187 double time_update_non_rt_buffer =
188 IceUtil::Time::now().toMicroSecondsDouble() - timeMeasure;
189
190 if (arm->rtFirstRun.load())
191 {
192 arm->rtFirstRun.store(false);
193 arm->rtReady.store(true);
194 }
195 arm->controller.ftsensor.updateStatus(arm->rtConfig.ftConfig,
196 arm->rtStatus.currentForceTorque,
197 arm->rtStatus.deltaT,
198 arm->rtFirstRun.load());
199
200 double time_update_ft = IceUtil::Time::now().toMicroSecondsDouble() - timeMeasure;
201
202 // size_t nDoF = arm->sensorDevices.positionSensors.size();
203 double time_update_size = IceUtil::Time::now().toMicroSecondsDouble() - timeMeasure;
204 arm->sensorDevices.updateJointValues(
205 arm->rtStatus.jointPosition, arm->rtStatus.jointVelocity, arm->rtStatus.jointTorque);
206
207 double time_update_js = IceUtil::Time::now().toMicroSecondsDouble() - timeMeasure;
208 arm->rtStatus.deltaT = deltaT;
209 double time_update_rt_status = IceUtil::Time::now().toMicroSecondsDouble() - timeMeasure;
210
211 arm->bufferRtToNonRt.getWriteBuffer() = arm->rtStatus;
212 arm->bufferRtToNonRt.commitWrite();
213 arm->bufferRtStatusToUser.getWriteBuffer() = arm->rtStatus;
214 arm->bufferRtStatusToUser.commitWrite();
215 double time_write_rt_buffer = IceUtil::Time::now().toMicroSecondsDouble() - timeMeasure;
216
217 arm->controller.run(arm->rtConfig, arm->rtStatus);
218 double time_run_rt = IceUtil::Time::now().toMicroSecondsDouble() - timeMeasure;
219
220 for (unsigned int i = 0; i < arm->rtStatus.nDoFTorque; i++)
221 {
222 auto jointIdx = arm->controller.jointIDTorqueMode[i];
223 arm->targetsTorque.at(i)->torque = arm->rtStatus.desiredJointTorque(jointIdx);
224 if (!arm->targetsTorque.at(i)->isValid())
225 {
226 arm->targetsTorque.at(i)->torque = 0;
227 }
228 }
229 for (unsigned int i = 0; i < arm->rtStatus.nDoFVelocity; i++)
230 {
231 auto jointIdx = arm->controller.jointIDVelocityMode[i];
232 arm->targetsVel.at(i)->velocity = arm->rtStatus.desiredJointVelocity(jointIdx);
233 // if (!targets.at(i)->isValid() || fabs(targets.at(i)->velocity) > cfg->maxJointVelocity)
234 if (!arm->targetsVel.at(i)->isValid())
235 {
236 arm->targetsVel.at(i)->velocity = 0;
237 }
238 }
239 arm->bufferRtStatusToOnPublish.getWriteBuffer() = arm->rtStatus;
240 arm->bufferRtStatusToOnPublish.commitWrite();
241
242 arm->bufferRtConfigToOnPublish.getWriteBuffer() = arm->rtConfig;
243 arm->bufferRtConfigToOnPublish.commitWrite();
244
245 arm->bufferRtConfigToUser.getWriteBuffer() = arm->rtConfig;
246 arm->bufferRtConfigToUser.commitWrite();
247 double time_rt_status_buffer = IceUtil::Time::now().toMicroSecondsDouble() - timeMeasure;
248 timeMeasure = IceUtil::Time::now().toMicroSecondsDouble() - timeMeasure;
249
250 if (timeMeasure > 100)
251 {
252 ARMARX_RT_LOGF_WARN("---- rt too slow: unit in (us)"
253 "update_non_rt_buffer: %.2f\n"
254 "update_ft: %.2f\n"
255 "update_size: %.2f\n"
256 "update_js: %.2f\n"
257 "update_rt_status: %.2f\n"
258 "write_rt_buffer: %.2f\n"
259 "run_rt: %.2f\n"
260 "rt_status_buffer: %.2f\n"
261 "time all: %.2f\n",
262 time_update_non_rt_buffer, // 0-1 us
263 time_update_ft - time_update_non_rt_buffer, //
264 time_update_size - time_update_ft, //
265 time_update_js - time_update_size, //
266 time_update_rt_status - time_update_non_rt_buffer, // 1-2 us
267 time_write_rt_buffer - time_update_rt_status, // 0-1 us
268 time_run_rt - time_write_rt_buffer, // 26-33 us
269 time_rt_status_buffer - time_run_rt,
270 timeMeasure); // 0-1 us
271 }
272 }
273
274 void
276 const IceUtil::Time& /*sensorValuesTimestamp*/,
277 const IceUtil::Time& timeSinceLastIteration)
278 {
279 double deltaT = timeSinceLastIteration.toSecondsDouble();
280 for (auto& pair : limb)
281 {
282 limbRT(pair.second, deltaT);
283 }
284 }
285
286 void
288 const ::armarx::aron::data::dto::DictPtr& dto,
289 const Ice::Current& iceCurrent)
290 {
291 userConfig = userConfig.FromAron(dto);
292 // userConfig = ::armarx::fromAronDict<ConfigDict, ConfigDict>(dto);
293
294 for (auto& pair : userConfig.limbs)
295 {
296 validateConfigData(pair.second, limb.at(pair.first));
297 limb.at(pair.first)->bufferUserToNonRt.getWriteBuffer() = pair.second;
298 limb.at(pair.first)->bufferUserToNonRt.commitWrite();
299 }
300 }
301
304 {
305 for (auto& pair : limb)
306 {
307 userConfig.limbs.at(pair.first) =
308 pair.second->bufferRtConfigToUser.getUpToDateReadBuffer();
309 }
310 return userConfig.toAronDTO();
311 }
312
313 void
315 ArmPtr& arm)
316 {
317 const auto checkNonNegative = [](const auto& v) { ARMARX_CHECK(v >= 0); };
318 const auto checkVecNonNegative = [](const auto& v)
319 { ARMARX_CHECK((v.array() >= 0).all()); };
320
321 checkVecNonNegative(configData.kpCartesianVel);
322 checkVecNonNegative(configData.kdCartesianVel);
323
324 checkNonNegative(configData.torqueLimit);
325 checkNonNegative(configData.velocityLimit);
326 checkNonNegative(configData.qvelFilter);
327 checkNonNegative(configData.cartesianLinearVelLimit);
328 checkNonNegative(configData.cartesianAngularVelLimit);
329 }
330
331 void
333 ArmPtr& arm,
334 const DebugObserverInterfacePrx& debugObs)
335 {
336 StringVariantBaseMap datafields;
337 auto rtConfig = arm->bufferRtConfigToOnPublish.getUpToDateReadBuffer();
338 auto rtStatus = arm->bufferRtStatusToOnPublish.getUpToDateReadBuffer();
339
340 // datafields[name + "_x"] = new Variant(pose(0, 3));
341
342 common::debugEigenVec(datafields, "cartesianVelTarget", rtStatus.cartesianVelTarget);
343 datafields["velocityLimit"] = new Variant(rtConfig.velocityLimit);
344 common::debugEigenVec(datafields, "desiredJointVelocity", rtStatus.desiredJointVelocity);
345 common::debugEigenVec(datafields, "currentForceTorque", rtStatus.currentForceTorque);
346 debugObs->setDebugChannel("ZT-ZV_" + arm->kinematicChainName, datafields);
347 }
348
349 void
351 const SensorAndControl&,
353 const DebugObserverInterfacePrx& debugObs)
354 {
355 for (auto& pair : limb)
356 {
357 limbPublish(pair.second, debugObs);
358 }
359 }
360
361 void
363 {
364 for (auto& pair : limb)
365 {
366 pair.second->rtReady.store(false);
367 }
368 }
369
370 void
372 {
373 VirtualRobot::RobotNodeSetPtr rns = rtGetRobot()->getRobotNodeSet(arm->kinematicChainName);
374
375 arm->bufferUserToNonRt.reinitAllBuffers(arm->rtConfig);
376 {
377 arm->nonRtConfig = arm->rtConfig;
378 arm->bufferNonRtToRt.reinitAllBuffers(arm->rtConfig);
379 arm->bufferRtConfigToOnPublish.reinitAllBuffers(arm->rtConfig);
380 arm->bufferRtConfigToUser.reinitAllBuffers(arm->rtConfig);
381 }
382
383 const auto nDoF = rns->getSize();
384 // const auto nDoFTorque = arm->controller.jointIDTorqueMode.size();
385 // const auto nDoFVelocity = arm->controller.jointIDVelocityMode.size();
386
387 {
388 arm->rtStatus.reset(
389 nDoF, arm->controller.jointIDTorqueMode, arm->controller.jointIDVelocityMode);
390 arm->sensorDevices.updateJointValues(arm->rtStatus.jointPosition,
391 arm->rtStatus.jointVelocity,
392 arm->rtStatus.jointTorque);
393
394 arm->rtStatusInNonRT = arm->rtStatus;
395 arm->bufferRtStatusToOnPublish.reinitAllBuffers(arm->rtStatus);
396 arm->bufferRtToNonRt.reinitAllBuffers(arm->rtStatus);
397 arm->bufferRtStatusToUser.reinitAllBuffers(arm->rtStatus);
398 }
399
400 arm->controller.preactivateInit(rns);
401 }
402
403 void
405 {
406 for (auto& pair : limb)
407 {
408 ARMARX_INFO << "rtPreActivateController for " << pair.first;
409 limbReInit(pair.second);
410 userConfig.limbs.at(pair.first) = pair.second->rtConfig;
411 }
412 }
413
414 void
416 {
417 // for (auto& pair : limb)
418 // {
419 // pair.second->controller.isInitialized.store(false);
420 // }
421 }
422
425 const VirtualRobot::RobotPtr& robot,
426 const std::map<std::string, ConstControlDevicePtr>& controlDevices,
427 const std::map<std::string, ConstSensorDevicePtr>&)
428 {
429 using namespace armarx::WidgetDescription;
430 HBoxLayoutPtr layout = new HBoxLayout;
431
432
433 ::armarx::WidgetDescription::WidgetSeq widgets;
434 auto addSlider = [&](const std::string& label, float min, float max, float defaultValue)
435 {
436 widgets.emplace_back(new Label(false, label));
437 {
438 FloatSliderPtr c_x = new FloatSlider;
439 c_x->name = label;
440 c_x->min = min;
441 c_x->defaultValue = defaultValue;
442 c_x->max = max;
443 widgets.emplace_back(c_x);
444 }
445 };
446
447 /// zero torque mode
448 LabelPtr label = new Label;
449 label->text = "ZeroTorque (L/R)";
450
451 StringComboBoxPtr boxZeroTorqueLeft = new StringComboBox;
452 boxZeroTorqueLeft->name = "ZeroTorqueLeft";
453 boxZeroTorqueLeft->defaultIndex = 0;
454 boxZeroTorqueLeft->multiSelect = true;
455
456 StringComboBoxPtr boxZeroTorqueRight = new StringComboBox;
457 boxZeroTorqueRight->name = "ZeroTorqueRight";
458 boxZeroTorqueRight->defaultIndex = 0;
459 boxZeroTorqueRight->multiSelect = true;
460
461 /// zero velocity mode
462 LabelPtr labelZVMode = new Label;
463 labelZVMode->text = "ZeroVelocity (L/R)";
464
465 StringComboBoxPtr boxZeroVelocityLeft = new StringComboBox;
466 boxZeroVelocityLeft->name = "ZeroVelocityLeft";
467 boxZeroVelocityLeft->defaultIndex = 0;
468 boxZeroVelocityLeft->multiSelect = true;
469
470 StringComboBoxPtr boxZeroVelocityRight = new StringComboBox;
471 boxZeroVelocityRight->name = "ZeroVelocityRight";
472 boxZeroVelocityRight->defaultIndex = 0;
473 boxZeroVelocityRight->multiSelect = true;
474
475 ARMARX_INFO_S << "Building check boxes";
477 std::map<std::string, StringComboBoxPtr> boxes;
478 boxes.insert({"zv_left", boxZeroVelocityLeft});
479 boxes.insert({"zv_right", boxZeroVelocityRight});
480 boxes.insert({"zt_left", boxZeroTorqueLeft});
481 boxes.insert({"zt_right", boxZeroTorqueRight});
482
484 for (auto& c : controlDevices)
485 {
486 std::string mode;
487 if (c.first.find("ArmL") != std::string::npos)
488 {
489 mode = "left";
490 }
491 else if (c.first.find("ArmR") != std::string::npos)
492 {
493 mode = "right";
494 }
495 else
496 {
497 continue;
498 }
499
500 if (c.second->hasJointController(ControlModes::ZeroTorque1DoF))
501 {
502 boxes.at("zt_" + mode)->options.push_back(c.first);
503 }
504 else if (c.second->hasJointController(ControlModes::ZeroVelocity1DoF))
505 {
506 boxes.at("zv_" + mode)->options.push_back(c.first);
507 }
508 }
510
511 layout->children.emplace_back(label);
512 layout->children.emplace_back(boxZeroTorqueLeft);
513 layout->children.emplace_back(boxZeroTorqueRight);
514 layout->children.emplace_back(labelZVMode);
515 layout->children.emplace_back(boxZeroVelocityLeft);
516 layout->children.emplace_back(boxZeroVelocityRight);
517
518 addSlider("maxTorque", 0, 100, 10);
519 addSlider("maxVeloicty", 0, 3.14, 2.0);
521
522 layout->children.insert(layout->children.end(), widgets.begin(), widgets.end());
523 ARMARX_INFO_S << "Layout done";
524 return layout;
525 }
526
529 const StringVariantBaseMap& values)
530 {
531 const armarx::PackagePath configPath(
532 "armarx_control",
533 "controller_config/NJointTaskspaceZeroTorqueOrVelocityController/default.json");
534 ARMARX_INFO_S << "Loading config from " << configPath.toSystemPath();
535 auto cfgDTO = armarx::readFromJson<ConfigDict>(configPath.toSystemPath());
536
537 ARMARX_WARNING_S << "Left arm of armar7 is not yet calibrated, the default is set to "
538 "RightArm for safety reason!";
539
540 auto varZTLeft = VariantPtr::dynamicCast(values.at("ZeroTorqueLeft"));
541 auto varZTRight = VariantPtr::dynamicCast(values.at("ZeroTorqueRight"));
542 auto varZVLeft = VariantPtr::dynamicCast(values.at("ZeroVelocityLeft"));
543 auto varZVRight = VariantPtr::dynamicCast(values.at("ZeroVelocityRight"));
544 ARMARX_CHECK_EXPRESSION(varZTLeft) << "ZeroTorqueLeft";
545 ARMARX_CHECK_EXPRESSION(varZTRight) << "ZeroTorqueRight";
546 ARMARX_CHECK_EXPRESSION(varZVLeft) << "ZeroVelocityLeft";
547 ARMARX_CHECK_EXPRESSION(varZVRight) << "ZeroVelocityRight";
548
549 cfgDTO.limbs.at("RightArm").jointNameListTorque =
550 varZTRight->get<SingleTypeVariantList>()->toStdVector<std::string>();
551 cfgDTO.limbs.at("RightArm").jointNameListVelocity =
552 varZVRight->get<SingleTypeVariantList>()->toStdVector<std::string>();
553 cfgDTO.limbs.at("RightArm").torqueLimit = values.at("maxTorque")->getFloat();
554 cfgDTO.limbs.at("RightArm").velocityLimit = values.at("maxVeloicty")->getFloat();
555
556 auto namesTorque =
557 armarx::control::common::sVecToString(cfgDTO.limbs.at("RightArm").jointNameListTorque);
558 auto namesVelocity = armarx::control::common::sVecToString(
559 cfgDTO.limbs.at("RightArm").jointNameListVelocity);
560 if (cfgDTO.limbs.at("RightArm").jointNameListTorque.size() > 0)
561 {
562 ARMARX_INFO_S << "'RightArm' has torque controlled joints [" << namesTorque << "].";
563 }
564 if (cfgDTO.limbs.at("RightArm").jointNameListVelocity.size() > 0)
565 {
566 ARMARX_INFO_S << "'RightArm' has velocity controlled joints [" << namesVelocity << "].";
567 }
568
569 ARMARX_INFO_S << "torque limit: " << cfgDTO.limbs.at("RightArm").torqueLimit
570 << "velocity limit: " << cfgDTO.limbs.at("RightArm").velocityLimit;
571
573 return new ConfigurableNJointControllerConfig{cfgDTO.toAronDTO()};
574 }
575} // namespace armarx::control::njoint_controller::task_space
int Label(int n[], int size, int *curLabel, MiscLib::Vector< std::pair< int, size_t > > *labels)
Definition Bitmap.cpp:801
#define ARMARX_RT_LOGF_WARN(...)
constexpr T c
Brief description of class JointControlTargetBase.
const SensorValueBase * useSensorValue(const std::string &sensorDeviceName) const
Get a const ptr to the given SensorDevice's SensorValue.
const VirtualRobot::RobotPtr & useSynchronizedRtRobot(bool updateCollisionModel=false)
Requests a VirtualRobot for use in rtRun *.
const VirtualRobot::RobotPtr & rtGetRobot()
TODO make protected and use attorneys.
ControlTargetBase * useControlTarget(const std::string &deviceName, const std::string &controlMode)
Declares to calculate the ControlTarget for the given ControlDevice in the given ControlMode when rtR...
static std::filesystem::path toSystemPath(const data::PackagePath &pp)
The SensorValueBase class.
const T * asA() const
The SingleTypeVariantList class is a subclass of VariantContainer and is comparable to a std::vector<...
The Variant class is described here: Variants.
Definition Variant.h:224
void onPublish(const SensorAndControl &, const DebugDrawerInterfacePrx &, const DebugObserverInterfacePrx &) override
static WidgetDescription::WidgetPtr GenerateConfigDescription(const VirtualRobot::RobotPtr &, const std::map< std::string, ConstControlDevicePtr > &, const std::map< std::string, ConstSensorDevicePtr > &)
NJointTaskspaceZeroTorqueOrVelocityController(const RobotUnitPtr &robotUnit, const NJointControllerConfigPtr &config, const VirtualRobot::RobotPtr &)
::armarx::aron::data::dto::DictPtr getConfig(const Ice::Current &iceCurrent=Ice::emptyCurrent) override
void limbInit(const std::string nodeSetName, ArmPtr &arm, Config cfg, VirtualRobot::RobotPtr &nonRtRobotPtr)
void rtPostDeactivateController() override
This function is called after the controller is deactivated.
void rtRun(const IceUtil::Time &sensorValuesTimestamp, const IceUtil::Time &timeSinceLastIteration) override
TODO make protected and use attorneys.
void updateConfig(const ::armarx::aron::data::dto::DictPtr &dto, const Ice::Current &iceCurrent=Ice::emptyCurrent) override
NJointController interface.
void rtPreActivateController() override
This function is called before the controller is activated.
#define ARMARX_CHECK_EXPRESSION(expression)
This macro evaluates the expression and if it turns out to be false it will throw an ExpressionExcept...
#define ARMARX_CHECK(expression)
Shortcut for ARMARX_CHECK_EXPRESSION.
#define ARMARX_INFO
The normal logging level.
Definition Logging.h:181
#define ARMARX_IMPORTANT
The logging level for always important information, but expected behaviour (in contrast to ARMARX_WAR...
Definition Logging.h:190
#define ARMARX_INFO_S
Definition Logging.h:202
#define ARMARX_DEBUG
The logging level for output that is only interesting while debugging.
Definition Logging.h:184
#define ARMARX_WARNING
The logging level for unexpected behaviour, but not a serious problem.
Definition Logging.h:193
#define ARMARX_WARNING_S
The logging level for unexpected behaviour, but not a serious problem.
Definition Logging.h:213
std::shared_ptr< class Robot > RobotPtr
Definition Bus.h:19
::IceInternal::Handle<::armarx::WidgetDescription::Widget > WidgetPtr
::IceInternal::Handle< Dict > DictPtr
void debugEigenVec(StringVariantBaseMap &datafields, const std::string &name, Eigen::VectorXf vec)
Definition utils.cpp:190
std::string sVecToString(const std::vector< std::string > &vec, const std::string &delimiter)
Definition utils.cpp:439
NJointControllerRegistration< NJointTaskspaceZeroTorqueOrVelocityController > registrationControllerNJointTaskspaceZeroTorqueOrVelocityController("NJointTaskspaceZeroTorqueOrVelocityController")
::IceInternal::ProxyHandle<::IceProxy::armarx::DebugObserverInterface > DebugObserverInterfacePrx
std::map< std::string, VariantBasePtr > StringVariantBaseMap
AronDTO readFromJson(const std::filesystem::path &filename)
std::vector< T > max(const std::vector< T > &v1, const std::vector< T > &v2)
T fromAronDict(const ::armarx::aron::data::dto::DictPtr &dto)
IceUtil::Handle< class RobotUnit > RobotUnitPtr
Definition FTSensor.h:34
::IceInternal::ProxyHandle<::IceProxy::armarx::DebugDrawerInterface > DebugDrawerInterfacePrx
detail::ControlThreadOutputBufferEntry SensorAndControl
std::vector< T > min(const std::vector< T > &v1, const std::vector< T > &v2)
#define ARMARX_TRACE
Definition trace.h:77