MRPT  2.0.4
CObservationRawDAQ.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2020, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #pragma once
10 
11 #include <mrpt/obs/CObservation.h>
13 
14 namespace mrpt::obs
15 {
16 /** Store raw data from a Data Acquisition (DAQ) device, such that input or
17  * output analog and digital channels, counters from encoders, etc. at one
18  * sampling instant.
19  * All analog values are assumed to be volts.
20  * On timing:
21  * - CObservation::timestamp corresponds to the time of the first samples in
22  * each of the vectors.
23  * - CObservationRawDAQ::sample_rate is the sampling rate, in samples per second
24  * per channel, as stored by the source driver.
25  *
26  * \sa CObservation
27  * \ingroup mrpt_obs_grp
28  */
30 {
32  public:
33  /** Constructor */
34  inline CObservationRawDAQ() = default;
35  /** Destructor */
36  ~CObservationRawDAQ() override = default;
37  std::vector<uint8_t> AIN_8bits; /** Readings from 8-bit analog input (ADCs)
38  channels (vector length=channel count) in
39  ADC units. */
40  std::vector<uint16_t> AIN_16bits; /** Readings from 16-bit analog input
41  (ADCs) channels (vector length=channel
42  count) in ADC units. */
43  std::vector<uint32_t> AIN_32bits; /** Readings from 32-bit analog input
44  (ADCs) channels (vector length=channel
45  count) in ADC units. */
46  std::vector<float> AIN_float; /** Readings from analog input (ADCs) channels
47  (vector length=channel count) in Volts. */
48  std::vector<double> AIN_double; /** Readings from analog input (ADCs)
49  channels (vector length=channel count) in
50  Volts. */
51 
52  /** How many different ADC channels are present in the AIN_* vectors. */
53  uint16_t AIN_channel_count{0};
54  /** Whether the channels are interleaved (A0 A1 A2 A0 A1 A2...) or not (A0
55  * A0 A0 A1 A1 A1 A2 A2 A2...) in the AIN_* vectors. */
56  bool AIN_interleaved{true};
57 
58  std::vector<uint8_t> AOUT_8bits; /** Present output values for 8-bit analog
59  output (DACs) channels (vector
60  length=channel count) in DAC units.*/
61  std::vector<uint16_t> AOUT_16bits; /** Present output values for 16-bit
62  analog output (DACs) channels (vector
63  length=channel count) in DAC units.*/
64  std::vector<float> AOUT_float; /** Present output values for 16-bit analog
65  output (DACs) channels (vector
66  length=channel count) in volts.*/
67  std::vector<double> AOUT_double; /** Present output values for 16-bit analog
68  output (DACs) channels (vector
69  length=channel count) in volts.*/
70 
71  std::vector<uint8_t> DIN; /** Readings from digital inputs; each byte stores
72  8 digital inputs, or 8-bit port. */
73  std::vector<uint8_t> DOUT; /** Present digital output values; each byte
74  stores 8 digital inputs, or 8-bit port. */
75 
76  std::vector<uint32_t> CNTRIN_32bits; /** Readings from ticks counters, such
77  as quadrature encoders. (vector
78  length=channel count) in ticks. */
79  std::vector<double> CNTRIN_double; /** Readings from ticks counters, such as
80  quadrature encoders. (vector
81  length=channel count) in radians,
82  degrees or any other unit (depends on
83  the source driver). */
84 
85  /** The sampling rate, in samples per second per channel */
86  double sample_rate{0};
87 
88  /** Not used in this class */
89  void getSensorPose(mrpt::poses::CPose3D&) const override {}
90  /** Not used in this class */
91  void setSensorPose(const mrpt::poses::CPose3D&) override {}
92  // See base class docs
93  void getDescriptionAsText(std::ostream& o) const override;
94 
95 }; // End of class def.
96 
97 } // namespace mrpt::obs
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.
std::vector< uint8_t > AOUT_8bits
void getSensorPose(mrpt::poses::CPose3D &) const 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...
This namespace contains representation of robot actions and observations.
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.
void setSensorPose(const mrpt::poses::CPose3D &) override
Not used in this class.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:85
Declares a class that represents any robot&#39;s observation.
Definition: CObservation.h:43
std::vector< float > AOUT_float
Present output values for 16-bit analog output (DACs) channels (vector length=channel count) in DAC u...
#define DEFINE_SERIALIZABLE(class_name, NS)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
std::vector< float > AIN_float
Readings from 32-bit analog input (ADCs) channels (vector length=channel count) in ADC units...
~CObservationRawDAQ() override=default
Destructor.
std::vector< uint8_t > DIN
Present output values for 16-bit analog output (DACs) channels (vector length=channel count) in volts...
CObservationRawDAQ()=default
Constructor.
void getDescriptionAsText(std::ostream &o) const override
Build a detailed, multi-line textual description of the observation contents and dump it to the outpu...
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...
std::vector< uint8_t > AIN_8bits



Page generated by Doxygen 1.8.14 for MRPT 2.0.4 Git: 33de1d0ad Sat Jun 20 11:02:42 2020 +0200 at sáb jun 20 17:35:17 CEST 2020