Cheetah Software  1.0
SimulatorMessage.h
Go to the documentation of this file.
1 
9 #ifndef PROJECT_SIMULATORTOROBOTMESSAGE_H
10 #define PROJECT_SIMULATORTOROBOTMESSAGE_H
11 
14 #include "SimUtilities/IMUTypes.h"
18 #include "Utilities/SharedMemory.h"
19 
23 enum class SimulatorMode {
24  RUN_CONTROL_PARAMETERS, // don't run the robot controller, just process
25  // Control Parameters
26  RUN_CONTROLLER, // run the robot controller
27  DO_NOTHING, // just to check connection
28  EXIT // quit!
29 };
30 
36  RobotType robotType; // which robot the simulator thinks we are simulating
37 
38  // imu data
41 
42  // leg data
44  TiBoardData tiBoardData[4];
45  // todo cheetah 3
47 
49 };
50 
57  TiBoardCommand tiBoardCommand[4];
58 
62 };
63 
70 };
71 
91  void init() {
92  robotToSimSemaphore.init(0);
93  simToRobotSemaphore.init(0);
94  }
95 
96  void waitForSimulator() { simToRobotSemaphore.decrement(); }
97 
98  void simulatorIsDone() { simToRobotSemaphore.increment(); }
99 
100  void waitForRobot() { robotToSimSemaphore.decrement(); }
101 
102  bool tryWaitForRobot() { return robotToSimSemaphore.tryDecrement(); }
103 
105  return robotToSimSemaphore.decrementTimeout(1, 0);
106  }
107 
108  void robotIsDone() { robotToSimSemaphore.increment(); }
109 
110  private:
112 };
113 
114 #endif // PROJECT_SIMULATORTOROBOTMESSAGE_H
ControlParameterResponse controlParameterResponse
Shared memory utilities for connecting the simulator program to the robot program.
CheaterState< double > cheaterState
SimulatorMode
RobotToSimulatorMessage robotToSim
VisualizationData visualizationData
CheetahVisualization mainCheetahVisualization
GamepadCommand gamepadCommand
Spine Board Code, used to simulate the SpineBoard.
SimulatorToRobotMessage simToRobot
SharedMemorySemaphore simToRobotSemaphore
The GamepadCommand type containing joystick information.
Types to allow remote access of control parameters, for use with LCM/Shared memory.
RobotType
Definition: cppTypes.h:120
Data from IMUs.
ControlParameterRequest controlParameterRequest