mc_python_controller.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 
8 #include <mc_control/api.h>
9 
10 namespace mc_control
11 {
12 
14 {
15  bool success;
16  std::string out;
17 };
18 
20 {
21 public:
22  MCPythonController(const std::vector<std::shared_ptr<mc_rbdyn::RobotModule>> & robots, double dt);
23 
24  virtual void reset(const ControllerResetData & reset_data) override;
25 
26  virtual bool run() override;
27 
28  std::function<bool()> run_callback;
29  std::function<void(const ControllerResetData &)> reset_callback;
30  std::function<bool()> handle_python_error;
31 
32 private:
33  bool python_failed_ = false;
34 };
35 
36 } // namespace mc_control
#define MC_CONTROL_DLLAPI
Definition: api.h:50
Definition: CompletionCriteria.h:11
Contains information allowing the controller to start smoothly from the current state of the robot.
Definition: MCController.h:46
MCController is the base class to implement all controllers. It assumes that at least two robots are ...
Definition: MCController.h:99
Definition: mc_python_controller.h:20
MCPythonController(const std::vector< std::shared_ptr< mc_rbdyn::RobotModule >> &robots, double dt)
virtual bool run() override
std::function< void(const ControllerResetData &)> reset_callback
Definition: mc_python_controller.h:29
virtual void reset(const ControllerResetData &reset_data) override
std::function< bool()> run_callback
Definition: mc_python_controller.h:28
std::function< bool()> handle_python_error
Definition: mc_python_controller.h:30
Definition: mc_python_controller.h:14
std::string out
Definition: mc_python_controller.h:16
bool success
Definition: mc_python_controller.h:15