Main MRPT website > C++ reference for MRPT 1.4.0
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-2016, 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
14
15namespace mrpt
16{
17namespace obs
18{
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.
72
73 } // End of namespace
74} // End of namespace
75
76#endif
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
#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...
Declares a class that represents any robot's observation.
Store raw data from a Data Acquisition (DAQ) device, such that input or output analog and digital cha...
void setSensorPose(const mrpt::poses::CPose3D &) MRPT_OVERRIDE
Not used in this class.
std::vector< double > CNTRIN_double
Readings from ticks counters, such as quadrature encoders.
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< float > AOUT_float
Present output values for 16-bit analog output (DACs) channels (vector length=channel count) in DAC u...
uint16_t AIN_channel_count
Readings from analog input (ADCs) channels (vector length=channel count) in Volts.
std::vector< uint16_t > AIN_16bits
Readings from 8-bit analog input (ADCs) channels (vector length=channel count) in ADC units.
double sample_rate
Readings from ticks counters, such as quadrature encoders.
virtual ~CObservationRawDAQ()
Destructor.
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....
std::vector< uint32_t > CNTRIN_32bits
Present digital output values; 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.
std::vector< float > AIN_float
Readings from 32-bit analog input (ADCs) channels (vector length=channel count) in ADC units.
void getSensorPose(mrpt::poses::CPose3D &) const MRPT_OVERRIDE
Not used in this class.
std::vector< uint8_t > DIN
Present output values for 16-bit analog output (DACs) channels (vector length=channel count) in volts...
std::vector< uint32_t > AIN_32bits
Readings from 16-bit analog input (ADCs) channels (vector length=channel count) in ADC units.
void getDescriptionAsText(std::ostream &o) const MRPT_OVERRIDE
Build a detailed, multi-line textual description of the observation contents and dump it to the outpu...
std::vector< uint8_t > DOUT
Readings from digital inputs; each byte stores 8 digital inputs, or 8-bit port.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:73
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
Definition: mrpt_macros.h:28
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
unsigned int uint16_t
Definition: pstdint.h:170



Page generated by Doxygen 1.9.5 for MRPT 1.4.0 SVN: at Sun Nov 27 02:56:26 UTC 2022