Main MRPT website > C++ reference for MRPT 1.5.6
obs/CObservationRawDAQ.h
Go to the documentation of this file.
1 /* +---------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2017, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +---------------------------------------------------------------------------+ */
9 #ifndef CObservationRawDAQ_H
10 #define CObservationRawDAQ_H
11 
13 #include <mrpt/obs/CObservation.h>
14 
15 namespace mrpt
16 {
17 namespace obs
18 {
19  DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE( CObservationRawDAQ , CObservation, OBS_IMPEXP)
20 
21  /** Store raw data from a Data Acquisition (DAQ) device, such that input or output analog and digital channels, counters from encoders, etc. at one sampling instant.
22  * All analog values are assumed to be volts.
23  * On timing:
24  * - CObservation::timestamp corresponds to the time of the first samples in each of the vectors.
25  * - CObservationRawDAQ::sample_rate is the sampling rate, in samples per second per channel, as stored by the source driver.
26  *
27  * \sa CObservation
28  * \ingroup mrpt_obs_grp
29  */
31  {
32  // This must be added to any CSerializable derived class:
34  public:
35  /** Constructor */
36  inline CObservationRawDAQ() : AIN_channel_count(0),AIN_interleaved(true),sample_rate(0) { }
37  /** Destructor */
39  { }
40 
41  std::vector<uint8_t> AIN_8bits; /** Readings from 8-bit analog input (ADCs) channels (vector length=channel count) in ADC units. */
42  std::vector<uint16_t> AIN_16bits; /** Readings from 16-bit analog input (ADCs) channels (vector length=channel count) in ADC units. */
43  std::vector<uint32_t> AIN_32bits; /** Readings from 32-bit analog input (ADCs) channels (vector length=channel count) in ADC units. */
44  std::vector<float> AIN_float; /** Readings from analog input (ADCs) channels (vector length=channel count) in Volts. */
45  std::vector<double> AIN_double; /** Readings from analog input (ADCs) channels (vector length=channel count) in Volts. */
46 
47  uint16_t AIN_channel_count; //!< How many different ADC channels are present in the AIN_* vectors.
48  bool AIN_interleaved; //!< Whether the channels are interleaved (A0 A1 A2 A0 A1 A2...) or not (A0 A0 A0 A1 A1 A1 A2 A2 A2...) in the AIN_* vectors.
49 
50  std::vector<uint8_t> AOUT_8bits; /** Present output values for 8-bit analog output (DACs) channels (vector length=channel count) in DAC units.*/
51  std::vector<uint16_t> AOUT_16bits; /** Present output values for 16-bit analog output (DACs) channels (vector length=channel count) in DAC units.*/
52  std::vector<float> AOUT_float; /** Present output values for 16-bit analog output (DACs) channels (vector length=channel count) in volts.*/
53  std::vector<double> AOUT_double; /** Present output values for 16-bit analog output (DACs) channels (vector length=channel count) in volts.*/
54 
55  std::vector<uint8_t> DIN; /** Readings from digital inputs; each byte stores 8 digital inputs, or 8-bit port. */
56  std::vector<uint8_t> DOUT; /** Present digital output values; each byte stores 8 digital inputs, or 8-bit port. */
57 
58  std::vector<uint32_t> CNTRIN_32bits; /** Readings from ticks counters, such as quadrature encoders. (vector length=channel count) in ticks. */
59  std::vector<double> CNTRIN_double; /** Readings from ticks counters, such as quadrature encoders. (vector length=channel count) in radians, degrees or any other unit (depends on the source driver). */
60 
61  double sample_rate; //!< The sampling rate, in samples per second per channel
62 
63  /** Not used in this class */
65  /** Not used in this class */
67  // See base class docs
68  void getDescriptionAsText(std::ostream &o) const MRPT_OVERRIDE;
69 
70  }; // End of class def.
71  DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE( CObservationRawDAQ , CObservation, OBS_IMPEXP)
72 
73  } // End of namespace
74 } // End of namespace
75 
76 #endif
uint16_t AIN_channel_count
Readings from analog input (ADCs) channels (vector length=channel count) in Volts.
double sample_rate
Readings from ticks counters, such as quadrature encoders.
unsigned __int16 uint16_t
Definition: rptypes.h:46
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
virtual ~CObservationRawDAQ()
Destructor.
#define DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
This declaration must be inserted in all CSerializable classes definition, before the class declarati...
void setSensorPose(const mrpt::poses::CPose3D &) MRPT_OVERRIDE
Not used in this class.
std::vector< uint16_t > AOUT_16bits
Present output values for 8-bit analog output (DACs) channels (vector length=channel count) in DAC un...
std::vector< uint32_t > AIN_32bits
Readings from 16-bit analog input (ADCs) channels (vector length=channel count) in ADC units...
std::vector< double > AOUT_double
Present output values for 16-bit analog output (DACs) channels (vector length=channel count) in volts...
bool AIN_interleaved
Whether the channels are interleaved (A0 A1 A2 A0 A1 A2...) or not (A0 A0 A0 A1 A1 A1 A2 A2 A2...
Store raw data from a Data Acquisition (DAQ) device, such that input or output analog and digital cha...
std::vector< double > CNTRIN_double
Readings from ticks counters, such as quadrature encoders.
std::vector< uint8_t > DOUT
Readings from digital inputs; each byte stores 8 digital inputs, or 8-bit port.
std::vector< double > AIN_double
Readings from analog input (ADCs) channels (vector length=channel count) in Volts.
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:72
Declares a class that represents any robot's observation.
std::vector< float > AOUT_float
Present output values for 16-bit analog output (DACs) channels (vector length=channel count) in DAC u...
void getSensorPose(mrpt::poses::CPose3D &) const MRPT_OVERRIDE
Not used in this class.
std::vector< float > AIN_float
Readings from 32-bit analog input (ADCs) channels (vector length=channel count) in ADC units...
std::vector< uint8_t > DIN
Present output values for 16-bit analog output (DACs) channels (vector length=channel count) in volts...
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
std::vector< uint32_t > CNTRIN_32bits
Present digital output values; each byte stores 8 digital inputs, or 8-bit port.
std::vector< uint16_t > AIN_16bits
Readings from 8-bit analog input (ADCs) channels (vector length=channel count) in ADC units...



Page generated by Doxygen 1.8.6 for MRPT 1.5.6 Git: 4c65e84 Tue Apr 24 08:18:17 2018 +0200 at mar abr 24 08:26:17 CEST 2018