Cheetah Software  1.0
SimulationBridge.h
Go to the documentation of this file.
1 
7 #ifndef PROJECT_SIMULATIONDRIVER_H
8 #define PROJECT_SIMULATIONDRIVER_H
9 
10 #include <thread>
12 #include "RobotRunner.h"
14 #include "Types.h"
15 #include "Utilities/PeriodicTask.h"
16 #include "Utilities/SharedMemory.h"
17 
19  public:
20  explicit SimulationBridge(RobotType robot, RobotController* robot_ctrl) :
21  _robot(robot) {
23  _robotRunner = new RobotRunner(robot_ctrl, _fakeTaskManager, 0, "robot-task");
24  _userParams = robot_ctrl->getUserControlParameters();
25 
26  }
27  void run();
29  void runRobotControl();
31  delete _fakeTaskManager;
32  delete _robotRunner;
33  }
34  void run_sbus();
35 
36  private:
38  bool _firstControllerRun = true;
47 
48  std::thread* sbus_thread;
49 };
50 
51 #endif // PROJECT_SIMULATIONDRIVER_H
Shared memory utilities for connecting the simulator program to the robot program.
PeriodicTaskManager taskManager
ControlParameters * _userParams
SimulatorMode
std::thread * sbus_thread
Implementation of a periodic function running in a separate thread. Periodic tasks have a task manage...
SimulationBridge(RobotType robot, RobotController *robot_ctrl)
Common framework for running robot controllers. This code is a common interface between control code ...
virtual ControlParameters * getUserControlParameters()=0
SimulatorMode _simMode
RobotRunner * _robotRunner
uint64_t u64
Definition: cTypes.h:17
RobotControlParameters _robotParams
Messages sent to/from the development simulator.
PeriodicTaskManager * _fakeTaskManager
RobotType
Definition: cppTypes.h:120
SharedMemoryObject< SimulatorSyncronizedMessage > _sharedMemory