Smart Minotaur
 Alle Klassen Dateien Funktionen Variablen Seiten
SensorThread.hpp
1 #ifndef ROBOT_CONTROL_SENSOR_THREAD_HPP
2 #define ROBOT_CONTROL_SENSOR_THREAD_HPP
3 
4 #include "robot_control/SensorCommunicator.hpp"
5 #include "minotaur_common/Thread.hpp"
6 
7 namespace minotaur
8 {
13  class SensorThread: public Thread
14  {
15  private:
16  pthread_mutex_t intervalMutex;
17  int samplingIntervalMsec;
18  SensorCommunicator &sensorCommunicator;
19 
20  volatile bool keepRunning;
21 
22  void publishSensorData();
23  protected:
24  void onStart();
25  void onStop();
26  public:
27  SensorThread(SensorCommunicator &p_sensorCommunicator);
28  ~SensorThread();
29 
33  void run();
34 
35  void setSamplingInterval(const int p_samplingIntervalMsec);
36  int getSamplingInterval();
37  };
38 }
39 
40 #endif