RobotUnitModuleDevices.h
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 #pragma once
24 
25 #include <mutex>
26 
28 #include <RobotAPI/interface/units/RobotUnit/RobotUnitInterface.h>
29 
30 #include "../Devices/ControlDevice.h"
31 #include "../Devices/RTThreadTimingsSensorDevice.h"
32 #include "../Devices/SensorDevice.h"
33 #include "../SensorValues/SensorValue1DoFActuator.h"
34 #include "RobotUnitModuleBase.h"
35 
37 {
39  {
40  public:
42  {
43  defineOptionalProperty<std::string>(
44  "ControlDevices_HardwareControlModeGroups",
45  "",
46  "Groups of control devices for which the same hardware control mode has to be set. "
47  "For a control mode, the JointControllers of all devices in a group must have the "
48  "identical hardware control mode. "
49  "The kinematic unit will change the control mode of all joints in a group,"
50  " if their current hw control mode does not match the new hw control mode. "
51  "This can be used if the robot has a multi DOF joint which is represented by "
52  "multiple 1DOF control devices "
53  "(in such a case all of these 1DOF joints should have the same hw control mode, "
54  "except he multi DOF joint can handle different control modes at once). "
55  "Syntax: semicolon separated groups , each group is CSV of joints "
56  "e.g. j1,j2;j3,j4,j5 -> Group 1 = j1+j2 Group 2 = j3+j4+j5; No joint may be in two "
57  "groups!");
58  }
59  };
60 
61  /**
62  * @ingroup Library-RobotUnit-Modules
63  * @brief This \ref ModuleBase "Module" manages sensor and control devices for a RobotUnit and only allows save and sane access.
64  *
65  * @see ModuleBase
66  */
67  class Devices : virtual public ModuleBase, virtual public RobotUnitDevicesInterface
68  {
69  friend class ModuleBase;
70 
71  public:
73 
74  /**
75  * @brief Returns the singleton instance of this class
76  * @return The singleton instance of this class
77  */
78  static Devices&
80  {
81  return ModuleBase::Instance<Devices>();
82  }
83 
84  // //////////////////////////////////////////////////////////////////////////////////////// //
85  // ///////////////////////////////// RobotUnitModule hooks //////////////////////////////// //
86  // //////////////////////////////////////////////////////////////////////////////////////// //
87  private:
88  /// @see ModuleBase::_preOnInitRobotUnit
89  void _preOnInitRobotUnit();
90  /// @see ModuleBase::_preFinishDeviceInitialization
91  void _preFinishDeviceInitialization();
92  /// @see ModuleBase::_postFinishDeviceInitialization
93  void _postFinishDeviceInitialization();
94  /// @see ModuleBase::_postFinishRunning
95  void _postFinishRunning();
96  // //////////////////////////////////////////////////////////////////////////////////////// //
97  // ///////////////////////////////////// ice interface //////////////////////////////////// //
98  // //////////////////////////////////////////////////////////////////////////////////////// //
99  public:
100  /**
101  * @brief Returns the names of all \ref ControlDevice "ControlDevices" for the robot.
102  * @return The names of all \ref ControlDevice "ControlDevices" for the robot.
103  */
104  Ice::StringSeq
105  getControlDeviceNames(const Ice::Current& = Ice::emptyCurrent) const override;
106 
107  /**
108  * @brief Return the \ref ControlDeviceDescription for the given \ref ControlDevice
109  * @param name The \ref ControlDevice
110  * @return The \ref ControlDeviceDescription
111  * @see ControlDeviceDescription
112  * @see getControlDeviceDescriptions
113  */
114  ControlDeviceDescription
115  getControlDeviceDescription(const std::string& name,
116  const Ice::Current& = Ice::emptyCurrent) const override;
117  /**
118  * @brief Return the \ref ControlDeviceDescription "ControlDeviceDescriptions" for all \ref ControlDevice "ControlDevices"
119  * @return The \ref ControlDeviceDescription "ControlDeviceDescriptions"
120  * @see ControlDeviceDescription
121  * @see getControlDeviceDescription
122  */
123  ControlDeviceDescriptionSeq
124  getControlDeviceDescriptions(const Ice::Current& = Ice::emptyCurrent) const override;
125 
126  /**
127  * @brief Return the \ref ControlDeviceStatus for the given \ref ControlDevice
128  * @param name The \ref ControlDevice
129  * @return The \ref ControlDeviceStatus
130  * @see ControlDeviceStatus
131  * @see getControlDeviceStatuses
132  */
133  ControlDeviceStatus
134  getControlDeviceStatus(const std::string& name,
135  const Ice::Current& = Ice::emptyCurrent) const override;
136  /**
137  * @brief Return the \ref ControlDeviceStatus "ControlDeviceStatuses" for all \ref ControlDevice "ControlDevices"
138  * @return The \ref ControlDeviceStatus "ControlDeviceStatuses"
139  * @see ControlDeviceStatus
140  * @see getControlDeviceStatus
141  */
142  ControlDeviceStatusSeq
143  getControlDeviceStatuses(const Ice::Current& = Ice::emptyCurrent) const override;
144 
145  /**
146  * @brief Returns the names of all \ref SensorDevice "SensorDevices" for the robot.
147  * @return The names of all \ref SensorDevice "ControlDevices" for the robot.
148  */
149  Ice::StringSeq getSensorDeviceNames(const Ice::Current& = Ice::emptyCurrent) const override;
150 
151  /**
152  * @brief Return the \ref SensorDeviceDescription for the given \ref SensorDevice
153  * @param name The \ref SensorDevice
154  * @return The \ref SensorDeviceDescription
155  * @see SensorDeviceDescription
156  * @see getSensorDeviceDescriptions
157  */
158  SensorDeviceDescription
159  getSensorDeviceDescription(const std::string& name,
160  const Ice::Current& = Ice::emptyCurrent) const override;
161  /**
162  * @brief Return the \ref SensorDeviceDescription "SensorDeviceDescriptions" for all \ref SensorDevice "SensorDevices"
163  * @return The \ref SensorDeviceDescription "SensorDeviceDescriptions"
164  * @see SensorDeviceDescription
165  * @see getSensorDeviceDescription
166  */
167  SensorDeviceDescriptionSeq
168  getSensorDeviceDescriptions(const Ice::Current& = Ice::emptyCurrent) const override;
169 
170  /**
171  * @brief Return the \ref SensorDeviceStatus for the given \ref SensorDevice
172  * @param name The \ref SensorDevice
173  * @return The \ref SensorDeviceStatus
174  * @see SensorDeviceStatus
175  * @see getSensorDeviceStatuses
176  */
177  SensorDeviceStatus
178  getSensorDeviceStatus(const std::string& name,
179  const Ice::Current& = Ice::emptyCurrent) const override;
180  /**
181  * @brief Return the \ref SensorDeviceStatus "SensorDeviceStatuses" for all \ref SensorDevice "SensorDevices"
182  * @return The \ref SensorDeviceStatus "SensorDeviceStatuses"
183  * @see SensorDeviceStatus
184  * @see getSensorDeviceStatus
185  */
186  SensorDeviceStatusSeq
187  getSensorDeviceStatuses(const Ice::Current& = Ice::emptyCurrent) const override;
188  // //////////////////////////////////////////////////////////////////////////////////////// //
189  // /////////////////////////////////// Module interface /////////////////////////////////// //
190  // //////////////////////////////////////////////////////////////////////////////////////// //
191  public:
192  /**
193  * @brief Returns the number of \ref ControlDevice "ControlDevices"
194  * @return The number of \ref ControlDevice "ControlDevices"
195  */
196  std::size_t getNumberOfControlDevices() const;
197  /**
198  * @brief Returns the number of \ref SensorDevice "SensorDevices"
199  * @return The number of \ref SensorDevice "SensorDevices"
200  */
201  std::size_t getNumberOfSensorDevices() const;
202 
203  /**
204  * @brief Return the \ref ControlDeviceDescription for the given \ref ControlDevice
205  * @param idx The \ref ControlDevice's index
206  * @return The \ref ControlDeviceDescription for the given \ref ControlDevice
207  * @see ControlDeviceDescription
208  * @see getControlDeviceDescription
209  * @see getControlDeviceDescriptions
210  */
211  ControlDeviceDescription getControlDeviceDescription(std::size_t idx) const;
212  /**
213  * @brief Return the \ref ControlDeviceStatus for the given \ref ControlDevice
214  * @param idx The \ref ControlDevice's index
215  * @return The \ref ControlDeviceStatus
216  * @see ControlDeviceStatus
217  * @see getControlDeviceStatus
218  * @see getControlDeviceStatuses
219  */
220  ControlDeviceStatus getControlDeviceStatus(std::size_t idx) const;
221 
222  /**
223  * @brief Return the \ref SensorDeviceDescription for the given \ref SensorDevice
224  * @param idx The \ref SensorDevice's index
225  * @return The \ref SensorDeviceDescription for the given \ref SensorDevice
226  * @see SensorDeviceDescription
227  * @see getSensorDeviceDescription
228  * @see getSensorDeviceDescriptions
229  */
230  SensorDeviceDescription getSensorDeviceDescription(std::size_t idx) const;
231  /**
232  * @brief Return the \ref SensorDeviceStatus for the given \ref SensorDevice
233  * @param idx The \ref SensorDevice's index
234  * @return The \ref SensorDeviceStatus
235  * @see SensorDeviceStatus
236  * @see getSensorDeviceStatus
237  * @see getSensorDeviceStatuses
238  */
239  SensorDeviceStatus getSensorDeviceStatus(std::size_t idx) const;
240 
241  /**
242  * @brief Updates the given VirtualRobot with the given \ref SensorValue "SensorValues"
243  * @param robot The VirtualRobot to update
244  * @param sensors The \ref SensorValue "SensorValues"
245  */
246  template <class PtrT>
247  void
249  const std::vector<PtrT>& sensors) const
250  {
251  updateVirtualRobotFromSensorValues(robot, robot->getRobotNodes(), sensors);
252  }
253 
254  /**
255  * @brief Updates the given VirtualRobot with the given \ref SensorValue "SensorValues"
256  *
257  * This overload is slightly faster than the other version.
258  * @param robot The VirtualRobot to update
259  * @param nodes The VirtualRobot's RobotNodes
260  * @param sensors The \ref SensorValue "SensorValues"
261  */
262  template <class PtrT>
263  void
265  const std::vector<VirtualRobot::RobotNodePtr>& nodes,
266  const std::vector<PtrT>& sensors) const
267  {
268  ARMARX_CHECK_NOT_NULL(robot);
269 
270  for (const SimoxRobotSensorValueMapping& m : simoxRobotSensorValueMapping)
271  {
272  const SensorValueBase* sv = sensors.at(m.idxSens);
274  const SensorValue1DoFActuatorPosition* svPos =
275  sv->asA<SensorValue1DoFActuatorPosition>();
276  ARMARX_CHECK_NOT_NULL(svPos);
277  nodes.at(m.idxRobot)->setJointValueNoUpdate(svPos->position);
278  }
279 
280  // update global pose
281  if (globalRobotLocalizationSensorDevice != nullptr)
282  {
283  const auto sensorValue =
284  globalRobotLocalizationSensorDevice->getSensorValue()
286  const auto global_T_root = sensorValue->global_T_root;
287  robot->setGlobalPose(global_T_root, false);
288  }
289 
290  robot->applyJointValues();
291  }
292 
293  /**
294  * @brief Returns the groups of \ref ControlDevice "ControlDevices" required to be in the same
295  * hardware control mode. (explained \ref RobotUnitCtrlModeGroups "here")
296  * @return The groups of \ref ControlDevice "ControlDevices" required to be in the same
297  * hardware control mode.
298  */
299  const ControlDeviceHardwareControlModeGroups&
301  {
302  return ctrlModeGroups;
303  }
304 
305  /**
306  * @brief Returns the \ref ControlDevice's index
307  * @param deviceName \ref ControlDevice's name.
308  * @return The \ref ControlDevice's index
309  */
310  std::size_t getControlDeviceIndex(const std::string& deviceName) const;
311  /**
312  * @brief Returns the \ref SensorDevice's index
313  * @param deviceName \ref SensorDevice's name.
314  * @return The \ref SensorDevice's index
315  */
316  std::size_t getSensorDeviceIndex(const std::string& deviceName) const;
317 
318  /**
319  * @brief Returns the \ref ControlDevice
320  * @param deviceName \ref ControlDevice's name.
321  * @return The \ref ControlDevice
322  */
324  const std::string& deviceName) const; /// TODO move to attorney for NJointControllerBase
325  /**
326  * @brief Returns the \ref SensorDevice
327  * @param deviceName \ref SensorDevice's name.
328  * @return The \ref SensorDevice
329  */
331  const std::string& deviceName) const; /// TODO move to attorney for NJointControllerBase
332 
333  /**
334  * @brief Returns all \ref SensorDevice "SensorDevices"
335  * @return All \ref SensorDevice "SensorDevices"
336  */
338  getSensorDevices() const ///TODO remove from interface
339  {
340  return sensorDevices;
341  }
342 
343  /**
344  * @brief Returns all \ref ControlDevice "ControlDevices"
345  * @return All \ref ControlDevice "ControlDevices"
346  */
348  getControlDevices() const ///TODO remove from interface
349  {
350  return controlDevices;
351  }
352 
353  /**
354  * @brief Returns const pointers to all \ref SensorDevice "SensorDevices"
355  * @return Const pointers to all \ref SensorDevice "SensorDevices"
356  */
357  const std::map<std::string, ConstSensorDevicePtr>&
358  getSensorDevicesConstPtr() const ///TODO rename to getSensorDevices
359  {
360  return sensorDevicesConstPtr;
361  }
362 
363  /**
364  * @brief Returns const pointers to all \ref ControlDevice "ControlDevices"
365  * @return Const pointers to all \ref ControlDevice "ControlDevices"
366  */
367  const std::map<std::string, ConstControlDevicePtr>&
368  getControlDevicesConstPtr() const ///TODO rename to getControlDevices
369  {
370  return controlDevicesConstPtr;
371  }
372 
373  protected:
374  /**
375  * @brief Adds a \ref ControlDevice to the robot.
376  * \warning Must not be called when the \ref RobotUnit's \ref RobotUnitState "state" is not \ref RobotUnitState::InitializingDevices
377  * @param cd The \ref ControlDevice to add
378  */
379  void addControlDevice(const ControlDevicePtr& cd);
380  /**
381  * @brief Adds a \ref SensorDevice to the robot.
382  * \warning Must not be called when the \ref RobotUnit's \ref RobotUnitState "state" is not \ref RobotUnitState::InitializingDevices
383  * @param cd The \ref SensorDevice to add
384  */
385  void addSensorDevice(const SensorDevicePtr& sd);
386  /**
387  * @brief Creates the \ref SensorDevice used to log timings in the \ref ControlThread
388  * (This function is supposed to be used in the \ref ModuleBase::finishDeviceInitialization)
389  * @return The \ref SensorDevice used to log timings in the \ref ControlThread
390  * @see rtGetRTThreadTimingsSensorDevice
391  */
392  virtual RTThreadTimingsSensorDevicePtr createRTThreadTimingSensorDevice() const;
393 
394  /**
395  * @brief Returns the \ref SensorDevice used to log timings in the \ref ControlThread.
396  * (This function is supposed to be used in the \ref ControlThread)
397  * @return The \ref SensorDevice used to log timings in the \ref ControlThread
398  * @see createRTThreadTimingSensorDevice
399  */
402  {
403  return *rtThreadTimingsSensorDevice;
404  }
405 
406  // //////////////////////////////////////////////////////////////////////////////////////// //
407  // //////////////////////////////////// implementation //////////////////////////////////// //
408  // //////////////////////////////////////////////////////////////////////////////////////// //
409  private:
410  /**
411  * @brief Returns the stop movement \ref JointController "JointControllers"
412  * for all \ref ControlDevice "ControlDevices"
413  * @return The stop movement \ref JointController "JointControllers"
414  */
415  std::vector<JointController*> getStopMovementJointControllers() const;
416  /**
417  * @brief Returns the emergency stop \ref JointController "JointControllers"
418  * for all \ref ControlDevice "ControlDevices"
419  * @return The emergency stop \ref JointController "JointControllers"
420  */
421  std::vector<JointController*> getEmergencyStopJointControllers() const;
422  // //////////////////////////////////////////////////////////////////////////////////////// //
423  // ///////////////////////////////////////// Data ///////////////////////////////////////// //
424  // //////////////////////////////////////////////////////////////////////////////////////// //
425  private:
426  /// @brief Struct correlating a \ref VirtualRobot::RobotNode to a \ref SensorDevice
427  struct SimoxRobotSensorValueMapping
428  {
429  /// @brief The RobotNode's index
430  std::size_t idxRobot;
431  /// @brief The \ref SensorDevice's index
432  std::size_t idxSens;
433  };
434 
435  /// @brief Mapping from RobotNode index to \ref SensorDevice
436  std::vector<SimoxRobotSensorValueMapping> simoxRobotSensorValueMapping;
437  /// @brief Pointers to all \ref SensorValueBase "SensorValues"
438  std::vector<const SensorValueBase*> sensorValues;
439  /// @brief Pointers to all \ref ControlTargetBase "ControlTargets"
440  std::vector<std::vector<PropagateConst<ControlTargetBase*>>> controlTargets;
441 
442  public:
443  /// @brief Holds data about a device group requiring the same hardware control mode. (explained \ref RobotUnitCtrlModeGroups "here")
445  {
446  /// @brief contains a vector per group.
447  /// Each vector contains the names of devices in this group.
448  std::vector<std::set<std::string>> groups;
449  /// @brief contains a vector per group.
450  /// Each vector contains the indices of devices in this group.
451  std::vector<std::vector<std::size_t>> deviceIndices;
452  /// @brief contains the names of all devices in any group
453  std::set<std::string> groupsMerged;
454  /// @brief contains the group index for each device (or the sentinel)
455  std::vector<std::size_t> groupIndices;
456  };
457 
458  private:
459  //ctrl dev
460  /// @brief \ref ControlDevice "ControlDevices" added to this unit (data may only be added during and only be used after \ref State::InitializingDevices)
462  /// @brief const pointer to all ControlDevices (passed to GenerateConfigDescription of a NJointControllerBase)
463  std::map<std::string, ConstControlDevicePtr> controlDevicesConstPtr;
464  /// @brief Guards access to all \ref ControlDevice "ControlDevices"
465  mutable MutexType controlDevicesMutex;
466 
467  /// @brief Device groups requiring the same hardware control mode.
469 
470  //sens dev
471  /// @brief \ref SensorDevice "SensorDevices" added to this unit (data may only be added during and only be used after \ref State::InitializingDevices)
473  /// @brief const pointer to all SensorDevices (passed to GenerateConfigDescription of a NJointControllerBase)
474  std::map<std::string, ConstSensorDevicePtr> sensorDevicesConstPtr;
475  /// @brief Guards access to all \ref SensorDevice "SensorDevices"
476  mutable MutexType sensorDevicesMutex;
477 
478  /// @brief a pointer to the RTThreadTimingsSensorDevice used to meassure timings in the rt loop
479  RTThreadTimingsSensorDevicePtr rtThreadTimingsSensorDevice;
480 
481  armarx::ConstSensorDevicePtr globalRobotLocalizationSensorDevice;
482 
483  /// @brief The device name of rtThreadTimingsSensorDevice
484  static const std::string rtThreadTimingsSensorDeviceName;
485  // //////////////////////////////////////////////////////////////////////////////////////// //
486  // /////////////////////////////////////// Attorneys ////////////////////////////////////// //
487  // //////////////////////////////////////////////////////////////////////////////////////// //
488  private:
489  /**
490  * \brief This class allows minimal access to private members of \ref Devices in a sane fashion for \ref Publisher.
491  * \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 !!
492  */
494  /**
495  * \brief This class allows minimal access to private members of \ref Devices in a sane fashion for \ref ControlThread.
496  * \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 !!
497  */
499  /**
500  * \brief This class allows minimal access to private members of \ref Devices in a sane fashion for \ref ControlThreadDataBuffer.
501  * \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 !!
502  */
504  /**
505  * \brief This class allows minimal access to private members of \ref armarx::RobotUnitModule::Devices in a sane fashion for \ref armarx::NJointControllerBase.
506  * \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 !!
507  */
509  };
510 } // namespace armarx::RobotUnitModule
armarx::SensorValueGlobalRobotPose
Definition: GlobalRobotPoseSensorDevice.h:41
armarx::RobotUnitModule::Devices::getSensorDevices
const KeyValueVector< std::string, SensorDevicePtr > & getSensorDevices() const
TODO move to attorney for NJointControllerBase.
Definition: RobotUnitModuleDevices.h:338
armarx::RobotUnitModule::ModuleBase::MutexType
std::recursive_timed_mutex MutexType
The type of recursive_mutex used in this class.
Definition: RobotUnitModuleBase.h:225
armarx::RobotUnitModule::DevicesAttorneyForPublisher
This class allows minimal access to private members of Devices in a sane fashion for Publisher.
Definition: RobotUnitModulePublisher.cpp:91
armarx::RobotUnitModule::Devices::getControlDevice
ConstControlDevicePtr getControlDevice(const std::string &deviceName) const
Returns the ControlDevice.
Definition: RobotUnitModuleDevices.cpp:118
armarx::SensorValueBase::asA
const T * asA() const
Definition: SensorValueBase.h:82
armarx::SensorValueBase
The SensorValueBase class.
Definition: SensorValueBase.h:40
armarx::RobotUnitModule::DevicesAttorneyForControlThread
This class allows minimal access to private members of Devices in a sane fashion for ControlThread.
Definition: RobotUnitModuleControlThread.cpp:222
RobotUnitModuleBase.h
armarx::RobotUnitModule::Devices::updateVirtualRobotFromSensorValues
void updateVirtualRobotFromSensorValues(const VirtualRobot::RobotPtr &robot, const std::vector< VirtualRobot::RobotNodePtr > &nodes, const std::vector< PtrT > &sensors) const
Updates the given VirtualRobot with the given SensorValues.
Definition: RobotUnitModuleDevices.h:264
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::RobotUnitModule::DevicesAttorneyForControlThreadDataBuffer
This class allows minimal access to private members of Devices in a sane fashion for ControlThreadDat...
Definition: RobotUnitModuleControlThreadDataBuffer.cpp:36
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:333
armarx::RobotUnitModule::Devices::getControlDevicesConstPtr
const std::map< std::string, ConstControlDevicePtr > & getControlDevicesConstPtr() const
Returns const pointers to all ControlDevices.
Definition: RobotUnitModuleDevices.h:368
armarx::RobotUnitModule::Devices::rtGetRTThreadTimingsSensorDevice
RTThreadTimingsSensorDevice & rtGetRTThreadTimingsSensorDevice()
Returns the SensorDevice used to log timings in the ControlThread.
Definition: RobotUnitModuleDevices.h:401
armarx::RobotUnitModule::Devices::getControlDeviceStatuses
ControlDeviceStatusSeq getControlDeviceStatuses(const Ice::Current &=Ice::emptyCurrent) const override
Return the ControlDeviceStatuses for all ControlDevices.
Definition: RobotUnitModuleDevices.cpp:203
armarx::RobotUnitModule::Devices::ControlDeviceHardwareControlModeGroups::groupsMerged
std::set< std::string > groupsMerged
contains the names of all devices in any group
Definition: RobotUnitModuleDevices.h:453
armarx::SensorValueGlobalRobotPose::global_T_root
Transformation global_T_root
Definition: GlobalRobotPoseSensorDevice.h:45
armarx::RobotUnitModule::Devices::getSensorDeviceStatus
SensorDeviceStatus getSensorDeviceStatus(const std::string &name, const Ice::Current &=Ice::emptyCurrent) const override
Return the SensorDeviceStatus for the given SensorDevice.
Definition: RobotUnitModuleDevices.cpp:300
armarx::RTThreadTimingsSensorDevice
Definition: RTThreadTimingsSensorDevice.h:38
armarx::RobotUnitModule::Devices::getSensorDeviceNames
Ice::StringSeq getSensorDeviceNames(const Ice::Current &=Ice::emptyCurrent) const override
Returns the names of all SensorDevices for the robot.
Definition: RobotUnitModuleDevices.cpp:222
armarx::RobotUnitModule::Devices::getSensorDevice
ConstSensorDevicePtr getSensorDevice(const std::string &deviceName) const
TODO move to attorney for NJointControllerBase.
Definition: RobotUnitModuleDevices.cpp:109
armarx::RobotUnitModule::Devices::ControlDeviceHardwareControlModeGroups::deviceIndices
std::vector< std::vector< std::size_t > > deviceIndices
contains a vector per group.
Definition: RobotUnitModuleDevices.h:451
armarx::RobotUnitModule::Devices::getControlDeviceDescriptions
ControlDeviceDescriptionSeq getControlDeviceDescriptions(const Ice::Current &=Ice::emptyCurrent) const override
Return the ControlDeviceDescriptions for all ControlDevices.
Definition: RobotUnitModuleDevices.cpp:54
armarx::RobotUnitModule::DevicesAttorneyForNJointController
This class allows minimal access to private members of armarx::RobotUnitModule::Devices in a sane fas...
Definition: NJointController.cpp:48
armarx::RobotUnitModule::Devices::ControlDeviceHardwareControlModeGroups::groupIndices
std::vector< std::size_t > groupIndices
contains the group index for each device (or the sentinel)
Definition: RobotUnitModuleDevices.h:455
armarx::RobotUnitModule::Devices::getSensorDeviceDescription
SensorDeviceDescription getSensorDeviceDescription(const std::string &name, const Ice::Current &=Ice::emptyCurrent) const override
Return the SensorDeviceDescription for the given SensorDevice.
Definition: RobotUnitModuleDevices.cpp:266
armarx::RobotUnitModule::Devices::ControlDeviceHardwareControlModeGroups
Holds data about a device group requiring the same hardware control mode. (explained here)
Definition: RobotUnitModuleDevices.h:444
armarx::RobotUnitModule::Devices::getControlDeviceDescription
ControlDeviceDescription getControlDeviceDescription(const std::string &name, const Ice::Current &=Ice::emptyCurrent) const override
Return the ControlDeviceDescription for the given ControlDevice.
Definition: RobotUnitModuleDevices.cpp:38
armarx::RobotUnitModule::Devices::getSensorDeviceStatuses
SensorDeviceStatusSeq getSensorDeviceStatuses(const Ice::Current &=Ice::emptyCurrent) const override
Return the SensorDeviceStatuses for all SensorDevices.
Definition: RobotUnitModuleDevices.cpp:316
armarx::RobotUnitModule::Devices::ControlDeviceHardwareControlModeGroups::groups
std::vector< std::set< std::string > > groups
contains a vector per group.
Definition: RobotUnitModuleDevices.h:448
armarx::RobotUnitModule::Devices::addSensorDevice
void addSensorDevice(const SensorDevicePtr &sd)
Adds a SensorDevice to the robot.
Definition: RobotUnitModuleDevices.cpp:377
armarx::RobotUnitModule::Devices::Instance
static Devices & Instance()
Returns the singleton instance of this class.
Definition: RobotUnitModuleDevices.h:79
armarx::RobotUnitModule::Devices::getSensorDeviceDescriptions
SensorDeviceDescriptionSeq getSensorDeviceDescriptions(const Ice::Current &=Ice::emptyCurrent) const override
Return the SensorDeviceDescriptions for all SensorDevices.
Definition: RobotUnitModuleDevices.cpp:282
armarx::KeyValueVector< std::string, SensorDevicePtr >
armarx::RobotUnitModule::Devices::getControlDeviceIndex
std::size_t getControlDeviceIndex(const std::string &deviceName) const
Returns the ControlDevice's index.
Definition: RobotUnitModuleDevices.cpp:99
armarx::RobotUnitModule::Devices
This Module manages sensor and control devices for a RobotUnit and only allows save and sane access.
Definition: RobotUnitModuleDevices.h:67
armarx::RobotUnitModule::DevicesPropertyDefinitions
Definition: RobotUnitModuleDevices.h:38
armarx::RobotUnitModule::Devices::getNumberOfSensorDevices
std::size_t getNumberOfSensorDevices() const
Returns the number of SensorDevices.
Definition: RobotUnitModuleDevices.cpp:81
armarx::RobotUnitModule::Devices::addControlDevice
void addControlDevice(const ControlDevicePtr &cd)
Adds a ControlDevice to the robot.
Definition: RobotUnitModuleDevices.cpp:335
armarx::RobotUnitModule::Devices::getControlDeviceStatus
ControlDeviceStatus getControlDeviceStatus(const std::string &name, const Ice::Current &=Ice::emptyCurrent) const override
Return the ControlDeviceStatus for the given ControlDevice.
Definition: RobotUnitModuleDevices.cpp:187
armarx::RobotUnitModule::DevicesPropertyDefinitions::DevicesPropertyDefinitions
DevicesPropertyDefinitions(std::string prefix)
Definition: RobotUnitModuleDevices.h:41
armarx::RobotUnitModule::Devices::getSensorDeviceIndex
std::size_t getSensorDeviceIndex(const std::string &deviceName) const
Returns the SensorDevice's index.
Definition: RobotUnitModuleDevices.cpp:89
armarx::RobotUnitModule::Devices::getControlDevices
const KeyValueVector< std::string, ControlDevicePtr > & getControlDevices() const
Returns all ControlDevices.
Definition: RobotUnitModuleDevices.h:348
GlobalRobotPoseSensorDevice.h
armarx::ConstSensorDevicePtr
std::shared_ptr< const class SensorDevice > ConstSensorDevicePtr
Definition: NJointControllerBase.h:77
armarx::RobotUnitModule::Devices::getControlModeGroups
const ControlDeviceHardwareControlModeGroups & getControlModeGroups() const
Returns the groups of ControlDevices required to be in the same hardware control mode.
Definition: RobotUnitModuleDevices.h:300
armarx::RobotUnitModule::Devices::getSensorDevicesConstPtr
const std::map< std::string, ConstSensorDevicePtr > & getSensorDevicesConstPtr() const
Returns const pointers to all SensorDevices.
Definition: RobotUnitModuleDevices.h:358
armarx::RobotUnitModule
Definition: ControlDevice.h:34
armarx::RobotUnitModule::Devices::getControlDeviceNames
Ice::StringSeq getControlDeviceNames(const Ice::Current &=Ice::emptyCurrent) const override
Returns the names of all ControlDevices for the robot.
Definition: RobotUnitModuleDevices.cpp:127
armarx::RobotUnitModule::ModuleBasePropertyDefinitions
Definition: RobotUnitModuleBase.h:107
armarx::ConstControlDevicePtr
std::shared_ptr< const class ControlDevice > ConstControlDevicePtr
Definition: NJointControllerBase.h:76
armarx::RobotUnitModule::ModuleBase
Base class for all RobotUnitModules.
Definition: RobotUnitModuleBase.h:183
armarx::RobotUnitModule::Devices::getNumberOfControlDevices
std::size_t getNumberOfControlDevices() const
Returns the number of ControlDevices.
Definition: RobotUnitModuleDevices.cpp:73
VirtualRobot::RobotPtr
std::shared_ptr< class Robot > RobotPtr
Definition: Bus.h:18
armarx::RobotUnitModule::Devices::createRTThreadTimingSensorDevice
virtual RTThreadTimingsSensorDevicePtr createRTThreadTimingSensorDevice() const
Creates the SensorDevice used to log timings in the ControlThread (This function is supposed to be us...
Definition: RobotUnitModuleDevices.cpp:447
armarx::RobotUnitModule::Devices::updateVirtualRobotFromSensorValues
void updateVirtualRobotFromSensorValues(const VirtualRobot::RobotPtr &robot, const std::vector< PtrT > &sensors) const
Updates the given VirtualRobot with the given SensorValues.
Definition: RobotUnitModuleDevices.h:248