PlatformControllerExecutor.h
Go to the documentation of this file.
1#pragma once
2
3#include <memory>
4#include <string>
5
14
16{
17 class ComponentPlugin;
18}
19
21{
22
23 /**
24 * @brief The PlatformUnitExecutor class
25 *
26 * TODO: Should be renamed to whatever the new unit will be called which takes Mat4f
27 * as input instead of X/Y/Yaw, so that we have a generic interface.
28 */
30 {
31
32 public:
34
36 {
37 std::string robotName;
39 };
40
41 /**
42 * @param emergencyStop Consulted before re-activating a controller. `nullptr` means
43 * this deployment has no emergency-stop source, which is not the
44 * same as one that has gone silent: absent proceeds, broken
45 * refuses.
46 */
48 const Properties& properties,
49 const EmergencyStopInterface* emergencyStop = nullptr);
51
53 bool activateController = false) override;
55 bool activateController = false) override;
56
57 void start(ControllerType controllerType) override;
58
59 void ensureIsActive(ControllerType controllerType) override;
60
61 bool consumeEmergencyStopRelease() override;
62
63 void stop() override;
64
65 void updateVelocityLimits(const core::TwistLimits& limits) override;
66
67 void updateVelocityFactor(float velocityFactor) override;
68
69
70 private:
71 /**
72 * @brief Deactivate both controllers regardless of whether they currently *run*.
73 *
74 * `stop()` cannot serve here: it only deactivates a controller that reports active, and
75 * during an emergency stop the RobotUnit has already deactivated ours -- so it would
76 * leave the request standing, which is the very thing that has to go. It also stops the
77 * platform through the PlatformUnit, which is meaningless while the drives are held.
78 */
79 void withdrawControllerRequests();
80
81 ControllerComponentPlugin& controllerPlugin_;
82
83 const Properties properties_;
84
85 /// Non-owning; outlives this object. Null when the deployment has no emergency stop.
86 const EmergencyStopInterface* emergencyStop_;
87
88
91 globalTrajCtrl_;
92
95 localTrajCtrl_;
96
99 globalTrajCtrlInitialConfig_;
100
103 localTrajCtrlInitialConfig_;
104
105
106 ControllerType lastActiveController_ = ControllerType::None;
107
108 /// Edge detection on `emergencyStop_->isActive()`, both read and written only from the
109 /// navigator's periodic task via `ensureIsActive` / `consumeEmergencyStopRelease`.
110 bool emergencyStopWasActive_ = false;
111 bool emergencyStopReleased_ = false;
112 };
113
114} // namespace armarx::navigation::server
Wrapper class for an NJointController proxy.
The robot's software emergency stop, as far as navigation needs to know it.
An executer the server navigator will use to send its control commands to.
void ensureIsActive(ControllerType controllerType) override
PlatformControllerExecutor(ControllerComponentPlugin &controllerComponentPlugin, const Properties &properties, const EmergencyStopInterface *emergencyStop=nullptr)
void updateVelocityLimits(const core::TwistLimits &limits) override
bool consumeEmergencyStopRelease() override
Whether the emergency stop has been released since this was last asked.
armarx::control::client::ComponentPlugin ControllerComponentPlugin
void execute(const core::LocalTrajectory &trajectory, bool activateController=false) override
This file is part of ArmarX.
This file is part of ArmarX.