blmc_drivers
analog_sensor.hpp
Go to the documentation of this file.
1 
8 #pragma once
9 
10 #include <memory>
11 #include <string>
12 
13 #include "real_time_tools/timer.hpp"
14 
15 #include "real_time_tools/threadsafe/threadsafe_timeseries.hpp"
18 
19 
20 namespace blmc_drivers
21 {
22 
28 {
29 public:
33  typedef real_time_tools::ThreadsafeTimeseries<double> ScalarTimeseries;
34 
35 
42  virtual std::shared_ptr<const ScalarTimeseries> get_measurement() const = 0;
43 
49 };
50 
55 {
56 public:
57 
65  AnalogSensor(std::shared_ptr<MotorBoardInterface> board, bool sensor_id);
66 
73  virtual std::shared_ptr<const ScalarTimeseries> get_measurement() const;
74 
75 private:
76 
81  std::shared_ptr<MotorBoardInterface> board_;
82 
87  size_t sensor_id_;
88 };
89 
90 }
virtual std::shared_ptr< const ScalarTimeseries > get_measurement() const =0
Get the measurement object which is the list of time stamped data.
size_t sensor_id_
sensor_id_ is the identification number of the sensor on the control board, for now it is either 0 or...
Definition: analog_sensor.hpp:87
This namespace is the standard namespace of the package.
Definition: const_torque_control.cpp:12
AnalogSensorInterface class is a simple abstract interface for using blmc analog measurements.
Definition: analog_sensor.hpp:27
std::shared_ptr< MotorBoardInterface > board_
board_ is the measurement object, it caontains the list of the timed stamped data ...
Definition: analog_sensor.hpp:81
this class exists purely for logical reasons, it does not in itself implement anything.
Definition: device_interface.hpp:36
virtual ~AnalogSensorInterface()
Destroy the AnalogSensorInterface object.
Definition: analog_sensor.hpp:48
real_time_tools::ThreadsafeTimeseries< double > ScalarTimeseries
This is just a short cut for the time series types.
Definition: analog_sensor.hpp:33
AnalogSensor class is the implementation of the above interface.
Definition: analog_sensor.hpp:54