18 #ifndef STOP1_EXECUTOR_H 19 #define STOP1_EXECUTOR_H 22 #include <condition_variable> 29 #include <std_srvs/Trigger.h> 30 #include <std_srvs/SetBool.h> 139 #endif // STOP1_EXECUTOR_H
bool updateRunPermittedCallback(std_srvs::SetBool::Request &req, std_srvs::SetBool::Response &res)
Stop1Executor(const TServiceCallFunc &hold_func, const TServiceCallFunc &unhold_func, const TServiceCallFunc &recover_func, const TServiceCallFunc &halt_func)
Create required service clients and state machine; start worker-thread and state machine.
std::atomic_bool terminate_
Flag indicating if the worker-thread should terminate.
std::condition_variable worker_cv_
Condition variable for notifying a waiting worker-thread.
void updateRunPermitted(const bool run_permitted)
This is called everytime an updated run_permitted value is obtained.
std::thread worker_thread_
Worker-thread.
void stopStateMachine()
Stop the state machine.
void workerThreadFun()
This is executed in the worker-thread and allows asynchronous handling of run_permitted updates...
Performs service calls for Stop1 and the respective reversal, that is enabling the manipulator...
std::function< bool()> TServiceCallFunc
std::unique_ptr< RunPermittedStateMachine > state_machine_
State machine.
virtual ~Stop1Executor()
Stop state machine and terminate worker-thread.