RobotUnitModuleUnits.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 RobotAPI::ArmarXObjects::RobotUnit
17  * @author Raphael Grimm ( raphael dot grimm at kit dot edu )
18  * @date 2018
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #include "RobotUnitModuleUnits.h"
24 
27 #include <ArmarXCore/core/time.h>
28 
44 
46 {
47  /**
48  * \brief This class allows minimal access to private members of \ref ControlThread in a sane fashion for \ref RobotUnitEmergencyStopMaster.
49  * \warning !! DO NOT ADD ADDITIONAL FRIENDS IF YOU DO NOT KNOW WAHT YOU ARE DOING! IF YOU DO SOMETHING WRONG YOU WILL CAUSE UNDEFINED BEHAVIOUR !!
50  */
52  {
54 
55  static void
56  SetEmergencyStopStateNoReportToTopic(ControlThread* controlThreadModule,
57  EmergencyStopState state)
58  {
59  controlThreadModule->setEmergencyStopStateNoReportToTopic(state);
60  }
61  };
62 } // namespace armarx::RobotUnitModule
63 
65 {
67  virtual public ManagedIceObject,
68  virtual public EmergencyStopMasterInterface
69  {
70  public:
72  std::string emergencyStopTopicName) :
74  {
77  }
78 
79  void
80  setEmergencyStopState(EmergencyStopState state,
81  const Ice::Current& = Ice::emptyCurrent) final override
82  {
83  EmergencyStopState currentState = getEmergencyStopState();
84 
85  const std::unique_lock lock{ss2StateMutex};
86 
87  if (currentState == state)
88  {
89  return;
90  }
91 
92  currentState = state;
93 
94  if (currentState == EmergencyStopState::eEmergencyStopActive)
95  {
97  }
98 
99  ControlThreadAttorneyForRobotUnitEmergencyStopMaster::
100  SetEmergencyStopStateNoReportToTopic(controlThreadModule, currentState);
101  emergencyStopTopic->reportEmergencyStopState(currentState);
102  }
103 
104  EmergencyStopState
105  trySetEmergencyStopState(EmergencyStopState targetState,
106  const ::Ice::Current&) final override
107  {
108  armarx::core::time::Duration safeDuration =
110 
111  // If the SS2 should be released (target state = inactive) we check whether the last
112  // activation happened at least before safeDuration.
113  if (targetState == EmergencyStopState::eEmergencyStopInactive and
115  {
116  setEmergencyStopState(targetState);
117  }
118 
119  return getEmergencyStopState();
120  }
121 
122  EmergencyStopState
123  getEmergencyStopState(const Ice::Current& = Ice::emptyCurrent) const final override
124  {
125  const std::shared_lock lock{ss2StateMutex};
127  }
128 
129  protected:
130  void
131  onInitComponent() final override
132  {
134  }
135 
136  void
137  onConnectComponent() final override
138  {
139  emergencyStopTopic = armarx::ManagedIceObject::getTopic<EmergencyStopListenerPrx>(
141  setEmergencyStopState(EmergencyStopState::eEmergencyStopInactive);
142  }
143 
144  std::string
145  getDefaultName() const final override
146  {
147  return "EmergencyStopMaster";
148  }
149 
150  protected:
152  const std::string emergencyStopTopicName;
153  EmergencyStopListenerPrx emergencyStopTopic;
154  mutable std::shared_mutex ss2StateMutex;
156  };
157 } // namespace armarx::RobotUnitModule
158 
159 namespace armarx::RobotUnitModule
160 {
161  Ice::ObjectProxySeq
162  Units::getUnits(const Ice::Current&) const
163  {
164  throwIfInControlThread(BOOST_CURRENT_FUNCTION);
165  std::vector<ManagedIceObjectPtr> unitsCopy;
166  {
167  auto guard = getGuard();
168  //copy to keep lock retention time low
169  unitsCopy = units;
170  }
171  Ice::ObjectProxySeq r;
172  r.reserve(unitsCopy.size());
173  for (const ManagedIceObjectPtr& unit : unitsCopy)
174  {
175  r.emplace_back(unit->getProxy(-1, true));
176  }
177  return r;
178  }
179 
180  Ice::ObjectPrx
181  Units::getUnit(const std::string& staticIceId, const Ice::Current&) const
182  {
183  throwIfInControlThread(BOOST_CURRENT_FUNCTION);
184  //no lock required
185  ManagedIceObjectPtr unit = getUnit(staticIceId);
186  if (unit)
187  {
188  return unit->getProxy(-1, true);
189  }
190  return nullptr;
191  }
192 
193  const EmergencyStopMasterInterfacePtr&
195  {
196  throwIfInControlThread(BOOST_CURRENT_FUNCTION);
197  return emergencyStopMaster;
198  }
199 
200  void
202  {
203  ARMARX_TRACE;
204  throwIfInControlThread(BOOST_CURRENT_FUNCTION);
205  auto beg = TimeUtil::GetTime(true);
206  {
207  ARMARX_TRACE;
208  auto guard = getGuard();
209 
210  ARMARX_TRACE;
212  ARMARX_INFO << "initializing default units";
213 
214  ARMARX_TRACE;
216  ARMARX_DEBUG << "Diagnostics unit initialized.";
217 
218  ARMARX_TRACE;
220  ARMARX_DEBUG << "KinematicUnit initialized";
221 
222  ARMARX_TRACE;
223  if (_module<RobotData>().arePlatformAndLocalizationUnitsEnabled())
224  {
225  ARMARX_DEBUG << "initializing LocalizationUnit";
227  ARMARX_DEBUG << "LocalizationUnit initialized";
228  }
229 
230  ARMARX_TRACE;
231  if (_module<RobotData>().arePlatformAndLocalizationUnitsEnabled())
232  {
233  ARMARX_DEBUG << "initializing PlatformUnit";
235  ARMARX_DEBUG << "PlatformUnit initialized";
236  }
237 
238  ARMARX_TRACE;
240  ARMARX_DEBUG << "ForceTorqueUnit initialized";
241 
242  ARMARX_TRACE;
244  ARMARX_DEBUG << "InertialMeasurementUnit initialized";
245 
246  ARMARX_TRACE;
248  ARMARX_DEBUG << "TrajectoryControllerUnit initialized";
249 
250  ARMARX_TRACE;
252  ARMARX_DEBUG << "TcpControllerUnit initialized";
253 
254  ARMARX_TRACE;
255  }
256  ARMARX_INFO << "initializing default units...done! "
257  << (TimeUtil::GetTime(true) - beg).toMicroSeconds() << " us";
258  }
259 
260  void
262  {
263  throwIfInControlThread(BOOST_CURRENT_FUNCTION);
264  using UnitT = DiagnosticsSubUnit;
265  using IfaceT = DiagnosticsUnitInterface;
266 
267  auto guard = getGuard();
269  // Check if unit is already added.
270  if (getUnit(IfaceT::ice_staticId()))
271  {
272  return;
273  }
274 
275  // Check if it is required.
276  std::map<std::string, std::size_t> batteryDevs;
277  for (auto i : getIndices(_module<Devices>().getSensorDevices().keys()))
278  {
279  const SensorDevicePtr& sensorDevice = _module<Devices>().getSensorDevices().at(i);
280  if (sensorDevice->getSensorValue()->isA<SensorValueBattery>())
281  {
282  batteryDevs[sensorDevice->getDeviceName()] = i;
283  }
284  }
285 
286  const std::string configName = getProperty<std::string>("DiagnosticsUnitName");
287  const std::string confPre = getConfigDomain() + "." + configName + ".";
288  Ice::PropertiesPtr properties = getIceProperties()->clone();
289 
290  // Create and add unit.
292  Component::create<UnitT>(properties, configName, getConfigDomain());
293  unit->setBatteryManagementDevices(batteryDevs);
294  addUnit(std::move(unit));
295  }
296 
297  void
299  {
300  throwIfInControlThread(BOOST_CURRENT_FUNCTION);
301  using IfaceT = KinematicUnitInterface;
302 
303  auto guard = getGuard();
305  //check if unit is already added
306  if (getUnit(IfaceT::ice_staticId()))
307  {
308  return;
309  }
310  auto unit = createKinematicSubUnit(getIceProperties()->clone());
311  //add
312  if (unit)
313  {
314  addUnit(std::move(unit));
315  }
316  }
317 
320  const std::string& positionControlMode,
321  const std::string& velocityControlMode,
322  const std::string& torqueControlMode,
323  const std::string& pwmControlMode)
324  {
325  ARMARX_TRACE;
326  throwIfInControlThread(BOOST_CURRENT_FUNCTION);
327  /// TODO move init code to Kinematic sub unit
328  using UnitT = KinematicSubUnit;
329 
330  //add ctrl et al
331  ARMARX_DEBUG << "createKinematicSubUnit...";
332  std::map<std::string, UnitT::ActuatorData> devs;
333  for (const ControlDevicePtr& controlDevice :
334  _module<Devices>().getControlDevices().values())
335  {
336  ARMARX_CHECK_NOT_NULL(controlDevice);
337  const auto& controlDeviceName = controlDevice->getDeviceName();
338  ARMARX_DEBUG << "looking at device " << controlDeviceName
339  << controlDevice->getJointControllerToTargetTypeNameMap();
340  if (!controlDevice->hasTag(ControlDeviceTags::CreateNoDefaultController))
341  {
342  UnitT::ActuatorData ad;
343  ad.name = controlDeviceName;
344  ARMARX_DEBUG << "has sensor device: "
345  << _module<Devices>().getSensorDevices().has(controlDeviceName);
346  ad.sensorDeviceIndex =
347  _module<Devices>().getSensorDevices().has(controlDeviceName)
348  ? _module<Devices>().getSensorDevices().index(controlDeviceName)
350 
351  const auto init_controller =
352  [&](const std::string& requestedControlMode, auto& ctrl, const auto* tpptr)
353  {
354  auto controlMode = requestedControlMode;
355  using CtargT = std::remove_const_t<std::remove_reference_t<decltype(*tpptr)>>;
356  NJointKinematicUnitPassThroughControllerPtr& pt = ctrl;
357 
358  auto testMode = [&](const auto& m)
359  {
360  JointController* jointCtrl = controlDevice->getJointController(m);
361  return jointCtrl && jointCtrl->getControlTarget()->isA<CtargT>();
362  };
363 
364  if (!testMode(controlMode))
365  {
366  controlMode = "";
367  //try to find the correct mode (maybe the specified target was derived!
368  //this only works, if exactly one controller provides this mode
369  const JointController* selected_ctrl{nullptr};
370  auto jointControllers = controlDevice->getJointControllers();
371  for (const auto* jointController : jointControllers)
372  {
373  if (jointController->getControlTarget()->isA<CtargT>())
374  {
375  if (selected_ctrl)
376  {
377  selected_ctrl = nullptr;
378  ARMARX_INFO << "Autodetected two controllers supporting "
379  << requestedControlMode << "! autoselection failed";
380  break;
381  }
382  selected_ctrl = jointController;
383  }
384  }
385  if (selected_ctrl)
386  {
387  controlMode = selected_ctrl->getControlMode();
388  ARMARX_INFO << "Autodetected controller with mode " << controlMode
389  << "(the requested mode was " << requestedControlMode
390  << ")";
391  }
392  }
393 
394  if (!controlMode.empty())
395  {
396  NJointKinematicUnitPassThroughControllerConfigPtr config =
398  config->controlMode = controlMode;
399  config->deviceName = controlDeviceName;
400  auto ctrl_name = getName() + "_" + "NJointKU_PTCtrl_" + controlDeviceName +
401  "_" + controlMode;
402  std::replace(ctrl_name.begin(), ctrl_name.end(), '.', '_');
403  std::replace(ctrl_name.begin(), ctrl_name.end(), '-', '_');
404  std::replace(ctrl_name.begin(), ctrl_name.end(), ':', '_');
405  const NJointControllerBasePtr& nJointCtrl =
406  _module<ControllerManagement>().createNJointController(
407  "NJointKinematicUnitPassThroughController",
408  ctrl_name,
409  config,
410  false,
411  true);
412  pt = NJointKinematicUnitPassThroughControllerPtr::dynamicCast(nJointCtrl);
414  }
415  };
416  init_controller(
417  positionControlMode, ad.ctrlPos, (ControlTarget1DoFActuatorPosition*)0);
418  init_controller(
419  velocityControlMode, ad.ctrlVel, (ControlTarget1DoFActuatorVelocity*)0);
420  init_controller(torqueControlMode, ad.ctrlTor, (ControlTarget1DoFActuatorTorque*)0);
421  if (!ad.ctrlTor)
422  {
423  init_controller(pwmControlMode, ad.ctrlTor, (ControlTarget1DoFActuatorPWM*)0);
424  }
425 
426  if (ad.ctrlPos || ad.ctrlTor || ad.ctrlVel)
427  {
428  ARMARX_DEBUG << "created controllers for " << controlDeviceName
429  << " pos/tor/vel " << ad.ctrlPos.get() << " / " << ad.ctrlTor.get()
430  << " / " << ad.ctrlVel.get();
431  devs[controlDeviceName] = std::move(ad);
432  }
433  }
434  }
435  if (devs.empty())
436  {
437  ARMARX_IMPORTANT << "No joint devices found - skipping adding of KinematicUnit";
438  return nullptr;
439  }
440  ARMARX_IMPORTANT << "Found " << devs.size() << " joint devices - adding KinematicUnit";
441  ARMARX_CHECK_EXPRESSION(!devs.empty())
442  << "no 1DoF ControlDevice found with matching SensorDevice";
443  //add it
444  const std::string configName = getProperty<std::string>("KinematicUnitName");
445  const std::string confPre = getConfigDomain() + "." + configName + ".";
446  //properties->setProperty(confPre + "MinimumLoggingLevel", getProperty<std::string>("MinimumLoggingLevel").getValue());
447  //fill properties
448  properties->setProperty(confPre + "RobotNodeSetName",
449  _module<RobotData>().getRobotNodetSeName());
450  properties->setProperty(confPre + "RobotFileName", _module<RobotData>().getRobotFileName());
451  properties->setProperty(confPre + "RobotFileNameProject",
452  _module<RobotData>().getRobotProjectName());
453  properties->setProperty(confPre + "TopicPrefix",
454  getProperty<std::string>("KinematicUnitNameTopicPrefix"));
455 
456  ARMARX_DEBUG << "creating unit " << configName
457  << " using these properties: " << properties->getPropertiesForPrefix("");
459  Component::create<UnitT>(properties, configName, getConfigDomain());
460 
461  //fill devices (sensor + controller)
462  unit->setupData(getProperty<std::string>("RobotFileName").getValue(),
463  _module<RobotData>().cloneRobot(),
464  std::move(devs),
465  _module<Devices>().getControlModeGroups().groups,
466  _module<Devices>().getControlModeGroups().groupsMerged,
467  dynamic_cast<RobotUnit*>(this));
468  return unit;
469  }
470 
471  void
473  {
474  throwIfInControlThread(BOOST_CURRENT_FUNCTION);
475  using UnitT = PlatformSubUnit;
476  using IfaceT = PlatformUnitInterface;
477 
478  ARMARX_TRACE;
479 
480  auto guard = getGuard();
482  //check if unit is already added
483  if (getUnit(IfaceT::ice_staticId()))
484  {
485  return;
486  }
487  ARMARX_TRACE;
488  //is there a platform dev?
489  if (_module<RobotData>().getRobotPlatformName().empty())
490  {
491  ARMARX_INFO << "no platform unit created since no platform name was given";
492  return;
493  }
494  ARMARX_TRACE;
495  if (!_module<Devices>().getControlDevices().has(
496  _module<RobotData>().getRobotPlatformName()))
497  {
499  << "no platform unit created since the platform control device with name '"
500  << _module<RobotData>().getRobotPlatformName() << "' was not found";
501  return;
502  }
503  ARMARX_TRACE;
504  const ControlDevicePtr& controlDevice =
505  _module<Devices>().getControlDevices().at(_module<RobotData>().getRobotPlatformName());
506  const SensorDevicePtr& sensorDevice =
507  _module<Devices>().getSensorDevices().at(_module<RobotData>().getRobotPlatformName());
508  JointController* jointVel =
509  controlDevice->getJointController(ControlModes::HolonomicPlatformVelocity);
510  ARMARX_TRACE;
511  ARMARX_CHECK_EXPRESSION(jointVel);
513  sensorDevice->getSensorValue()->asA<SensorValueHolonomicPlatform>());
514  //add it
515  ARMARX_TRACE;
516  const std::string configName = getProperty<std::string>("PlatformUnitName");
517  const std::string confPre = getConfigDomain() + "." + configName + ".";
518  Ice::PropertiesPtr properties = getIceProperties()->clone();
519  //properties->setProperty(confPre + "MinimumLoggingLevel", getProperty<std::string>("MinimumLoggingLevel").getValue());
520  //fill properties
521  properties->setProperty(confPre + "PlatformName",
522  _module<RobotData>().getRobotPlatformInstanceName());
523  ARMARX_DEBUG << "creating unit " << configName
524  << " using these properties: " << properties->getPropertiesForPrefix("");
525  ARMARX_TRACE;
527  Component::create<UnitT>(properties, configName, getConfigDomain());
528  //config
529  ARMARX_TRACE;
530  const NJointHolonomicPlatformVelocityControllerTypes platformControllerType =
531  getProperty<NJointHolonomicPlatformVelocityControllerTypes>(
532  "PlatformUnitVelocityControllerType");
533  if (platformControllerType ==
535  {
536  NJointHolonomicPlatformUnitVelocityPassThroughControllerConfigPtr config =
538  config->initialVelocityX = 0;
539  config->initialVelocityY = 0;
540  config->initialVelocityRotation = 0;
541  config->platformName = _module<RobotData>().getRobotPlatformName();
542 
543  auto ctrl = NJointHolonomicPlatformUnitVelocityPassThroughControllerPtr::dynamicCast(
544  _module<ControllerManagement>().createNJointController(
545  "NJointHolonomicPlatformUnitVelocityPassThroughController",
546  getName() + "_" + configName + "_VelPTContoller",
547  config,
548  false,
549  true));
550  ARMARX_TRACE;
552  unit->pt = ctrl;
553  ARMARX_TRACE;
554  }
555  else if (platformControllerType ==
557  {
558  NJointHolonomicPlatformVelocityControllerWithRampConfigPtr config =
560  config->platformName = _module<RobotData>().getRobotPlatformName();
561 
562  config->maxPositionAcceleration =
563  getProperty<float>("PlatformUnitMaximumPositionAcceleration");
564  config->maxOrientationAcceleration =
565  getProperty<float>("PlatformUnitMaximumOrientationAcceleration");
566 
567  auto ctrl = NJointHolonomicPlatformVelocityControllerWithRampPtr::dynamicCast(
568  _module<ControllerManagement>().createNJointController(
569  "NJointHolonomicPlatformVelocityControllerWithRamp",
570  getName() + "_" + configName + "_VelPTContoller",
571  config,
572  false,
573  true));
574  ARMARX_TRACE;
576  unit->pt = ctrl;
577  ARMARX_TRACE;
578  }
579  else
580  {
581  ARMARX_ERROR << "Invalid Platform velocity controller specified '"
583  platformControllerType)
584  << "'";
585  }
586 
587  NJointHolonomicPlatformRelativePositionControllerConfigPtr configRelativePositionCtrlCfg =
589  configRelativePositionCtrlCfg->platformName = _module<RobotData>().getRobotPlatformName();
590  auto ctrlRelativePosition =
591  NJointHolonomicPlatformRelativePositionControllerPtr::dynamicCast(
592  _module<ControllerManagement>().createNJointController(
593  "NJointHolonomicPlatformRelativePositionController",
594  getName() + "_" + configName + "_RelativePositionContoller",
595  configRelativePositionCtrlCfg,
596  false,
597  true));
598  ARMARX_CHECK_EXPRESSION(ctrlRelativePosition);
599  unit->relativePosCtrl = ctrlRelativePosition;
600 
601  // unit->platformSensorIndex = _module<Devices>().getSensorDevices().index(_module<RobotData>().getRobotPlatformName());
602 
603  NJointHolonomicPlatformGlobalPositionControllerConfigPtr configGlobalPositionCtrlCfg =
605  configGlobalPositionCtrlCfg->platformName = _module<RobotData>().getRobotPlatformName();
606  auto ctrlGlobalPosition = NJointHolonomicPlatformGlobalPositionControllerPtr::dynamicCast(
607  _module<ControllerManagement>().createNJointController(
608  "NJointHolonomicPlatformGlobalPositionController",
609  getName() + "_" + configName + "_GlobalPositionContoller",
610  configGlobalPositionCtrlCfg,
611  false,
612  true));
613  ARMARX_TRACE;
614  ARMARX_CHECK_EXPRESSION(ctrlGlobalPosition);
615  unit->globalPosCtrl = ctrlGlobalPosition;
616  ARMARX_TRACE;
617 
618  unit->platformSensorIndex = _module<Devices>().getSensorDevices().index(
619  _module<RobotData>().getRobotPlatformName());
620  //add
621  addUnit(std::move(unit));
622  }
623 
624  void
626  {
627  ARMARX_TRACE;
628  ARMARX_DEBUG << "initializeLocalizationUnit";
629 
630  throwIfInControlThread(BOOST_CURRENT_FUNCTION);
631  using UnitT = LocalizationSubUnit;
632  using IfaceT = LocalizationUnitInterface;
633 
634  ARMARX_TRACE;
635  auto guard = getGuard();
637  //check if unit is already added
638  if (getUnit(IfaceT::ice_staticId()))
639  {
640  return;
641  }
642  ARMARX_TRACE;
643 
644  ARMARX_DEBUG << "Getting device SensorValueHolonomicPlatformRelativePosition";
645  ARMARX_CHECK(
646  _module<Devices>().getSensorDevices().has(_module<RobotData>().getRobotPlatformName()))
647  << _module<RobotData>().getRobotPlatformName();
648  const SensorDevicePtr& sensorDeviceRelativePosition =
649  _module<Devices>().getSensorDevices().at(_module<RobotData>().getRobotPlatformName());
650  ARMARX_CHECK_EXPRESSION(sensorDeviceRelativePosition->getSensorValue()
652 
653  ARMARX_TRACE;
654  // const SensorDevicePtr& sensorDevicePoseCorrection = _module<Devices>().getSensorDevices().at(GlobalRobotPoseCorrectionSensorDevice::DeviceName());
655  // ARMARX_CHECK_EXPRESSION(sensorDeviceRelativePosition->getSensorValue()->asA<SensorValueGlobalPoseCorrection>());
656 
657 
658  //add it
659  const std::string configName = "LocalizationUnit";
660  const std::string confPre = getConfigDomain() + "." + configName + ".";
661  Ice::PropertiesPtr properties = getIceProperties()->clone();
662  //properties->setProperty(confPre + "MinimumLoggingLevel", getProperty<std::string>("MinimumLoggingLevel").getValue());
663  //fill properties
664  // properties->setProperty(confPre + "PlatformName", _module<RobotData>().getRobotPlatformInstanceName());
665  ARMARX_DEBUG << "creating unit " << configName
666  << " using these properties: " << properties->getPropertiesForPrefix("");
668  Component::create<UnitT>(properties, configName, getConfigDomain());
669  //config
670 
671  ARMARX_DEBUG << "Setting device GlobalRobotPoseCorrectionSensorDevice";
672  unit->globalPositionCorrectionSensorDevice =
673  dynamic_cast<decltype(unit->globalPositionCorrectionSensorDevice)>(
674  _module<Devices>()
675  .getSensorDevices()
677  .get());
678 
679 
680  const SensorDevicePtr& sensorDeviceGlobalRobotLocalization =
681  _module<Devices>().getSensorDevices().at(
683  ARMARX_CHECK_EXPRESSION(sensorDeviceGlobalRobotLocalization->getSensorValue()
685 
686  dynamic_cast<GlobalRobotLocalizationSensorDevice&>(*sensorDeviceGlobalRobotLocalization)
687  .sensorRelativePosition = sensorDeviceRelativePosition->getSensorValue()
689  dynamic_cast<GlobalRobotLocalizationSensorDevice&>(*sensorDeviceGlobalRobotLocalization)
691  unit->globalPositionCorrectionSensorDevice->getSensorValue()
693 
694  //add
695  addUnit(unit);
696  }
697 
698  void
700  {
701  throwIfInControlThread(BOOST_CURRENT_FUNCTION);
702  using UnitT = ForceTorqueSubUnit;
703  using IfaceT = ForceTorqueUnitInterface;
704 
705  auto guard = getGuard();
707  //check if unit is already added
708  if (getUnit(IfaceT::ice_staticId()))
709  {
710  return;
711  }
712  //check if it is required
713  std::vector<ForceTorqueSubUnit::DeviceData> ftdevs;
714  for (const SensorDevicePtr& ftSensorDevice : _module<Devices>().getSensorDevices().values())
715  {
716  if (ftSensorDevice->getSensorValue()->isA<SensorValueForceTorque>())
717  {
718  ForceTorqueSubUnit::DeviceData ftSensorData;
719  ftSensorData.sensorIndex =
720  _module<Devices>().getSensorDevices().index(ftSensorDevice->getDeviceName());
721  ftSensorData.deviceName = ftSensorDevice->getDeviceName();
722  ftSensorData.frame = ftSensorDevice->getReportingFrame();
723  ARMARX_CHECK_EXPRESSION(!ftSensorData.frame.empty())
724  << "The sensor device '" << ftSensorData.deviceName
725  << "' (index: " << ftSensorData.sensorIndex
726  << ") reports force torque values but returns an empty string as reporting "
727  "frame";
728  ARMARX_CHECK_EXPRESSION(unitCreateRobot->hasRobotNode(ftSensorData.frame))
729  << "The sensor device '" << ftSensorData.deviceName
730  << "' (index: " << ftSensorData.sensorIndex
731  << ") reports force torque values but returns a reporting frame '"
732  << ftSensorData.frame << "' which is not present in the robot '"
733  << _module<RobotData>().getRobotName() << "'";
734  ftdevs.emplace_back(std::move(ftSensorData));
735  }
736  }
737  if (ftdevs.empty())
738  {
740  << "no force torque unit created since there are no force torque sensor devices";
741  return;
742  }
743  //add it
744  const std::string configName = getProperty<std::string>("ForceTorqueUnitName");
745  const std::string confPre = getConfigDomain() + "." + configName + ".";
746  Ice::PropertiesPtr properties = getIceProperties()->clone();
747  //properties->setProperty(confPre + "MinimumLoggingLevel", getProperty<std::string>("MinimumLoggingLevel").getValue());
748  //fill properties
749  properties->setProperty(confPre + "AgentName", _module<RobotData>().getRobotName());
750  properties->setProperty(confPre + "ForceTorqueTopicName",
751  getProperty<std::string>("ForceTorqueTopicName").getValue());
752  ARMARX_DEBUG << "creating unit " << configName
753  << " using these properties: " << properties->getPropertiesForPrefix("");
755  Component::create<UnitT>(properties, configName, getConfigDomain());
756  unit->devs = ftdevs;
757  //add
758  addUnit(std::move(unit));
759  }
760 
761  void
763  {
764  throwIfInControlThread(BOOST_CURRENT_FUNCTION);
765  using UnitT = InertialMeasurementSubUnit;
766  using IfaceT = InertialMeasurementUnitInterface;
767 
768  auto guard = getGuard();
770  //check if unit is already added
771  if (getUnit(IfaceT::ice_staticId()))
772  {
773  return;
774  }
775  //check if it is required
776  std::map<std::string, std::size_t> imudevs;
777  for (auto i : getIndices(_module<Devices>().getSensorDevices().keys()))
778  {
779  const SensorDevicePtr& sensorDevice = _module<Devices>().getSensorDevices().at(i);
780  if (sensorDevice->getSensorValue()->isA<SensorValueIMU>())
781  {
782  imudevs[sensorDevice->getDeviceName()] = i;
783  }
784  }
785  if (imudevs.empty())
786  {
788  << "no inertial measurement unit created since there are no imu sensor devices";
789  return;
790  }
791  //add it
792  const std::string configName = getProperty<std::string>("InertialMeasurementUnitName");
793  const std::string confPre = getConfigDomain() + "." + configName + ".";
794  Ice::PropertiesPtr properties = getIceProperties()->clone();
795  //properties->setProperty(confPre + "MinimumLoggingLevel", getProperty<std::string>("MinimumLoggingLevel").getValue());
796  //fill properties
797  properties->setProperty(confPre + "IMUTopicName",
798  getProperty<std::string>("IMUTopicName").getValue());
800  Component::create<UnitT>(properties, configName, getConfigDomain());
801  unit->devs = imudevs;
802  //add
803  addUnit(std::move(unit));
804  }
805 
806  void
808  {
809  throwIfInControlThread(BOOST_CURRENT_FUNCTION);
810  auto guard = getGuard();
812  using UnitT = TrajectoryControllerSubUnit;
813  if (!getProperty<bool>("CreateTrajectoryPlayer").getValue())
814  {
815  return;
816  }
817 
818  //check if unit is already added
819  if (getUnit(UnitT::ice_staticId()) || !trajectoryControllerSubUnit)
820  {
821  return;
822  }
823  (TrajectoryControllerSubUnitPtr::dynamicCast(trajectoryControllerSubUnit))
824  ->setup(_modulePtr<RobotUnit>());
825  addUnit(trajectoryControllerSubUnit);
826  trajectoryControllerSubUnit = nullptr;
827  }
828 
829  void
831  {
832  throwIfInControlThread(BOOST_CURRENT_FUNCTION);
833  auto guard = getGuard();
835 
836  if (!getProperty<bool>("CreateTCPControlUnit").getValue())
837  {
838  return;
839  }
840  using UnitT = TCPControllerSubUnit;
841 
842  //check if unit is already added
843  if (getUnit(UnitT::ice_staticId()))
844  {
845  return;
846  }
847  (TCPControllerSubUnitPtr::dynamicCast(tcpControllerSubUnit))
848  ->setup(_modulePtr<RobotUnit>(), _module<RobotData>().cloneRobot());
849  addUnit(tcpControllerSubUnit);
850  tcpControllerSubUnit = nullptr;
851  }
852 
853  void
855  {
856  throwIfInControlThread(BOOST_CURRENT_FUNCTION);
857  ARMARX_CHECK_NOT_NULL(unit);
858  auto guard = getGuard();
860  getArmarXManager()->addObjectAsync(unit, "", true, false);
861  //maybe add it to the sub units
862  RobotUnitSubUnitPtr rsu = RobotUnitSubUnitPtr::dynamicCast(unit);
863  if (rsu)
864  {
865  subUnits.emplace_back(std::move(rsu));
866  }
867  units.emplace_back(std::move(unit));
868  }
869 
870  void
871  Units::_icePropertiesInitialized()
872  {
873  throwIfInControlThread(BOOST_CURRENT_FUNCTION);
874  Ice::PropertiesPtr properties = getIceProperties()->clone();
875  const std::string& configDomain = "ArmarX";
876  // create TCPControlSubUnit
877 
878  {
879  const std::string configNameTCPControlUnit =
880  getProperty<std::string>("TCPControlUnitName");
881  tcpControllerSubUnit = Component::create<TCPControllerSubUnit, TCPControllerSubUnitPtr>(
882  properties, configNameTCPControlUnit, configDomain);
883  addPropertyUser(PropertyUserPtr::dynamicCast(tcpControllerSubUnit));
884  }
885 
886  // create TrajectoryControllerSubUnit
887 
888  {
889  const std::string configNameTrajectoryControllerUnit =
890  getProperty<std::string>("TrajectoryControllerUnitName");
891  const std::string confPre =
892  configDomain + "." + configNameTrajectoryControllerUnit + ".";
893  properties->setProperty(confPre + "KinematicUnitName",
894  getProperty<std::string>("KinematicUnitName").getValue());
895  trajectoryControllerSubUnit =
896  Component::create<TrajectoryControllerSubUnit, TrajectoryControllerSubUnitPtr>(
897  properties, configNameTrajectoryControllerUnit, configDomain);
898  addPropertyUser(PropertyUserPtr::dynamicCast(trajectoryControllerSubUnit));
899  }
900  }
901 
902  void
903  Units::_preFinishRunning()
904  {
905  throwIfInControlThread(BOOST_CURRENT_FUNCTION);
906  //remove all units
907  subUnits.clear();
908  for (ManagedIceObjectPtr& unit : units)
909  {
910  getArmarXManager()->removeObjectBlocking(unit->getName());
911  }
912  units.clear();
913  }
914 
915  void
916  Units::_preOnInitRobotUnit()
917  {
918  throwIfInControlThread(BOOST_CURRENT_FUNCTION);
919  unitCreateRobot = _module<RobotData>().cloneRobot();
920  ARMARX_DEBUG << "add emergency stop master";
921  {
922  emergencyStopMaster = new RobotUnitEmergencyStopMaster{
923  &_module<ControlThread>(),
924  getProperty<std::string>("EmergencyStopTopic").getValue()};
925  ManagedIceObjectPtr obj = ManagedIceObjectPtr::dynamicCast(emergencyStopMaster);
926  ARMARX_CHECK_EXPRESSION(obj) << "RobotUnitEmergencyStopMaster";
927  getArmarXManager()->addObject(
928  obj, getProperty<std::string>("EmergencyStopMasterName").getValue(), true);
929  auto prx = obj->getProxy(-1);
930  try
931  {
932  getArmarXManager()->getIceManager()->getIceGridSession()->getAdmin()->addObject(
933  prx);
934  }
935  catch (const IceGrid::ObjectExistsException&)
936  {
937  getArmarXManager()->getIceManager()->getIceGridSession()->getAdmin()->updateObject(
938  prx);
939  }
940  catch (std::exception& e)
941  {
942  ARMARX_WARNING << "add the robot unit as emergency stop master to the ice grid "
943  "admin!\nThere was an exception:\n"
944  << e.what();
945  }
946  }
947  ARMARX_DEBUG << "add emergency stop master...done!";
948  }
949 
950  void
951  Units::_postOnExitRobotUnit()
952  {
953  throwIfInControlThread(BOOST_CURRENT_FUNCTION);
954  ARMARX_DEBUG << "remove EmergencyStopMaster";
955  try
956  {
957  getArmarXManager()->removeObjectBlocking(
958  ManagedIceObjectPtr::dynamicCast(emergencyStopMaster));
959  getArmarXManager()->getIceManager()->removeObject(
960  getProperty<std::string>("EmergencyStopMasterName").getValue());
961  }
962  catch (...)
963  {
964  }
965  ARMARX_DEBUG << "remove EmergencyStopMaster...done!";
966  }
967 
968  const ManagedIceObjectPtr&
969  Units::getUnit(const std::string& staticIceId) const
970  {
971  throwIfInControlThread(BOOST_CURRENT_FUNCTION);
972  auto guard = getGuard();
973  for (const ManagedIceObjectPtr& unit : units)
974  {
975  if (unit->ice_isA(staticIceId))
976  {
977  return unit;
978  }
979  }
981  }
982 } // namespace armarx::RobotUnitModule
armarx::SensorValueGlobalRobotPose
Definition: GlobalRobotPoseSensorDevice.h:41
armarx::RobotUnitModule::Units::initializePlatformUnit
virtual void initializePlatformUnit()
Initializes the PlatformUnit.
Definition: RobotUnitModuleUnits.cpp:472
armarx::RobotUnitModule::Units::initializeDefaultUnits
virtual void initializeDefaultUnits()
Calls all init hooks for all managed Units.
Definition: RobotUnitModuleUnits.cpp:201
armarx::NJointHolonomicPlatformVelocityControllerTypes::PassThroughController
@ PassThroughController
armarx::RobotUnitModule::Units::initializeForceTorqueUnit
virtual void initializeForceTorqueUnit()
Initializes the ForceTorqueUnit.
Definition: RobotUnitModuleUnits.cpp:699
armarx::NJointHolonomicPlatformGlobalPositionControllerConfig
Definition: NJointHolonomicPlatformGlobalPositionController.h:48
armarx::RobotUnitModule::Units::addUnit
void addUnit(ManagedIceObjectPtr unit)
Registers a unit for management (the Unit is added and removed to the ArmarXManager and updated with ...
Definition: RobotUnitModuleUnits.cpp:854
RobotUnitModuleUnits.h
armarx::KinematicSubUnit
Definition: KinematicSubUnit.h:43
armarx::SensorValueHolonomicPlatform
Definition: SensorValueHolonomicPlatform.h:128
armarx::SensorValueHolonomicPlatformRelativePosition
The robot's position relative to its initial pose when starting the robot unit based on odometry info...
Definition: SensorValueHolonomicPlatform.h:83
armarx::Component::addPropertyUser
void addPropertyUser(const PropertyUserPtr &subPropertyUser)
Add additional property users here that should show up in the application help text.
Definition: Component.cpp:140
ARMARX_IMPORTANT
#define ARMARX_IMPORTANT
Definition: Logging.h:183
armarx::SensorValueBase::asA
const T * asA() const
Definition: SensorValueBase.h:82
SensorValueHolonomicPlatform.h
armarx::ForceTorqueSubUnit::DeviceData::sensorIndex
std::size_t sensorIndex
Definition: ForceTorqueSubUnit.h:61
armarx::NJointHolonomicPlatformVelocityControllerTypes::ControllerWithRamp
@ ControllerWithRamp
SensorValueBattery.h
armarx::ControlTarget1DoFActuatorPWM
Definition: ControlTarget1DoFActuator.h:182
RobotUnit.h
armarx::core::time::DateTime::Now
static DateTime Now()
Definition: DateTime.cpp:55
armarx::ManagedIceObject::NullPtr
static const ManagedIceObjectPtr NullPtr
A nullptr to be used when a const ref to a nullptr is required.
Definition: ManagedIceObject.h:222
armarx::GlobalRobotLocalizationSensorDevice::DeviceName
static std::string DeviceName()
Definition: GlobalRobotPoseSensorDevice.cpp:109
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::getIndices
std::vector< KeyT > getIndices(const std::map< KeyT, ValT > &c)
Definition: algorithm.h:275
armarx::NJointKinematicUnitPassThroughControllerConfig
Definition: NJointKinematicUnitPassThroughController.h:39
armarx::NJointHolonomicPlatformRelativePositionControllerConfig
Definition: NJointHolonomicPlatformRelativePositionController.h:46
armarx::NJointHolonomicPlatformUnitVelocityPassThroughControllerConfig
Definition: NJointHolonomicPlatformUnitVelocityPassThroughController.h:38
armarx::NJointHolonomicPlatformVelocityControllerTypesNames
const simox::meta::EnumNames< NJointHolonomicPlatformVelocityControllerTypes > NJointHolonomicPlatformVelocityControllerTypesNames
Definition: NJointHolonomicPlatformVelocityControllerTypes.h:37
armarx::ManagedIceObject::getArmarXManager
ArmarXManagerPtr getArmarXManager() const
Returns the ArmarX manager used to add and remove components.
Definition: ManagedIceObject.cpp:348
armarx::RobotUnitModule::Units::createKinematicSubUnit
ManagedIceObjectPtr createKinematicSubUnit(const Ice::PropertiesPtr &properties, const std::string &positionControlMode=ControlModes::Position1DoF, const std::string &velocityControlMode=ControlModes::Velocity1DoF, const std::string &torqueControlMode=ControlModes::Torque1DoF, const std::string &pwmControlMode=ControlModes::PWM1DoF)
Create the KinematicUnit (this function should be called in initializeKinematicUnit)
Definition: RobotUnitModuleUnits.cpp:319
armarx::RobotUnitModule::Units::getUnits
Ice::ObjectProxySeq getUnits(const Ice::Current &) const override
Returns proxies to all units.
Definition: RobotUnitModuleUnits.cpp:162
ProsthesisInterface.values
values
Definition: ProsthesisInterface.py:190
armarx::RobotUnitModule::RobotUnitEmergencyStopMaster::getEmergencyStopState
EmergencyStopState getEmergencyStopState(const Ice::Current &=Ice::emptyCurrent) const final override
Definition: RobotUnitModuleUnits.cpp:123
armarx::TrajectoryControllerSubUnit
Definition: TrajectoryControllerSubUnit.h:80
armarx::JointController
The JointController class represents one joint in one control mode.
Definition: JointController.h:51
armarx::NJointHolonomicPlatformVelocityControllerWithRampConfig::platformName
std::string platformName
Definition: NJointHolonomicPlatformVelocityControllerWithRamp.h:59
armarx::PlatformSubUnit
Definition: PlatformSubUnit.h:47
armarx::RobotUnitModule::Units::initializeInertialMeasurementUnit
virtual void initializeInertialMeasurementUnit()
Initializes the InertialMeasurementUnit.
Definition: RobotUnitModuleUnits.cpp:762
armarx::RobotUnitModule::RobotUnitEmergencyStopMaster::RobotUnitEmergencyStopMaster
RobotUnitEmergencyStopMaster(ControlThread *controlThreadModule, std::string emergencyStopTopicName)
Definition: RobotUnitModuleUnits.cpp:71
ARMARX_CHECK
#define ARMARX_CHECK(expression)
Shortcut for ARMARX_CHECK_EXPRESSION.
Definition: ExpressionException.h:82
armarx::RobotUnitModule::RobotUnitEmergencyStopMaster::ss2StateMutex
std::shared_mutex ss2StateMutex
Definition: RobotUnitModuleUnits.cpp:154
armarx::RobotUnitModule::RobotUnitEmergencyStopMaster::lastSS2Activation
armarx::core::time::DateTime lastSS2Activation
Definition: RobotUnitModuleUnits.cpp:155
armarx::NJointHolonomicPlatformRelativePositionControllerConfig::platformName
std::string platformName
Definition: NJointHolonomicPlatformRelativePositionController.h:50
cxxopts::empty
bool empty(const std::string &s)
Definition: cxxopts.hpp:255
IceInternal::Handle< ManagedIceObject >
armarx::RobotUnitState::InitializingUnits
@ InitializingUnits
ARMARX_TRACE
#define ARMARX_TRACE
Definition: trace.h:69
armarx::RobotUnitModule::Units::initializeTcpControllerUnit
virtual void initializeTcpControllerUnit()
Initializes the TcpControllerUnit.
Definition: RobotUnitModuleUnits.cpp:830
armarx::RobotUnitModule::ControlThread
This Module manages the ControlThread.
Definition: RobotUnitModuleControlThread.h:83
armarx::RobotUnitModule::Units::getUnit
T::PointerType getUnit() const
Returns a pointer to the Unit for the given type (or null if there is none)
Definition: RobotUnitModuleUnits.ipp:66
armarx::InertialMeasurementSubUnit
Definition: InertialMeasurementSubUnit.h:36
armarx::NJointHolonomicPlatformVelocityControllerTypes
NJointHolonomicPlatformVelocityControllerTypes
Definition: NJointHolonomicPlatformVelocityControllerTypes.h:29
armarx::RobotUnitModule::ControlThreadAttorneyForRobotUnitEmergencyStopMaster
This class allows minimal access to private members of ControlThread in a sane fashion for RobotUnitE...
Definition: RobotUnitModuleUnits.cpp:51
armarx::GlobalRobotLocalizationSensorDevice
Definition: GlobalRobotPoseSensorDevice.h:104
armarx::RobotUnitModule::RobotUnitEmergencyStopMaster
Definition: RobotUnitModuleUnits.cpp:66
armarx::RobotUnitModule::RobotUnitEmergencyStopMaster::controlThreadModule
ControlThread *const controlThreadModule
Definition: RobotUnitModuleUnits.cpp:151
armarx::GlobalRobotPoseCorrectionSensorDevice::DeviceName
static std::string DeviceName()
Definition: GlobalRobotPoseSensorDevice.cpp:40
ARMARX_DEBUG
#define ARMARX_DEBUG
Definition: Logging.h:177
armarx::RobotUnitModule::Units::initializeKinematicUnit
virtual void initializeKinematicUnit()
Initializes the KinematicUnit.
Definition: RobotUnitModuleUnits.cpp:298
armarx::ManagedIceObjectPtr
IceInternal::Handle< ManagedIceObject > ManagedIceObjectPtr
Definition: ArmarXFwd.h:42
armarx::RobotUnitModule::ModuleBase::getGuard
GuardType getGuard() const
Returns a guard to the RobotUnits mutex.
Definition: RobotUnitModuleBase.cpp:430
armarx::LocalizationSubUnit
Definition: LocalizationSubUnit.h:69
IceManager.h
DiagnosticsSubUnit.h
max
T max(T t1, T t2)
Definition: gdiam.h:48
IceGridAdmin.h
ARMARX_ERROR
#define ARMARX_ERROR
Definition: Logging.h:189
armarx::RobotUnitModule::Units::getEmergencyStopMaster
const EmergencyStopMasterInterfacePtr & getEmergencyStopMaster() const
Returns a pointer to the EmergencyStopMaster.
Definition: RobotUnitModuleUnits.cpp:194
ForceTorqueSubUnit.h
armarx::Component::getConfigDomain
std::string getConfigDomain()
Retrieve config domain for this component as set in constructor.
Definition: Component.cpp:60
armarx::SensorValueGlobalPoseCorrection
The pose correction to obtain the robot's global pose.
Definition: GlobalRobotPoseSensorDevice.h:26
armarx::ForceTorqueSubUnit::DeviceData::frame
std::string frame
Definition: ForceTorqueSubUnit.h:62
armarx::TimeUtil::GetTime
static IceUtil::Time GetTime(TimeMode timeMode=TimeMode::VirtualTime)
Get the current time.
Definition: TimeUtil.cpp:42
armarx::NJointKinematicUnitPassThroughControllerConfig::controlMode
std::string controlMode
Definition: NJointKinematicUnitPassThroughController.h:43
armarx::control::common::getValue
T getValue(nlohmann::json &userConfig, nlohmann::json &defaultConfig, const std::string &entryName)
Definition: utils.h:71
armarx::core::time::DateTime
Represents a point in time.
Definition: DateTime.h:24
armarx::TCPControllerSubUnit
Definition: TCPControllerSubUnit.h:55
TrajectoryControllerSubUnit.h
armarx::RobotUnitModule::Units::initializeDiagnosticsUnit
virtual void initializeDiagnosticsUnit()
Initialize the diagnostics unit.
Definition: RobotUnitModuleUnits.cpp:261
armarx::ManagedIceObject
The ManagedIceObject is the base class for all ArmarX objects.
Definition: ManagedIceObject.h:163
armarx::RobotUnitModule::RobotUnitEmergencyStopMaster::setEmergencyStopState
void setEmergencyStopState(EmergencyStopState state, const Ice::Current &=Ice::emptyCurrent) final override
Definition: RobotUnitModuleUnits.cpp:80
ARMARX_CHECK_EXPRESSION
#define ARMARX_CHECK_EXPRESSION(expression)
This macro evaluates the expression and if it turns out to be false it will throw an ExpressionExcept...
Definition: ExpressionException.h:73
armarx::ControlTargetBase::isA
bool isA() const
Definition: ControlTargetBase.h:69
NJointHolonomicPlatformVelocityControllerWithRamp.h
ARMARX_INFO
#define ARMARX_INFO
Definition: Logging.h:174
KinematicSubUnit.h
armarx::RobotUnitModule::Units::initializeTrajectoryControllerUnit
virtual void initializeTrajectoryControllerUnit()
Initializes the TrajectoryControllerUnit.
Definition: RobotUnitModuleUnits.cpp:807
armarx::ManagedIceObject::offeringTopic
void offeringTopic(const std::string &name)
Registers a topic for retrival after initialization.
Definition: ManagedIceObject.cpp:290
armarx::ForceTorqueSubUnit::DeviceData::deviceName
std::string deviceName
Definition: ForceTorqueSubUnit.h:60
armarx::RobotUnit
The RobotUnit class manages a robot and its controllers.
Definition: RobotUnit.h:180
armarx::RobotUnitModule::RobotUnitEmergencyStopMaster::onInitComponent
void onInitComponent() final override
Pure virtual hook for the subclass.
Definition: RobotUnitModuleUnits.cpp:131
armarx::RobotUnitModule::RobotUnitEmergencyStopMaster::trySetEmergencyStopState
EmergencyStopState trySetEmergencyStopState(EmergencyStopState targetState, const ::Ice::Current &) final override
Definition: RobotUnitModuleUnits.cpp:105
armarx::core::time::Duration
Represents a duration.
Definition: Duration.h:17
LocalizationSubUnit.h
armarx::RobotUnitModule::Units::initializeLocalizationUnit
virtual void initializeLocalizationUnit()
Initializes the TcpControllerUnit.
Definition: RobotUnitModuleUnits.cpp:625
armarx::ForceTorqueSubUnit
Definition: ForceTorqueSubUnit.h:34
armarx::RobotUnitModule::RobotUnitEmergencyStopMaster::emergencyStopTopic
EmergencyStopListenerPrx emergencyStopTopic
Definition: RobotUnitModuleUnits.cpp:153
armarx::RobotUnitModule::ModuleBase::throwIfInControlThread
void throwIfInControlThread(const std::string &fnc) const
Throws if the current thread is the ControlThread.
Definition: RobotUnitModuleBase.cpp:416
armarx::DiagnosticsSubUnit
Definition: DiagnosticsSubUnit.h:14
armarx::RobotUnitModule::ControlThread::getEmergencyStopState
EmergencyStopState getEmergencyStopState() const
Returns the ControlThread's target EmergencyStopState.
Definition: RobotUnitModuleControlThread.cpp:1006
armarx::NJointHolonomicPlatformUnitVelocityPassThroughControllerConfig::initialVelocityX
float initialVelocityX
Definition: NJointHolonomicPlatformUnitVelocityPassThroughController.h:43
time.h
armarx::ForceTorqueSubUnit::DeviceData
Definition: ForceTorqueSubUnit.h:58
armarx::RobotUnitModule::RobotUnitEmergencyStopMaster::getDefaultName
std::string getDefaultName() const final override
Retrieve default name of component.
Definition: RobotUnitModuleUnits.cpp:145
GlobalRobotPoseSensorDevice.h
armarx::ManagedIceObject::getName
std::string getName() const
Retrieve name of object.
Definition: ManagedIceObject.cpp:107
armarx::NJointHolonomicPlatformVelocityControllerWithRampConfig
Definition: NJointHolonomicPlatformVelocityControllerWithRamp.h:55
armarx::GlobalRobotLocalizationSensorDevice::sensorGlobalPositionCorrection
const SensorValueGlobalPoseCorrection * sensorGlobalPositionCorrection
Definition: GlobalRobotPoseSensorDevice.h:114
armarx::RobotUnitModule::ModuleBase::throwIfStateIsNot
void throwIfStateIsNot(const std::set< RobotUnitState > &stateSet, const std::string &fnc, bool onlyWarn=false) const
Throws an exception if the current state is not in.
Definition: RobotUnitModuleBase.cpp:456
armarx::SensorValueBattery
Definition: SensorValueBattery.h:19
TCPControllerSubUnit.h
armarx::RobotUnitModule
Definition: ControlDevice.h:34
NJointHolonomicPlatformUnitVelocityPassThroughController.h
armarx::PropertyUser::getIceProperties
Ice::PropertiesPtr getIceProperties() const
Returns the set of Ice properties.
Definition: PropertyUser.cpp:229
armarx::JointController::getControlTarget
virtual ControlTargetBase * getControlTarget()=0
Definition: JointController.h:144
armarx::NJointHolonomicPlatformGlobalPositionControllerConfig::platformName
std::string platformName
Definition: NJointHolonomicPlatformGlobalPositionController.h:52
armarx::RobotUnitModule::RobotUnitEmergencyStopMaster::emergencyStopTopicName
const std::string emergencyStopTopicName
Definition: RobotUnitModuleUnits.cpp:152
armarx::SensorValueForceTorque
Definition: SensorValueForceTorque.h:31
ARMARX_WARNING
#define ARMARX_WARNING
Definition: Logging.h:186
InertialMeasurementSubUnit.h
armarx::GlobalRobotLocalizationSensorDevice::sensorRelativePosition
const SensorValueHolonomicPlatformRelativePosition * sensorRelativePosition
Definition: GlobalRobotPoseSensorDevice.h:115
PlatformSubUnit.h
armarx::RobotUnitModule::RobotUnitEmergencyStopMaster::onConnectComponent
void onConnectComponent() final override
Pure virtual hook for the subclass.
Definition: RobotUnitModuleUnits.cpp:137
SensorValue1DoFActuator.h
armarx::core::time::Duration::MilliSeconds
static Duration MilliSeconds(std::int64_t milliSeconds)
Constructs a duration in milliseconds.
Definition: Duration.cpp:55
armarx::SensorValueIMU
Definition: SensorValueIMU.h:35