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