dps_desertstar_ssp1
Driver.hpp
Go to the documentation of this file.
1 #ifndef _DESERTSTAR_DRIVER_HPP_
2 #define _DESERTSTAR_DRIVER_HPP_
3 
4 #include <iostream>
5 #include <iodrivers_base/Driver.hpp>
6 #include <base/samples/RigidBodyState.hpp>
7 #include <list>
8 
9 //Arbitarry large number to fit the message
10 #define DESERTSTAR_BUFFER_SIZE 512
11 
12 namespace dps_desertstar_ssp1
13 {
14  class Interface{
15  public:
16  virtual void newDepthData(const base::samples::RigidBodyState &depth)=0;
17  virtual void newTemperatureData(const double &temperature)=0;
18  };
19 
20  class Driver : public iodrivers_base::Driver
21  {
22  public:
23  Driver(const double variance = 0.0216505327374);
24  void process();
25  void updateVaricance(double variance);
26  void registerHandler(Interface *interface);
27  void unregisterHandler(Interface *interface);
28  virtual int extractPacket(uint8_t const* buffer, size_t buffer_size) const;
29  protected:
30  base::samples::RigidBodyState depth;
31  std::list<Interface*> handler;
32  uint8_t buffer[DESERTSTAR_BUFFER_SIZE];
33 
34  };
35 
36 } // end namespace dps_desertstar_ssp1
37 
38 #endif
std::list< Interface * > handler
Definition: Driver.hpp:31
#define DESERTSTAR_BUFFER_SIZE
Definition: Driver.hpp:10
Definition: Driver.hpp:14
Definition: Driver.cpp:3
virtual void newTemperatureData(const double &temperature)=0
Definition: Driver.hpp:20
base::samples::RigidBodyState depth
Definition: Driver.hpp:30
virtual void newDepthData(const base::samples::RigidBodyState &depth)=0