IceEmergencyStop.cpp
Go to the documentation of this file.
1#include "IceEmergencyStop.h"
2
3#include <Ice/Exception.h>
4
6#include <ArmarXCore/interface/components/EmergencyStopInterface.h>
7
9{
10
11 IceEmergencyStop::IceEmergencyStop(const EmergencyStopMasterInterfacePrx& master) :
12 master_(master)
13 {
14 }
15
16 bool
18 {
19 if (not master_)
20 {
21 // Absent, not broken: a null proxy is the same condition as "this deployment has no
22 // emergency stop master", which must not stop the robot from driving. Contrast the
23 // catch below -- a proxy that was resolved and has since gone silent is broken, and
24 // that does block activation.
25 ARMARX_WARNING << "The emergency stop master proxy is null. Proceeding as if the "
26 "emergency stop were released.";
27 return false;
28 }
29
30 try
31 {
32 return master_->getEmergencyStopState() == EmergencyStopState::eEmergencyStopActive;
33 }
34 catch (const Ice::Exception& e)
35 {
37 << "Could not query the emergency stop state: " << e.what()
38 << ". Assuming the emergency stop is engaged.";
39 return true;
40 }
41 }
42
43} // namespace armarx::navigation::server
SpamFilterDataPtr deactivateSpam(SpamFilterDataPtr const &spamFilter, float deactivationDurationSec, const std::string &identifier, bool deactivate)
Definition Logging.cpp:75
IceEmergencyStop(const EmergencyStopMasterInterfacePrx &master)
bool isActive() const override
Engaged whenever the master says so, and whenever a resolved master cannot be reached.
#define ARMARX_WARNING
The logging level for unexpected behaviour, but not a serious problem.
Definition Logging.h:191
This file is part of ArmarX.