RobotUnitModuleControlThread.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 <thread>
26 
27 #include <RobotAPI/interface/units/RobotUnit/RobotUnitInterface.h>
28 
29 #include "../Devices/ControlDevice.h"
30 #include "../Devices/SensorDevice.h"
31 #include "RobotUnitModuleBase.h"
32 
33 namespace armarx
34 {
35  class DynamicsHelper;
36  class RTThreadTimingsSensorDevice;
37 } // namespace armarx
38 
40 {
42  {
43  public:
45  {
46  defineOptionalProperty<std::size_t>(
47  "NjointController_AllowedExecutionTimePerControlDeviceUntilWarning",
48  2,
49  "A Warning will be printed, If the execution time in micro seconds of a "
50  "NJointControllerBase "
51  "exceeds this parameter times the number of ControlDevices.");
52  defineOptionalProperty<std::size_t>(
53  "NjointController_AllowedExecutionTimePerControlDeviceUntilError",
54  20,
55  "An Error will be printed, If the execution time in micro seconds of a "
56  "NJointControllerBase "
57  "exceeds this parameter times the number of ControlDevices.");
58  defineOptionalProperty<bool>(
59  "EnableInverseDynamics",
60  false,
61  "If true, inverse dynamics are calculated for all joints given in the "
62  "InverseDynamicsRobotJointSets property during each loop of "
63  "the rt control thread.");
64  defineOptionalProperty<std::string>("InverseDynamicsRobotJointSets",
65  "LeftArm,RightArm",
66  "Comma separated list of robot nodesets for which "
67  "the inverse dynamics should be calculcated.");
68  defineOptionalProperty<std::string>(
69  "InverseDynamicsRobotBodySet",
70  "RobotCol",
71  "Robot nodeset of which the masses should be used for the inverse dynamics");
72  }
73  };
74 
75  /**
76  * @ingroup Library-RobotUnit-Modules
77  * @brief This \ref ModuleBase "Module" manages the \ref ControlThread.
78  *
79  * It offers the basic functions called in the \ref ControlThread.
80  *
81  * @see ModuleBase
82  */
83  class ControlThread : virtual public ModuleBase, virtual public RobotUnitControlThreadInterface
84  {
85  friend class ModuleBase;
86  enum class EmergencyStopStateRequest
87  {
88  RequestActive,
89  RequestInactive,
90  RequestNone,
91  };
92 
93  protected:
95  {
96  /**
97  * @brief This modus is used if the RTThread is supported to control
98  * which controllers are running. (e.g. for Calibrating)
99  */
100  RTThread,
102  };
103 
104  public:
105  /**
106  * @brief Returns the singleton instance of this class
107  * @return The singleton instance of this class
108  */
109  static ControlThread&
111  {
112  return ModuleBase::Instance<ControlThread>();
113  }
114 
115  // //////////////////////////////////////////////////////////////////////////////////////// //
116  // ///////////////////////////////// RobotUnitModule hooks //////////////////////////////// //
117  // //////////////////////////////////////////////////////////////////////////////////////// //
118  private:
119  ///@see \ref ModuleBase::_preFinishControlThreadInitialization
120  void _preFinishControlThreadInitialization();
121  ///@see \ref ModuleBase::_preOnInitRobotUnit
122  void _preOnInitRobotUnit();
123  // //////////////////////////////////////////////////////////////////////////////////////// //
124  // ///////////////////////////////////// ice interface //////////////////////////////////// //
125  // //////////////////////////////////////////////////////////////////////////////////////// //
126  public:
127  /**
128  * @brief Sets the \ref EmergencyStopState
129  * @param state The \ref EmergencyStopState to set
130  */
131  void setEmergencyStopState(EmergencyStopState state,
132  const Ice::Current& = Ice::emptyCurrent) override;
133  /**
134  * @brief Returns the \ref ControlThread's target \ref EmergencyStopState
135  * @return The \ref EmergencyStopState
136  */
137  EmergencyStopState
138  getEmergencyStopState(const Ice::Current& = Ice::emptyCurrent) const override;
139  /**
140  * @brief Returns the \ref ControlThread's \ref EmergencyStopState
141  * @return The \ref EmergencyStopState
142  */
143  EmergencyStopState
144  getRtEmergencyStopState(const Ice::Current& = Ice::emptyCurrent) const override;
145  // //////////////////////////////////////////////////////////////////////////////////////// //
146  // /////////////////////////////////// Module interface /////////////////////////////////// //
147  // //////////////////////////////////////////////////////////////////////////////////////// //
148  public:
149  /**
150  * @brief Teturns he \ref ControlThread's thread id
151  * @return The \ref ControlThread's thread id
152  * @see controlThreadId
153  */
154  std::thread::id
156  {
157  return controlThreadId;
158  }
159 
160  private:
161  /**
162  * @brief Sets the \ref EmergencyStopState without updating the topic.
163  * For use in \ref RobotUnitEmergencyStopMaster.
164  * @param state The \ref EmergencyStopState to set
165  */
166  void setEmergencyStopStateNoReportToTopic(EmergencyStopState state);
167  /**
168  * @brief Sets the emergency stop state to the request from rt (if there was a request).
169  * For use in \ref Publisher.
170  */
171  void processEmergencyStopRequest();
172 
173  // //////////////////////////////////////////////////////////////////////////////////////// //
174  // ///////////////////////////////////// rt interface ///////////////////////////////////// //
175  // //////////////////////////////////////////////////////////////////////////////////////// //
176  protected:
177  /**
178  * @brief Returns the simox robot used in the control thread
179  * @return The simox robot used in the control thread
180  */
182  rtGetRobot() const
183  {
184  return rtRobot;
185  }
186 
187  /**
188  * @brief Changes the set of active controllers.
189  * Changes can be caused by a new set of requested controllers or emergency stop
190  * @return Whether active controllers were changed
191  */
193 
194  /**
195  * @brief Searches for the \ref NJointControllerBase responsible for the given \ref JointController and deactivates it.
196  * Does not commit the new set of activated controllers)
197  * @param ctrlDevIndex The control device index causing the problem.
198  */
199  void rtDeactivateAssignedNJointControllerBecauseOfError(std::size_t ctrlDevIndex);
200  /**
201  * @brief Deactivates a NJointControllerBase and sets all used ControlDevices to EmergencyStop.
202  * Does not commit the new set of activated controllers)
203  * @param nJointCtrlIndex The NJointControllerBase to deactivate (index in controllersActivated)
204  */
205  void rtDeactivateNJointControllerBecauseOfError(std::size_t nJointCtrlIndex);
206  /**
207  * @brief Runs NJoint controllers
208  * @param sensorValuesTimestamp Timestamp of the current \ref SensorValueBase SensorValues
209  * @param timeSinceLastIteration Time between the last two updates of \ref SensorValueBase SensorValues
210  */
211  void rtRunNJointControllers(const IceUtil::Time& sensorValuesTimestamp,
212  const IceUtil::Time& timeSinceLastIteration);
213  /**
214  * @brief Runs Joint controllers and writes target values to ControlDevices
215  * @param sensorValuesTimestamp Timestamp of the current \ref SensorValueBase SensorValues
216  * @param timeSinceLastIteration Time between the last two updates of \ref SensorValueBase SensorValues
217  */
218  void rtRunJointControllers(const IceUtil::Time& sensorValuesTimestamp,
219  const IceUtil::Time& timeSinceLastIteration);
220  /**
221  * @brief Calls \ref SensorDevice::rtReadSensorValues for all \ref SensorDevice "SensorDevices".
222  * @param sensorValuesTimestamp Timestamp of the current \ref SensorValueBase SensorValues
223  * @param timeSinceLastIteration Time between the last two updates of \ref SensorValueBase SensorValues
224  */
225  void rtReadSensorDeviceValues(const IceUtil::Time& sensorValuesTimestamp,
226  const IceUtil::Time& timeSinceLastIteration);
227  /**
228  * @brief Execute code after updating the sensor values. Default implementation calculates the inverse dynamics.
229  * @param sensorValuesTimestamp Timestamp of the current \ref SensorValueBase SensorValues
230  * @param timeSinceLastIteration Time between the last two updates of \ref SensorValueBase SensorValues
231  */
232  void virtual rtPostReadSensorDeviceValues(const IceUtil::Time& sensorValuesTimestamp,
233  const IceUtil::Time& timeSinceLastIteration);
234  /// @brief Deactivates all NJointControllers generating invalid targets.
235  void rtHandleInvalidTargets();
236  /// @brief Calls \ref JointController::rtResetTarget for all active Joint controllers
237  void rtResetAllTargets();
238 
239  /**
240  * @brief Hook for deriving classes (called AFTER a NJointControllerBase is deactivated due to an error)
241  *
242  * This is useful when two Control devices can be controlled by different NJointControllers but either both or none
243  * have to be controlled.
244  *
245  * Since this hook is called after the controller with an error was deactivated an other call to
246  * \ref rtDeactivateAssignedNJointControllerBecauseOfError can't lead to a cyclic execution.
247  */
248  virtual void
249  rtDeactivatedNJointControllerBecauseOfError(const NJointControllerBasePtr& /*nJointCtrl*/)
250  {
251  }
252 
253  /**
254  * @brief Updates the current \ref SensorValueBase "SensorValues" and \ref ControlTargetBase "ControlTargets"
255  * for code running outside of the \ref ControlThread
256  * @param sensorValuesTimestamp Timestamp of the current \ref SensorValueBase SensorValues
257  * @param timeSinceLastIteration Time between the last two updates of \ref SensorValueBase SensorValues
258  */
259  void rtUpdateSensorAndControlBuffer(const IceUtil::Time& sensorValuesTimestamp,
260  const IceUtil::Time& timeSinceLastIteration);
261 
262  /**
263  * @brief Returns all \ref ControlDevice "ControlDevices"
264  * @return All \ref ControlDevice "ControlDevices"
265  */
266  const std::vector<ControlDevicePtr>& rtGetControlDevices() const;
267  /**
268  * @brief Returns all \ref SensorDevice "SensorDevices"
269  * @return All \ref SensorDevice "SensorDevices"
270  */
271  const std::vector<SensorDevicePtr>& rtGetSensorDevices();
272  /**
273  * @brief Returns the \ref RTThreadTimingsSensorDevice
274  * @return The \ref RTThreadTimingsSensorDevice
275  */
277 
278  /**
279  * @brief Returns whether the rt thread is in emergency stop. (This function is for use in the \ref ControlThread)
280  * @return Whether the rt thread is in emergency stop.
281  */
282  bool
284  {
285  return rtIsInEmergencyStop_;
286  }
287 
288  /**
289  * @brief Returns the \ref ControlThread's emergency stop state. (This function is for use in the \ref ControlThread)
290  * @return The \ref ControlThread's emergency stop state
291  */
292  EmergencyStopState
294  {
295  return rtIsInEmergencyStop_ ? EmergencyStopState::eEmergencyStopActive
296  : EmergencyStopState::eEmergencyStopInactive;
297  }
298 
299  /**
300  * @brief Set an \ref EmergencyStopState request. This request will be executed by the \ref Publisher
301  * @param state The \ref EmergencyStopState to set
302  */
303  void rtSetEmergencyStopState(EmergencyStopState state);
304 
306  void rtSetRobotGlobalPose(const Eigen::Matrix4f& gp, bool updateRobot = true);
307 
308  /// Activate a joint controller from the rt loop (only works in switch mode RTThread)
309  void rtSetJointController(JointController* c, std::size_t index);
310  // //////////////////////////////////////////////////////////////////////////////////////// //
311  // //////////////////////////////////// implementation //////////////////////////////////// //
312  // //////////////////////////////////////////////////////////////////////////////////////// //
313  private:
314  /**
315  * @brief Returns the activated \ref JointController "JointControllers"
316  * @return The activated \ref JointController "JointControllers"
317  */
318  std::vector<JointController*>& rtGetActivatedJointControllers();
319  const std::vector<JointController*>& rtGetActivatedJointControllers() const;
320  /**
321  * @brief Returns the activated \ref NJointControllerBase "NJointControllers"
322  * @return The activated \ref NJointControllerBase "NJointControllers"
323  */
324  std::vector<NJointControllerBase*>& rtGetActivatedNJointControllers();
325  const std::vector<NJointControllerBase*>& rtGetActivatedNJointControllers() const;
326 
327  /**
328  * @brief Returns a vector containing the index of the activated \ref NJointControllerBase
329  * for each \ref JointController
330  * @return A vector containing the index of the activated \ref NJointControllerBase
331  * for each \ref JointController
332  */
333  std::vector<std::size_t>& rtGetActivatedJointToNJointControllerAssignement();
334  const std::vector<std::size_t>& rtGetActivatedJointToNJointControllerAssignement() const;
335 
336 
337  /**
338  * @brief Returns the requested \ref JointController "JointControllers"
339  * @return The requested \ref JointController "JointControllers"
340  */
341  const std::vector<JointController*>& rtGetRequestedJointControllers() const;
342  /**
343  * @brief Returns the requested \ref NJointControllerBase "NJointControllers"
344  * @return The requested \ref NJointControllerBase "NJointControllers"
345  */
346  const std::vector<NJointControllerBase*>& rtGetRequestedNJointControllers() const;
347 
348  /**
349  * @brief Returns a vector containing the index of the requested \ref NJointControllerBase
350  * for each \ref JointController
351  * @return A vector containing the index of the requested \ref NJointControllerBase
352  * for each \ref JointController
353  */
354  const std::vector<std::size_t>& rtGetRequestedJointToNJointControllerAssignement() const;
355 
356  void rtSyncNJointControllerRobot(NJointControllerBase* njctrl);
357 
358  void dumpRtControllerSetup(std::ostream& out,
359  const std::string& indent,
360  const std::vector<JointController*>& activeCdevs,
361  const std::vector<std::size_t>& activeJCtrls,
362  const std::vector<NJointControllerBase*>& assignement) const;
363  std::string dumpRtState() const;
364  // //////////////////////////////////////////////////////////////////////////////////////// //
365  // ///////////////////////////////////////// Data ///////////////////////////////////////// //
366  // //////////////////////////////////////////////////////////////////////////////////////// //
367  private:
368  ///@brief Whether the ControlThread is in emergency stop
369  std::atomic_bool rtIsInEmergencyStop_{false};
370  ///@brief Whether the ControlThread is supposed to be in emergency stop
371  std::atomic_bool emergencyStop{false};
372 
373  ///@brief The \ref VirtualRobot::Robot used in the \ref ControlThread
374  VirtualRobot::RobotPtr rtRobot;
375  ///@brief The \ref VirtualRobot::Robot's \ref VirtualRobot::RobotNode "VirtualRobot::RobotNode" used in the \ref ControlThread
376  std::vector<VirtualRobot::RobotNodePtr> rtRobotNodes;
377 
378  ///@brief The \ref ControlThread's thread id
379  std::atomic<std::thread::id> controlThreadId;
380 
381  /// @brief A Warning will be printed, if the execution time per ControlDev of a NJointControllerBase exceeds this parameter
382  std::size_t usPerDevUntilWarn;
383  /// @brief An Error will be printed, if the execution time per ControlDev of a NJointControllerBase exceeds this parameter
384  std::size_t usPerDevUntilError;
385 
386  bool rtSwitchControllerSetupChangedControllers{false};
387  std::size_t numberOfInvalidTargetsInThisIteration{0};
388 
389  std::vector<JointController*> preSwitchSetup_ActivatedJointControllers;
390  std::vector<std::size_t> preSwitchSetup_ActivatedJointToNJointControllerAssignement;
391  std::vector<NJointControllerBase*> preSwitchSetup_ActivatedNJointControllers;
392 
393  std::vector<JointController*> postSwitchSetup_ActivatedJointControllers;
394  std::vector<std::size_t> postSwitchSetup_ActivatedJointToNJointControllerAssignement;
395  std::vector<NJointControllerBase*> postSwitchSetup_ActivatedNJointControllers;
396 
397  std::vector<std::size_t> _activatedSynchronousNJointControllersIdx;
398  std::vector<std::size_t> _activatedAsynchronousNJointControllersIdx;
399 
400  std::atomic<EmergencyStopStateRequest> emergencyStopStateRequest{
401  EmergencyStopStateRequest::RequestNone};
402 
403  std::shared_ptr<DynamicsHelper> dynamicsHelpers;
404 
405  std::size_t _maxControllerCount = 0;
406  // //////////////////////////////////////////////////////////////////////////////////////// //
407  // /////////////////////////////////////// Attorneys ////////////////////////////////////// //
408  // //////////////////////////////////////////////////////////////////////////////////////// //
409  private:
410  /**
411  * \brief This class allows minimal access to private members of \ref ControlThread in a sane fashion for \ref Publisher.
412  * \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 !!
413  */
415  /**
416  * \brief This class allows minimal access to private members of \ref ControlThread in a sane fashion for \ref RobotUnitEmergencyStopMaster.
417  * \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 !!
418  */
420  };
421 } // namespace armarx::RobotUnitModule
armarx::RobotUnitModule::ControlThread::setEmergencyStopState
void setEmergencyStopState(EmergencyStopState state, const Ice::Current &=Ice::emptyCurrent) override
Sets the EmergencyStopState.
Definition: RobotUnitModuleControlThread.cpp:999
armarx::RobotUnitModule::ControlThread::SwitchControllerMode::RTThread
@ RTThread
This modus is used if the RTThread is supported to control which controllers are running.
armarx::RobotUnitModule::ControlThread::rtRunNJointControllers
void rtRunNJointControllers(const IceUtil::Time &sensorValuesTimestamp, const IceUtil::Time &timeSinceLastIteration)
Runs NJoint controllers.
Definition: RobotUnitModuleControlThread.cpp:571
armarx::RobotUnitModule::ControlThread::getControlThreadId
std::thread::id getControlThreadId() const
Teturns he ControlThread's thread id.
Definition: RobotUnitModuleControlThread.h:155
index
uint8_t index
Definition: EtherCATFrame.h:59
armarx::RobotUnitModule::ControlThread::rtGetThreadTimingsSensorDevice
RTThreadTimingsSensorDevice & rtGetThreadTimingsSensorDevice()
Returns the RTThreadTimingsSensorDevice.
Definition: RobotUnitModuleControlThread.cpp:897
armarx::RobotUnitModule::ControlThreadPropertyDefinitions
Definition: RobotUnitModuleControlThread.h:41
RobotUnitModuleBase.h
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:333
armarx::RobotUnitModule::ControlThread::rtDeactivatedNJointControllerBecauseOfError
virtual void rtDeactivatedNJointControllerBecauseOfError(const NJointControllerBasePtr &)
Hook for deriving classes (called AFTER a NJointControllerBase is deactivated due to an error)
Definition: RobotUnitModuleControlThread.h:249
armarx::JointController
The JointController class represents one joint in one control mode.
Definition: JointController.h:51
armarx::RobotUnitModule::ControlThread::rtGetControlDevices
const std::vector< ControlDevicePtr > & rtGetControlDevices() const
Returns all ControlDevices.
Definition: RobotUnitModuleControlThread.cpp:885
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43
armarx::RobotUnitModule::ControlThread::rtReadSensorDeviceValues
void rtReadSensorDeviceValues(const IceUtil::Time &sensorValuesTimestamp, const IceUtil::Time &timeSinceLastIteration)
Calls SensorDevice::rtReadSensorValues for all SensorDevices.
Definition: RobotUnitModuleControlThread.cpp:532
armarx::RobotUnitModule::ControlThreadAttorneyForPublisher
This class allows minimal access to private members of ControlThread in a sane fashion for Publisher.
Definition: RobotUnitModulePublisher.cpp:142
armarx::RobotUnitModule::ControlThread::rtSetRobotGlobalPose
void rtSetRobotGlobalPose(const Eigen::Matrix4f &gp, bool updateRobot=true)
Definition: RobotUnitModuleControlThread.cpp:1222
armarx::RobotUnitModule::ControlThread::SwitchControllerMode
SwitchControllerMode
Definition: RobotUnitModuleControlThread.h:94
armarx::RTThreadTimingsSensorDevice
Definition: RTThreadTimingsSensorDevice.h:38
armarx::RobotUnitModule::ControlThread::rtRunJointControllers
void rtRunJointControllers(const IceUtil::Time &sensorValuesTimestamp, const IceUtil::Time &timeSinceLastIteration)
Runs Joint controllers and writes target values to ControlDevices.
Definition: RobotUnitModuleControlThread.cpp:559
armarx::RobotUnitModule::ControlThread
This Module manages the ControlThread.
Definition: RobotUnitModuleControlThread.h:83
armarx::RobotUnitModule::ControlThread::getEmergencyStopState
EmergencyStopState getEmergencyStopState(const Ice::Current &=Ice::emptyCurrent) const override
Returns the ControlThread's target EmergencyStopState.
Definition: RobotUnitModuleControlThread.cpp:1006
armarx::RobotUnitModule::ControlThreadAttorneyForRobotUnitEmergencyStopMaster
This class allows minimal access to private members of ControlThread in a sane fashion for RobotUnitE...
Definition: RobotUnitModuleUnits.cpp:47
armarx::RobotUnitModule::ControlThread::rtSetJointController
void rtSetJointController(JointController *c, std::size_t index)
Activate a joint controller from the rt loop (only works in switch mode RTThread)
Definition: RobotUnitModuleControlThread.cpp:1228
armarx::RobotUnitModule::ControlThread::rtUpdateRobotGlobalPose
void rtUpdateRobotGlobalPose()
Definition: RobotUnitModuleControlThread.cpp:1201
armarx::RobotUnitModule::ControlThread::rtGetRobot
const VirtualRobot::RobotPtr & rtGetRobot() const
Returns the simox robot used in the control thread.
Definition: RobotUnitModuleControlThread.h:182
armarx::RobotUnitModule::ControlThreadPropertyDefinitions::ControlThreadPropertyDefinitions
ControlThreadPropertyDefinitions(std::string prefix)
Definition: RobotUnitModuleControlThread.h:44
armarx::RobotUnitModule::ControlThread::rtGetSensorDevices
const std::vector< SensorDevicePtr > & rtGetSensorDevices()
Returns all SensorDevices.
Definition: RobotUnitModuleControlThread.cpp:891
armarx::RobotUnitModule::ControlThread::rtIsInEmergencyStop
bool rtIsInEmergencyStop() const
Returns whether the rt thread is in emergency stop.
Definition: RobotUnitModuleControlThread.h:283
armarx::RobotUnitModule::ControlThread::rtGetEmergencyStopState
EmergencyStopState rtGetEmergencyStopState() const
Returns the ControlThread's emergency stop state.
Definition: RobotUnitModuleControlThread.h:293
armarx::RobotUnitModule::ControlThread::rtSwitchControllerSetup
bool rtSwitchControllerSetup(SwitchControllerMode mode=SwitchControllerMode::IceRequests)
Changes the set of active controllers.
Definition: RobotUnitModuleControlThread.cpp:291
armarx::armem::Time
armarx::core::time::DateTime Time
Definition: forward_declarations.h:13
armarx::RobotUnitModule::ControlThread::rtPostReadSensorDeviceValues
virtual void rtPostReadSensorDeviceValues(const IceUtil::Time &sensorValuesTimestamp, const IceUtil::Time &timeSinceLastIteration)
Execute code after updating the sensor values.
Definition: RobotUnitModuleControlThread.cpp:546
armarx::RobotUnitModule::ControlThread::rtHandleInvalidTargets
void rtHandleInvalidTargets()
Deactivates all NJointControllers generating invalid targets.
Definition: RobotUnitModuleControlThread.cpp:509
armarx::RobotUnitModule::ControlThread::Instance
static ControlThread & Instance()
Returns the singleton instance of this class.
Definition: RobotUnitModuleControlThread.h:110
GfxTL::Matrix4f
MatrixXX< 4, 4, float > Matrix4f
Definition: MatrixXX.h:601
armarx::RobotUnitModule::ControlThread::rtResetAllTargets
void rtResetAllTargets()
Calls JointController::rtResetTarget for all active Joint controllers.
Definition: RobotUnitModuleControlThread.cpp:498
armarx::NJointControllerBase
A high level controller writing its results into ControlTargets.
Definition: NJointControllerBase.h:578
armarx::RobotUnitModule::ControlThread::SwitchControllerMode::IceRequests
@ IceRequests
armarx::RobotUnitModule::ControlThread::rtUpdateSensorAndControlBuffer
void rtUpdateSensorAndControlBuffer(const IceUtil::Time &sensorValuesTimestamp, const IceUtil::Time &timeSinceLastIteration)
Updates the current SensorValues and ControlTargets for code running outside of the ControlThread.
Definition: RobotUnitModuleControlThread.cpp:846
armarx::RobotUnitModule::ControlThread::rtSetEmergencyStopState
void rtSetEmergencyStopState(EmergencyStopState state)
Set an EmergencyStopState request.
Definition: RobotUnitModuleControlThread.cpp:903
armarx::RobotUnitModule
Definition: ControlDevice.h:34
armarx::RobotUnitModule::ControlThread::rtDeactivateAssignedNJointControllerBecauseOfError
void rtDeactivateAssignedNJointControllerBecauseOfError(std::size_t ctrlDevIndex)
Searches for the NJointControllerBase responsible for the given JointController and deactivates it.
Definition: RobotUnitModuleControlThread.cpp:829
armarx::RobotUnitModule::ControlThread::rtDeactivateNJointControllerBecauseOfError
void rtDeactivateNJointControllerBecauseOfError(std::size_t nJointCtrlIndex)
Deactivates a NJointControllerBase and sets all used ControlDevices to EmergencyStop.
Definition: RobotUnitModuleControlThread.cpp:760
armarx::RobotUnitModule::ControlThread::getRtEmergencyStopState
EmergencyStopState getRtEmergencyStopState(const Ice::Current &=Ice::emptyCurrent) const override
Returns the ControlThread's EmergencyStopState.
Definition: RobotUnitModuleControlThread.cpp:1014
armarx::RobotUnitModule::ModuleBasePropertyDefinitions
Definition: RobotUnitModuleBase.h:107
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::RobotUnitModule::ModuleBase
Base class for all RobotUnitModules.
Definition: RobotUnitModuleBase.h:183
VirtualRobot::RobotPtr
std::shared_ptr< class Robot > RobotPtr
Definition: Bus.h:18