PythonState.h
Go to the documentation of this file.
1 /*
2  * Copyright 2015-2019 CNRS-UM LIRMM, CNRS-AIST JRL
3  */
4 
5 #pragma once
6 
7 #include <mc_control/fsm/State.h>
8 
9 namespace mc_control
10 {
11 
12 namespace fsm
13 {
14 
17 {
18  void configure(const mc_rtc::Configuration & config) override;
19 
20  void start(Controller & ctl) override;
21 
22  bool run(Controller & ctl) override;
23 
24  void teardown(Controller & ctl) override;
25 
26  void stop(Controller & ctl) override;
27 
28  std::function<void(const mc_rtc::Configuration &)> configure_ = [](const mc_rtc::Configuration &) {};
29  std::function<void(Controller &)> start_ = [](Controller &) {};
30  std::function<bool(Controller &)> run_ = [](Controller &) { return false; };
31  std::function<void(Controller &)> teardown_ = [](Controller &) {};
32  std::function<void(Controller &)> stop_ = [](Controller &) {};
33  std::function<bool()> handle_python_error;
34 
35  using State::output;
36 
37 private:
38  void update_python_failed();
39 
40  bool python_failed_ = false;
41 };
42 
43 } // namespace fsm
44 
45 } // namespace mc_control
mc_rtc::Configuration
Simplify access to values hold within a JSON file.
Definition: Configuration.h:165
MC_CONTROL_FSM_DLLAPI
#define MC_CONTROL_FSM_DLLAPI
Definition: api.h:50
mc_control::fsm::PythonState
Definition: PythonState.h:16
mc_control::fsm::State
Definition: State.h:58
mc_control
Definition: CompletionCriteria.h:10
State.h
mc_control::fsm::State::output
const std::string & output() const noexcept
Definition: State.h:97
mc_control::fsm::PythonState::handle_python_error
std::function< bool()> handle_python_error
Definition: PythonState.h:33
mc_control::fsm::Controller
Definition: Controller.h:49