RobotUnitModuleControllerManagement.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 "RobotUnitModuleBase.h"
30 
32 {
33  /**
34  * @ingroup Library-RobotUnit-Modules
35  * @brief This \ref ModuleBase "Module" manages \ref NJointControllerBase "NJointControllers".
36  *
37  * @see ModuleBase
38  */
40  virtual public ModuleBase,
41  virtual public RobotUnitControllerManagementInterface
42  {
43  friend class ModuleBase;
44 
45  public:
46  /**
47  * @brief Returns the singleton instance of this class
48  * @return The singleton instance of this class
49  */
50  static ControllerManagement&
52  {
53  return ModuleBase::Instance<ControllerManagement>();
54  }
55 
57 
58  // //////////////////////////////////////////////////////////////////////////////////////// //
59  // ///////////////////////////////// RobotUnitModule hooks //////////////////////////////// //
60  // //////////////////////////////////////////////////////////////////////////////////////// //
61  private:
62  /// @see ModuleBase::_preOnInitRobotUnit
63  void _preOnInitRobotUnit();
64  /// @see ModuleBase::_preFinishRunning
65  void _preFinishRunning();
66  /// @see ModuleBase::_postFinishRunning
67  void _postFinishRunning();
68  // //////////////////////////////////////////////////////////////////////////////////////// //
69  // ///////////////////////////////////// ice interface //////////////////////////////////// //
70  // //////////////////////////////////////////////////////////////////////////////////////// //
71  public:
72  /**
73  * @brief Returns a proxy to the \ref NJointControllerBase.
74  * @param name The \ref NJointControllerBase's name.
75  * @return A proxy to the \ref NJointControllerBase.
76  * @see getAllNJointControllers
77  */
78  NJointControllerInterfacePrx
79  getNJointController(const std::string& name,
80  const Ice::Current& = Ice::emptyCurrent) const override;
81  /**
82  * @brief Returns proxies to all \ref NJointControllerBase "NJointControllers"
83  * @return Proxies to all \ref NJointControllerBase "NJointControllers"
84  * @see getNJointController
85  */
86  StringNJointControllerPrxDictionary
87  getAllNJointControllers(const Ice::Current& = Ice::emptyCurrent) const override;
88 
89  /**
90  * @brief Returns the status of the \ref NJointControllerBase.
91  * @param name The \ref NJointControllerBase's name.
92  * @return The status of the \ref NJointControllerBase.
93  * @see NJointControllerStatus
94  * @see getNJointControllerStatuses
95  * @see getNJointControllerDescriptionWithStatus
96  * @see getNJointControllerDescriptionsWithStatuses
97  */
98  NJointControllerStatus
99  getNJointControllerStatus(const std::string& name,
100  const Ice::Current& = Ice::emptyCurrent) const override;
101  /**
102  * @brief Returns the status of all \ref NJointControllerBase "NJointControllers".
103  * @return The status of all \ref NJointControllerBase "NJointControllers".
104  * @see NJointControllerStatus
105  * @see getNJointControllerStatus
106  * @see getNJointControllerDescriptionWithStatus
107  * @see getNJointControllerDescriptionsWithStatuses
108  */
109  NJointControllerStatusSeq
110  getNJointControllerStatuses(const Ice::Current& = Ice::emptyCurrent) const override;
111 
112  /**
113  * @brief Returns the description of the \ref NJointControllerBase.
114  * @param name The \ref NJointControllerBase's name.
115  * @return The description of the \ref NJointControllerBase.
116  * @see NJointControllerDescription
117  * @see getNJointControllerDescriptions
118  * @see getNJointControllerDescriptionWithStatus
119  * @see getNJointControllerDescriptionsWithStatuses
120  */
121  NJointControllerDescription
122  getNJointControllerDescription(const std::string& name,
123  const Ice::Current& = Ice::emptyCurrent) const override;
124  /**
125  * @brief Returns the description of all \ref NJointControllerBase "NJointControllers".
126  * @return The description of all \ref NJointControllerBase "NJointControllers".
127  * @see NJointControllerDescription
128  * @see getNJointControllerDescription
129  * @see getNJointControllerDescriptionWithStatus
130  * @see getNJointControllerDescriptionsWithStatuses
131  */
132 
133  NJointControllerDescriptionSeq
134  getNJointControllerDescriptions(const Ice::Current& = Ice::emptyCurrent) const override;
135 
136  /**
137  * @brief Returns the status and description of the \ref NJointControllerBase.
138  * @param name The \ref NJointControllerBase's name.
139  * @return The status and description of the \ref NJointControllerBase.
140  * @see getNJointControllerDescriptionsWithStatuses
141  * @see NJointControllerStatus
142  * @see getNJointControllerStatus
143  * @see getNJointControllerStatuses
144  * @see NJointControllerDescription
145  * @see getNJointControllerDescription
146  * @see getNJointControllerDescriptions
147  */
148  NJointControllerDescriptionWithStatus getNJointControllerDescriptionWithStatus(
149  const std::string& name,
150  const Ice::Current& = Ice::emptyCurrent) const override;
151  /**
152  * @brief Returns the status and description of all \ref NJointControllerBase "NJointControllers".
153  * @return The status and description of all \ref NJointControllerBase "NJointControllers".
154  * @see getNJointControllerDescriptionsWithStatus
155  * @see NJointControllerStatus
156  * @see getNJointControllerStatus
157  * @see getNJointControllerStatuses
158  * @see NJointControllerDescription
159  * @see getNJointControllerDescription
160  * @see getNJointControllerDescriptions
161  */
162  NJointControllerDescriptionWithStatusSeq getNJointControllerDescriptionsWithStatuses(
163  const Ice::Current& = Ice::emptyCurrent) const override;
164 
165  /**
166  * @brief getNJointControllerClassDescription
167  * @param className
168  * @return
169  */
170  NJointControllerClassDescription
171  getNJointControllerClassDescription(const std::string& className,
172  const Ice::Current& = Ice::emptyCurrent) const override;
173  /**
174  * @brief getNJointControllerClassDescriptions
175  * @return
176  */
177  NJointControllerClassDescriptionSeq getNJointControllerClassDescriptions(
178  const Ice::Current& = Ice::emptyCurrent) const override;
179  /**
180  * @brief Loads the given lib. (calls `getArmarXManager()->loadLibFromPath(path)`)
181  * @param path Path to the lib to load.
182  * @return Whether loading the lib was successful.
183  * @see ArmarXManager::loadLibFromPath
184  */
185  bool loadLibFromPath(const std::string& path,
186  const Ice::Current& = Ice::emptyCurrent) override;
187  /**
188  * @brief Loads the given lib. (calls `getArmarXManager()->loadLibFromPath(package, lib)`)
189  * @param package The armarx package containing the lib
190  * @param lib The lib name to load.
191  * @return Whether loading the lib was successful.
192  * @see ArmarXManager::loadLibFromPackage
193  */
194  bool loadLibFromPackage(const std::string& package,
195  const std::string& lib,
196  const Ice::Current& = Ice::emptyCurrent) override;
197  /**
198  * @brief Returns the names of all available classes of \ref NJointControllerBase.
199  * @return The names of all available classes of \ref NJointControllerBase.
200  */
201  Ice::StringSeq
202  getNJointControllerClassNames(const Ice::Current& = Ice::emptyCurrent) const override;
203  /**
204  * @brief Returns the names of all \ref NJointControllerBase "NJointControllers"
205  * @return The names of all \ref NJointControllerBase "NJointControllers"
206  */
207  Ice::StringSeq
208  getNJointControllerNames(const Ice::Current& = Ice::emptyCurrent) const override;
209  /**
210  * @brief Returns the names of all requested \ref NJointControllerBase "NJointControllers"
211  * @return The names of all requested \ref NJointControllerBase "NJointControllers"
212  */
213  Ice::StringSeq
214  getRequestedNJointControllerNames(const Ice::Current& = Ice::emptyCurrent) const override;
215  /**
216  * @brief Returns the names of all activated \ref NJointControllerBase "NJointControllers"
217  * @return The names of all activated \ref NJointControllerBase "NJointControllers"
218  */
219  Ice::StringSeq
220  getActivatedNJointControllerNames(const Ice::Current& = Ice::emptyCurrent) const override;
221 
222  /**
223  * @brief Queues the given \ref NJointControllerBase for deletion.
224  * @param name The \ref NJointControllerBase to delete.
225  * @see removeNJointControllersToBeDeleted
226  * @see nJointControllersToBeDeleted
227  * @see deleteNJointControllers
228  */
229  void deleteNJointController(const std::string& name,
230  const Ice::Current& = Ice::emptyCurrent) override;
231  /**
232  * @brief Queues the given \ref NJointControllerBase "NJointControllers" for deletion.
233  * @param names The \ref NJointControllerBase "NJointControllers" to delete.
234  * @see removeNJointControllersToBeDeleted
235  * @see nJointControllersToBeDeleted
236  * @see deleteNJointController
237  */
238  void deleteNJointControllers(const Ice::StringSeq& names,
239  const Ice::Current& = Ice::emptyCurrent) override;
240  /**
241  * @brief Queues the given \ref NJointControllerBase for deletion and deactivates it if necessary.
242  * @param name The \ref NJointControllerBase to delete.
243  * @see removeNJointControllersToBeDeleted
244  * @see nJointControllersToBeDeleted
245  * @see deleteNJointController
246  * @see deleteNJointControllers
247  * @see deactivateAnddeleteNJointControllers
248  */
249  void deactivateAndDeleteNJointController(const std::string& name,
250  const Ice::Current& = Ice::emptyCurrent) override;
251  /**
252  * @brief Queues the given \ref NJointControllerBase "NJointControllers" for deletion and deactivates them if necessary.
253  * @param names The \ref NJointControllerBase "NJointControllers" to delete.
254  * @see removeNJointControllersToBeDeleted
255  * @see nJointControllersToBeDeleted
256  * @see deleteNJointController
257  * @see deleteNJointControllers
258  * @see deactivateAnddeleteNJointController
259  */
260  void deactivateAndDeleteNJointControllers(const Ice::StringSeq& names,
261  const Ice::Current&) override;
262 
263  /**
264  * @brief Requests activation for the given \ref NJointControllerBase.
265  * @param name The requested \ref NJointControllerBase.
266  * @see activateNJointControllers
267  */
268  void activateNJointController(const std::string& name,
269  const Ice::Current& = Ice::emptyCurrent) override;
270  /**
271  * @brief Requests activation for the given \ref NJointControllerBase "NJointControllers".
272  * @param names The requested \ref NJointControllerBase "NJointControllers".
273  * @see activateNJointController
274  */
275  void activateNJointControllers(const Ice::StringSeq& names,
276  const Ice::Current& = Ice::emptyCurrent) override;
277 
278  /**
279  * @brief Requests deactivation for the given \ref NJointControllerBase.
280  * @param name The \ref NJointControllerBase to be deactivated.
281  * @see deactivateNJointControllers
282  */
283  void deactivateNJointController(const std::string& name,
284  const Ice::Current& = Ice::emptyCurrent) override;
285  /**
286  * @brief Requests deactivation for the given \ref NJointControllerBase "NJointControllers".
287  * @param names The \ref NJointControllerBase "NJointControllers" to be deactivated.
288  * @see deactivateNJointController
289  */
290  void deactivateNJointControllers(const Ice::StringSeq& names,
291  const Ice::Current& = Ice::emptyCurrent) override;
292 
293  /**
294  * @brief Cretes a \ref NJointControllerBase.
295  * @param className The \ref NJointControllerBase's class.
296  * @param instanceName The \ref NJointControllerBase's name.
297  * @param config A config passed to the \ref NJointControllerBase's ctor.
298  * @return A proxy to the created \ref NJointControllerBase.
299  */
300  NJointControllerInterfacePrx
301  createNJointController(const std::string& className,
302  const std::string& instanceName,
303  const NJointControllerConfigPtr& config,
304  const Ice::Current& = Ice::emptyCurrent) override;
305  /**
306  * @brief Cretes a \ref NJointControllerBase.
307  * @param className The \ref NJointControllerBase's class.
308  * @param instanceName The \ref NJointControllerBase's name.
309  * @param variants A map of \ref Variant "Variants" passed to the \ref NJointControllerBase's ctor.
310  * @return A proxy to the created \ref NJointControllerBase.
311  */
312  NJointControllerInterfacePrx
313  createNJointControllerFromVariantConfig(const std::string& className,
314  const std::string& instanceName,
315  const StringVariantBaseMap& variants,
316  const Ice::Current& = Ice::emptyCurrent) override;
317  /**
318  * @brief Deletes any \ref NJointControllerBase with the given name and creates a new one.
319  * @param className The \ref NJointControllerBase's class.
320  * @param instanceName The \ref NJointControllerBase's name.
321  * @param config A config passed to the \ref NJointControllerBase's ctor.
322  * @return A proxy to the created \ref NJointControllerBase.
323  */
324  NJointControllerInterfacePrx
325  createOrReplaceNJointController(const std::string& className,
326  const std::string& instanceName,
327  const NJointControllerConfigPtr& config,
328  const Ice::Current& = Ice::emptyCurrent) override;
329 
330  /**
331  * @brief Changes the set of requested \ref NJointControllerBase "NJointControllers" to the given set.
332  * @param newSetup The new set of requested \ref NJointControllerBase "NJointControllers"
333  */
334  void switchNJointControllerSetup(const Ice::StringSeq& newSetup,
335  const Ice::Current& = Ice::emptyCurrent) override;
336  // //////////////////////////////////////////////////////////////////////////////////////// //
337  // /////////////////////////////////// Module interface /////////////////////////////////// //
338  // //////////////////////////////////////////////////////////////////////////////////////// //
339  public:
340  /**
341  * @brief Cretes a \ref NJointControllerBase.
342  * @param className The \ref NJointControllerBase's class.
343  * @param instanceName The \ref NJointControllerBase's name.
344  * @param config A config passed to the \ref NJointControllerBase's ctor.
345  * @param deletable Whether the \ref NJointControllerBase can be deleted.
346  * @param internal Whether the \ref NJointControllerBase should be tagged as internal.
347  * @return A pointer to the created \ref NJointControllerBase
348  */
349  const NJointControllerBasePtr&
350  createNJointController(const std::string& className,
351  const std::string& instanceName,
352  const NJointControllerConfigPtr& config,
353  bool deletable,
354  bool internal);
355 
356  /**
357  * @brief Returns pointers to the \ref NJointControllerBase "NJointControllers". (If one does not exist, an exception is thrown.)
358  * @param names The \ref NJointControllerBase "NJointControllers" names.
359  * @return Pointers to the \ref NJointControllerBase "NJointControllers".
360  * @throw If there is no \ref NJointControllerBase for \param name
361  */
362  std::vector<armarx::NJointControllerBasePtr>
363  getNJointControllersNotNull(const std::vector<std::string>& names) const;
364  /**
365  * @brief Returns a pointer to the \ref NJointControllerBase. (If it does not exist, an exception is thrown.)
366  * @param name The \ref NJointControllerBase
367  * @return A pointer to the \ref NJointControllerBase.
368  * @throw If there is no \ref NJointControllerBase for \param name
369  */
370  const NJointControllerBasePtr& getNJointControllerNotNull(const std::string& name) const;
371 
372  /**
373  * @brief Returns the names of given \ref NJointControllerBase "NJointControllers"
374  * @param ctrls The \ref NJointControllerBase "NJointControllers"
375  * @return The names of given \ref NJointControllerBase "NJointControllers"
376  */
377  std::vector<std::string>
378  getNJointControllerNames(const std::vector<armarx::NJointControllerBasePtr>& ctrls) const;
379 
380  /**
381  * @brief Queues the given \ref NJointControllerBase for deletion.
382  * @param ctrl The \ref NJointControllerBase to delete.
383  * @see removeNJointControllersToBeDeleted
384  * @see nJointControllersToBeDeleted
385  * @see deleteNJointControllers
386  */
387  void deleteNJointController(const NJointControllerBasePtr& ctrl);
388  /**
389  * @brief Queues the given \ref NJointControllerBase "NJointControllers" for deletion.
390  * @param ctrls The \ref NJointControllerBase "NJointControllers" to delete.
391  * @see removeNJointControllersToBeDeleted
392  * @see nJointControllersToBeDeleted
393  * @see deleteNJointController
394  */
395  void deleteNJointControllers(const std::vector<NJointControllerBasePtr>& ctrls);
396  /**
397  * @brief Queues the given \ref NJointControllerBase for deletion and deactivates it if necessary.
398  * @param ctrl The \ref NJointControllerBase to delete.
399  * @see removeNJointControllersToBeDeleted
400  * @see nJointControllersToBeDeleted
401  * @see deleteNJointController
402  * @see deleteNJointControllers
403  * @see deactivateAnddeleteNJointControllers
404  */
405  void deactivateAndDeleteNJointController(const NJointControllerBasePtr& ctrl);
406  /**
407  * @brief Queues the given \ref NJointControllerBase "NJointControllers" for deletion and deactivates them if necessary.
408  * @param ctrls The \ref NJointControllerBase "NJointControllers" to delete.
409  * @see removeNJointControllersToBeDeleted
410  * @see nJointControllersToBeDeleted
411  * @see deleteNJointController
412  * @see deleteNJointControllers
413  * @see deactivateAnddeleteNJointController
414  */
415  void
416  deactivateAndDeleteNJointControllers(const std::vector<NJointControllerBasePtr>& ctrls);
417 
418 
419  /**
420  * @brief Requests activation for the given \ref NJointControllerBase.
421  * @param ctrl The requested \ref NJointControllerBase.
422  * @see activateNJointControllers
423  */
424  void activateNJointController(const NJointControllerBasePtr& ctrl);
425  /**
426  * @brief Requests activation for the given \ref NJointControllerBase "NJointControllers".
427  * @param ctrls The requested \ref NJointControllerBase "NJointControllers".
428  * @see activateNJointController
429  */
430  void activateNJointControllers(const std::vector<NJointControllerBasePtr>& ctrls);
431 
432  /**
433  * @brief Requests deactivation for the given \ref NJointControllerBase.
434  * @param ctrl The \ref NJointControllerBase to be deactivated.
435  * @see deactivateNJointControllers
436  */
437  void deactivateNJointController(const NJointControllerBasePtr& ctrl);
438  /**
439  * @brief Requests deactivation for the given \ref NJointControllerBase "NJointControllers".
440  * @param ctrls The \ref NJointControllerBase "NJointControllers" to be deactivated.
441  * @see deactivateNJointController
442  */
443  void deactivateNJointControllers(const std::vector<NJointControllerBasePtr>& ctrls);
444 
445  // //////////////////////////////////////////////////////////////////////////////////////// //
446  // //////////////////////////////////// implementation //////////////////////////////////// //
447  // //////////////////////////////////////////////////////////////////////////////////////// //
448  private:
449  /**
450  * @brief Deletes the given \ref NJointControllerBase "NJointControllers" and removes them
451  * from the \ref ArmarXManager
452  * @param ctrls \ref NJointControllerBase "NJointControllers" to delete.
453  * @param blocking Whether removal from the \ref ArmarXManager should be blocking.
454  * @param l Proxy to the listener topic all removal events should be sent to.
455  */
456  void removeNJointControllers(std::map<std::string, NJointControllerBasePtr>& ctrls,
457  bool blocking = true,
458  RobotUnitListenerPrx l = nullptr);
459  /**
460  * @brief Calls \ref removeNJointControllers for all \ref NJointControllerBase "NJointControllers"
461  * queued for deletion (\ref nJointControllersToBeDeleted).
462  * @param blocking Whether removal from the \ref ArmarXManager should be blocking.
463  * @param l Proxy to the listener topic all removal events should be sent to.
464  * @see removeNJointControllers
465  * @see nJointControllersToBeDeleted
466  */
467  void removeNJointControllersToBeDeleted(bool blocking = true,
468  RobotUnitListenerPrx l = nullptr);
469 
470  /**
471  * @brief Sets the requested flag for all given \ref NJointControllerBase "NJointControllers" and unsets it for the rest.
472  * @param request The \ref NJointControllerBase "NJointControllers" where the requested flag should be set.
473  */
474  void updateNJointControllerRequestedState(const std::set<NJointControllerBasePtr>& request);
475  /**
476  * @brief Throws if there is no factory for \ref NJointControllerBase "NJointControllers" for the given class name.
477  * @param className The class to check for.
478  * @throw If there is no factory for \ref NJointControllerBase "NJointControllers" for the given class name.
479  */
480  void checkNJointControllerClassName(const std::string& className) const;
481 
482  // //////////////////////////////////////////////////////////////////////////////////////// //
483  // ///////////////////////////////////////// Data ///////////////////////////////////////// //
484  // //////////////////////////////////////////////////////////////////////////////////////// //
485  private:
486  /// @brief Holds all currently loaded NJoint controllers (index: [instancename])(May not be accessed in rt.)
487  std::map<std::string, NJointControllerBasePtr> nJointControllers;
488  /// @brief These controllers will be deleted in the next iteration of publish
489  std::map<std::string, NJointControllerBasePtr> nJointControllersToBeDeleted;
490  /// @brief VirtualRobot used when creating controllers / calling other functions in this module
491  VirtualRobot::RobotPtr controllerCreateRobot;
492 
493  std::recursive_mutex controllerMutex;
494  // //////////////////////////////////////////////////////////////////////////////////////// //
495  // /////////////////////////////////////// Attorneys ////////////////////////////////////// //
496  // //////////////////////////////////////////////////////////////////////////////////////// //
497  private:
498  /**
499  * \brief This class allows minimal access to private members of \ref ControllerManagement in a sane fashion for \ref Publisher.
500  * \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 !!
501  */
503  /**
504  * \brief This class allows minimal access to private members of \ref ControllerManagement in a sane fashion for \ref ControlThreadDataBuffer.
505  * \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 !!
506  */
508  };
509 } // namespace armarx::RobotUnitModule
armarx::RobotUnitModule::ControllerManagement::getNJointControllerClassDescription
NJointControllerClassDescription getNJointControllerClassDescription(const std::string &className, const Ice::Current &=Ice::emptyCurrent) const override
getNJointControllerClassDescription
Definition: RobotUnitModuleControllerManagement.cpp:633
armarx::RobotUnitModule::ControllerManagementAttorneyForPublisher
This class allows minimal access to private members of ControllerManagement in a sane fashion for Pub...
Definition: RobotUnitModulePublisher.cpp:121
armarx::RobotUnitModule::ControllerManagement::deactivateAndDeleteNJointControllers
void deactivateAndDeleteNJointControllers(const Ice::StringSeq &names, const Ice::Current &) override
Queues the given NJointControllers for deletion and deactivates them if necessary.
Definition: RobotUnitModuleControllerManagement.cpp:592
armarx::RobotUnitModule::ControllerManagement::~ControllerManagement
~ControllerManagement()
Definition: RobotUnitModuleControllerManagement.cpp:858
armarx::RobotUnitModule::ControllerManagement::getNJointControllerClassNames
Ice::StringSeq getNJointControllerClassNames(const Ice::Current &=Ice::emptyCurrent) const override
Returns the names of all available classes of NJointControllerBase.
Definition: RobotUnitModuleControllerManagement.cpp:332
armarx::StringVariantBaseMap
std::map< std::string, VariantBasePtr > StringVariantBaseMap
Definition: ManagedIceObject.h:111
armarx::RobotUnitModule::ControllerManagement::getNJointControllerDescription
NJointControllerDescription getNJointControllerDescription(const std::string &name, const Ice::Current &=Ice::emptyCurrent) const override
Returns the description of the NJointControllerBase.
Definition: RobotUnitModuleControllerManagement.cpp:731
RobotUnitModuleBase.h
armarx::RobotUnitModule::ControllerManagement::deactivateAndDeleteNJointController
void deactivateAndDeleteNJointController(const std::string &name, const Ice::Current &=Ice::emptyCurrent) override
Queues the given NJointControllerBase for deletion and deactivates it if necessary.
Definition: RobotUnitModuleControllerManagement.cpp:584
armarx::RobotUnitModule::ControllerManagement::deleteNJointControllers
void deleteNJointControllers(const Ice::StringSeq &names, const Ice::Current &=Ice::emptyCurrent) override
Queues the given NJointControllers for deletion.
Definition: RobotUnitModuleControllerManagement.cpp:527
armarx::RobotUnitModule::ControllerManagement::getNJointControllerStatuses
NJointControllerStatusSeq getNJointControllerStatuses(const Ice::Current &=Ice::emptyCurrent) const override
Returns the status of all NJointControllers.
Definition: RobotUnitModuleControllerManagement.cpp:713
armarx::RobotUnitModule::ControllerManagement::deleteNJointController
void deleteNJointController(const std::string &name, const Ice::Current &=Ice::emptyCurrent) override
Queues the given NJointControllerBase for deletion.
Definition: RobotUnitModuleControllerManagement.cpp:520
armarx::RobotUnitModule::ControllerManagement::switchNJointControllerSetup
void switchNJointControllerSetup(const Ice::StringSeq &newSetup, const Ice::Current &=Ice::emptyCurrent) override
Changes the set of requested NJointControllers to the given set.
Definition: RobotUnitModuleControllerManagement.cpp:534
armarx::RobotUnitModule::ControllerManagement::getNJointControllerDescriptions
NJointControllerDescriptionSeq getNJointControllerDescriptions(const Ice::Current &=Ice::emptyCurrent) const override
Returns the description of all NJointControllers.
Definition: RobotUnitModuleControllerManagement.cpp:745
armarx::RobotUnitModule::ControllerManagement::deactivateNJointController
void deactivateNJointController(const std::string &name, const Ice::Current &=Ice::emptyCurrent) override
Requests deactivation for the given NJointControllerBase.
Definition: RobotUnitModuleControllerManagement.cpp:472
armarx::RobotUnitModule::ControllerManagement::deactivateNJointControllers
void deactivateNJointControllers(const Ice::StringSeq &names, const Ice::Current &=Ice::emptyCurrent) override
Requests deactivation for the given NJointControllers.
Definition: RobotUnitModuleControllerManagement.cpp:479
armarx::RobotUnitModule::ControllerManagement::createNJointController
NJointControllerInterfacePrx createNJointController(const std::string &className, const std::string &instanceName, const NJointControllerConfigPtr &config, const Ice::Current &=Ice::emptyCurrent) override
Cretes a NJointControllerBase.
Definition: RobotUnitModuleControllerManagement.cpp:176
armarx::RobotUnitModule::ControllerManagement::createNJointControllerFromVariantConfig
NJointControllerInterfacePrx createNJointControllerFromVariantConfig(const std::string &className, const std::string &instanceName, const StringVariantBaseMap &variants, const Ice::Current &=Ice::emptyCurrent) override
Cretes a NJointControllerBase.
Definition: RobotUnitModuleControllerManagement.cpp:189
armarx::RobotUnitModule::ControllerManagement::loadLibFromPackage
bool loadLibFromPackage(const std::string &package, const std::string &lib, const Ice::Current &=Ice::emptyCurrent) override
Loads the given lib.
Definition: RobotUnitModuleControllerManagement.cpp:318
armarx::RobotUnitModule::ControllerManagement::loadLibFromPath
bool loadLibFromPath(const std::string &path, const Ice::Current &=Ice::emptyCurrent) override
Loads the given lib.
Definition: RobotUnitModuleControllerManagement.cpp:306
armarx::RobotUnitModule::ControllerManagement::activateNJointController
void activateNJointController(const std::string &name, const Ice::Current &=Ice::emptyCurrent) override
Requests activation for the given NJointControllerBase.
Definition: RobotUnitModuleControllerManagement.cpp:364
armarx::RobotUnitModule::ControllerManagement::getAllNJointControllers
StringNJointControllerPrxDictionary getAllNJointControllers(const Ice::Current &=Ice::emptyCurrent) const override
Returns proxies to all NJointControllers.
Definition: RobotUnitModuleControllerManagement.cpp:157
armarx::RobotUnitModule::ControllerManagement::getNJointControllerNotNull
const NJointControllerBasePtr & getNJointControllerNotNull(const std::string &name) const
Returns a pointer to the NJointControllerBase.
Definition: RobotUnitModuleControllerManagement.cpp:124
armarx::RobotUnitModule::ControllerManagement::Instance
static ControllerManagement & Instance()
Returns the singleton instance of this class.
Definition: RobotUnitModuleControllerManagement.h:51
armarx::RobotUnitModule::ControllerManagement::getRequestedNJointControllerNames
Ice::StringSeq getRequestedNJointControllerNames(const Ice::Current &=Ice::emptyCurrent) const override
Returns the names of all requested NJointControllers.
Definition: RobotUnitModuleControllerManagement.cpp:75
armarx::RobotUnitModule::ControllerManagement::getNJointControllerClassDescriptions
NJointControllerClassDescriptionSeq getNJointControllerClassDescriptions(const Ice::Current &=Ice::emptyCurrent) const override
getNJointControllerClassDescriptions
Definition: RobotUnitModuleControllerManagement.cpp:660
armarx::RobotUnitModule::ControllerManagement::createOrReplaceNJointController
NJointControllerInterfacePrx createOrReplaceNJointController(const std::string &className, const std::string &instanceName, const NJointControllerConfigPtr &config, const Ice::Current &=Ice::emptyCurrent) override
Deletes any NJointControllerBase with the given name and creates a new one.
Definition: RobotUnitModuleControllerManagement.cpp:219
armarx::RobotUnitModule::ControllerManagement::getNJointController
NJointControllerInterfacePrx getNJointController(const std::string &name, const Ice::Current &=Ice::emptyCurrent) const override
Returns a proxy to the NJointControllerBase.
Definition: RobotUnitModuleControllerManagement.cpp:686
armarx::RobotUnitModule::ControllerManagement::getNJointControllerStatus
NJointControllerStatus getNJointControllerStatus(const std::string &name, const Ice::Current &=Ice::emptyCurrent) const override
Returns the status of the NJointControllerBase.
Definition: RobotUnitModuleControllerManagement.cpp:703
armarx::viz::data::ElementFlags::names
const simox::meta::IntEnumNames names
Definition: json_elements.cpp:14
armarx::RobotUnitModule::ControllerManagement
This Module manages NJointControllers.
Definition: RobotUnitModuleControllerManagement.h:39
armarx::RobotUnitModule::ControllerManagement::getNJointControllersNotNull
std::vector< armarx::NJointControllerBasePtr > getNJointControllersNotNull(const std::vector< std::string > &names) const
Returns pointers to the NJointControllers.
Definition: RobotUnitModuleControllerManagement.cpp:109
armarx::RobotUnitModule
Definition: ControlDevice.h:34
armarx::RobotUnitModule::ControllerManagement::getNJointControllerDescriptionWithStatus
NJointControllerDescriptionWithStatus getNJointControllerDescriptionWithStatus(const std::string &name, const Ice::Current &=Ice::emptyCurrent) const override
Returns the status and description of the NJointControllerBase.
Definition: RobotUnitModuleControllerManagement.cpp:767
armarx::RobotUnitModule::ControllerManagement::getActivatedNJointControllerNames
Ice::StringSeq getActivatedNJointControllerNames(const Ice::Current &=Ice::emptyCurrent) const override
Returns the names of all activated NJointControllers.
Definition: RobotUnitModuleControllerManagement.cpp:83
armarx::RobotUnitModule::ControllerManagement::getNJointControllerNames
Ice::StringSeq getNJointControllerNames(const Ice::Current &=Ice::emptyCurrent) const override
Returns the names of all NJointControllers.
Definition: RobotUnitModuleControllerManagement.cpp:339
armarx::RobotUnitModule::ControllerManagementAttorneyForControlThreadDataBuffer
This class allows minimal access to private members of ControllerManagement in a sane fashion for Con...
Definition: RobotUnitModuleControlThreadDataBuffer.cpp:51
armarx::RobotUnitModule::ControllerManagement::activateNJointControllers
void activateNJointControllers(const Ice::StringSeq &names, const Ice::Current &=Ice::emptyCurrent) override
Requests activation for the given NJointControllers.
Definition: RobotUnitModuleControllerManagement.cpp:371
armarx::RobotUnitModule::ModuleBase
Base class for all RobotUnitModules.
Definition: RobotUnitModuleBase.h:183
armarx::RobotUnitModule::ControllerManagement::getNJointControllerDescriptionsWithStatuses
NJointControllerDescriptionWithStatusSeq getNJointControllerDescriptionsWithStatuses(const Ice::Current &=Ice::emptyCurrent) const override
Returns the status and description of all NJointControllers.
Definition: RobotUnitModuleControllerManagement.cpp:781
VirtualRobot::RobotPtr
std::shared_ptr< class Robot > RobotPtr
Definition: Bus.h:18