Ocean
Loading...
Searching...
No Matches
AccelerationSensor3DOF.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8#ifndef META_OCEAN_DEVICES_ACCELERATION_SENSOR_3DOF_H
9#define META_OCEAN_DEVICES_ACCELERATION_SENSOR_3DOF_H
10
14
17
18#include "ocean/math/Vector3.h"
19
20namespace Ocean
21{
22
23namespace Devices
24{
25
26// Forward declaration.
28
29/**
30 * Definition of a smart object reference for a 3DOF acceleration sensor.
31 * @see AccelerationSensor3DOF.
32 * @ingroup devices
33 */
35
36/**
37 * This class is the base class for all 3DOF acceleration sensors.
38 * @ingroup devices
39 */
40class OCEAN_DEVICES_EXPORT AccelerationSensor3DOF : virtual public Sensor
41{
42 public:
43
44 /**
45 * Definition of a sample holding acceleration sensor 3DOF measurements.
46 * Each acceleration measurement value is defined in [m / s^2]
47 */
48 class OCEAN_DEVICES_EXPORT Acceleration3DOFSample : virtual public Measurement::Sample
49 {
50 public:
51
52 /**
53 * Definition of a vector holding acceleration measurements.
54 * One measurement holds three different acceleration values for three separated axis.
55 */
57
58 public:
59
60 /**
61 * Creates a new acceleration sensor 3DOF sample.
62 * @param timestamp Sample timestamp
63 * @param objectIds Measurement unit object ids each id corresponds to a different acceleration measurement
64 * @param measurements Sample measurements
65 * @param metadata Optional metadata of the new sample
66 */
67 Acceleration3DOFSample(const Timestamp& timestamp, const ObjectIds& objectIds, const Measurements& measurements, const Metadata& metadata = Metadata());
68
69 /**
70 * Creates a new acceleration sensor 3DOF sample.
71 * @param timestamp Sample timestamp
72 * @param objectIds Measurement unit object ids each id corresponds to a different acceleration measurement
73 * @param measurements Sample measurements
74 * @param metadata Optional metadata of the new sample
75 */
76 Acceleration3DOFSample(const Timestamp& timestamp, ObjectIds&& objectIds, Measurements&& measurements, Metadata&& metadata = Metadata());
77
78 /**
79 * Returns all measurement values, each acceleration value in [m / s^2]
80 * @return Measurement values
81 */
82 inline const Measurements& measurements() const;
83
84 protected:
85
86 /// Measurement values.
88 };
89
90 /**
91 * Definition of a smart object reference for 3DOF acceleration sensor samples.
92 */
94
95 public:
96
97 /**
98 * Returns this device type.
99 * @param sensorType The type of the sensor (the subtype of the device), can be SENSOR_ACCELERATION_3DOF or SENSOR_LINEAR_ACCELERATION_3DOF
100 * @return Device type
101 */
102 static inline DeviceType deviceTypeAccelerationSensor3DOF(const SensorType sensorType);
103
104 protected:
105
106 /**
107 * Creates a new 3DOF acceleration sensor device.
108 * @param name The name of the acceleration sensor, must be valid
109 * @param sensorType The type of the sensor (the subtype of the device), can be SENSOR_ACCELERATION_3DOF or SENSOR_LINEAR_ACCELERATION_3DOF
110 */
111 AccelerationSensor3DOF(const std::string& name, const SensorType sensorType);
112
113 /**
114 * Destructs a 3DOF acceleration sensor device.
115 */
117};
118
125
130
131}
132
133}
134
135#endif // META_OCEAN_DEVICES_ACCELERATION_SENSOR_3DOF_H
Definition of a sample holding acceleration sensor 3DOF measurements.
Definition AccelerationSensor3DOF.h:49
const Measurements & measurements() const
Returns all measurement values, each acceleration value in [m / s^2].
Definition AccelerationSensor3DOF.h:126
Acceleration3DOFSample(const Timestamp &timestamp, const ObjectIds &objectIds, const Measurements &measurements, const Metadata &metadata=Metadata())
Creates a new acceleration sensor 3DOF sample.
Acceleration3DOFSample(const Timestamp &timestamp, ObjectIds &&objectIds, Measurements &&measurements, Metadata &&metadata=Metadata())
Creates a new acceleration sensor 3DOF sample.
Measurements measurements_
Measurement values.
Definition AccelerationSensor3DOF.h:87
This class is the base class for all 3DOF acceleration sensors.
Definition AccelerationSensor3DOF.h:41
AccelerationSensor3DOF(const std::string &name, const SensorType sensorType)
Creates a new 3DOF acceleration sensor device.
static DeviceType deviceTypeAccelerationSensor3DOF(const SensorType sensorType)
Returns this device type.
Definition AccelerationSensor3DOF.h:119
~AccelerationSensor3DOF() override
Destructs a 3DOF acceleration sensor device.
Definition of a class holding the major and minor device type.
Definition devices/Device.h:62
@ DEVICE_SENSOR
Sensor device.
Definition devices/Device.h:44
Definition of a sample holding a measurement.
Definition Measurement.h:68
std::unordered_map< std::string, Value > Metadata
Definition of an unordered map mapping keys to values.
Definition Measurement.h:62
This class implements the base class for all sensors.
Definition Sensor.h:36
SensorType
Definition of different sensor types.
Definition Sensor.h:43
@ SENSOR_ACCELERATION_3DOF
3DOF acceleration sensor.
Definition Sensor.h:47
@ SENSOR_LINEAR_ACCELERATION_3DOF
3DOF linear acceleration sensor (excluding gravity).
Definition Sensor.h:49
This class implements a smart device reference.
Definition DeviceRef.h:36
This template class implements a smart object reference which is a specialization of an ObjectRef obj...
Definition SmartObjectRef.h:90
This class implements a timestamp.
Definition Timestamp.h:63
The namespace covering the entire Ocean framework.
Definition Accessor.h:15