Ocean
Loading...
Searching...
No Matches
GyroSensor3DOF.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_GYRO_SENSOR_3DOF_H
9#define META_OCEAN_DEVICES_GYRO_SENSOR_3DOF_H
10
14
17
18#include "ocean/math/Vector3.h"
19
20namespace Ocean
21{
22
23namespace Devices
24{
25
26// Forward declaration.
27class GyroSensor3DOF;
28
29/**
30 * Definition of a smart object reference for a 3DOF gyro sensor.
31 * @see GyroSensor3DOF.
32 * @ingroup devices
33 */
35
36/**
37 * This class is the base class for all 3DOF gyro sensors.
38 * @ingroup devices
39 */
40class OCEAN_DEVICES_EXPORT GyroSensor3DOF : virtual public Sensor
41{
42 public:
43
44 /**
45 * Definition of a sample holding gyro sensor 3DOF measurements.
46 * Each gyro measurement value is defined in [rad / s]
47 */
48 class OCEAN_DEVICES_EXPORT Gyro3DOFSample : virtual public Measurement::Sample
49 {
50 public:
51
52 /**
53 * Definition of a vector holding gyro measurements.
54 * One measurement holds three different gyro values for three separated axis.
55 */
57
58 public:
59
60 /**
61 * Creates a new gyro sensor 3DOF sample.
62 * @param timestamp Sample timestamp
63 * @param objectIds Measurement unit object ids each id corresponds to a different gyro measurement
64 * @param measurements Sample measurements
65 */
67
68 /**
69 * Creates a new gyro sensor 3DOF sample.
70 * @param timestamp Sample timestamp
71 * @param objectIds Measurement unit object ids each id corresponds to a different gyro measurement
72 * @param measurements Sample measurements
73 */
75
76 /**
77 * Returns all measurement values, each value in [rad / s]
78 * @return Measurement values
79 */
80 inline const Measurements& measurements() const;
81
82 protected:
83
84 /// Measurement values.
86 };
87
88 /**
89 * Definition of a smart object reference for 3DOF gyro sensor samples.
90 */
92
93 public:
94
95 /**
96 * Returns this device type.
97 * @param sensorType The type of the sensor (the subtype of the device), can be SENSOR_GYRO_RAW_3DOF or SENSOR_GYRO_UNBIASED_3DOF
98 * @return Device type
99 */
100 static inline DeviceType deviceTypeGyroSensor3DOF(const SensorType sensorType);
101
102 protected:
103
104 /**
105 * Creates a new 3DOF gyro sensor device.
106 * @param name The name of the gyro sensor
107 * @param sensorType The type of the sensor (the subtype of the device), can be SENSOR_GYRO_RAW_3DOF or SENSOR_GYRO_UNBIASED_3DOF
108 */
109 GyroSensor3DOF(const std::string& name, const SensorType sensorType);
110
111 /**
112 * Destructs a 3DOF gyro sensor device.
113 */
114 ~GyroSensor3DOF() override;
115};
116
118{
119 ocean_assert(sensorType == SENSOR_GYRO_RAW_3DOF || sensorType == SENSOR_GYRO_UNBIASED_3DOF);
120
121 return GyroSensor3DOF::DeviceType(DEVICE_SENSOR, sensorType);
122}
123
128
129}
130
131}
132
133#endif // META_OCEAN_DEVICES_GYRO_SENSOR_3DOF_H
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
const std::string & name() const
Returns the name of this device.
Definition devices/Device.h:340
StackHeapVector< Vector3, 1 > Measurements
Definition of a vector holding gyro measurements.
Definition GyroSensor3DOF.h:56
Gyro3DOFSample(const Timestamp &timestamp, ObjectIds &&objectIds, Measurements &&measurements)
Creates a new gyro sensor 3DOF sample.
Gyro3DOFSample(const Timestamp &timestamp, const ObjectIds &objectIds, const Measurements &measurements)
Creates a new gyro sensor 3DOF sample.
const Measurements & measurements() const
Returns all measurement values, each value in [rad / s].
Definition GyroSensor3DOF.h:124
Measurements measurements_
Measurement values.
Definition GyroSensor3DOF.h:85
This class is the base class for all 3DOF gyro sensors.
Definition GyroSensor3DOF.h:41
static DeviceType deviceTypeGyroSensor3DOF(const SensorType sensorType)
Returns this device type.
Definition GyroSensor3DOF.h:117
GyroSensor3DOF(const std::string &name, const SensorType sensorType)
Creates a new 3DOF gyro sensor device.
SmartObjectRef< Gyro3DOFSample, Sample > Gyro3DOFSampleRef
Definition of a smart object reference for 3DOF gyro sensor samples.
Definition GyroSensor3DOF.h:91
~GyroSensor3DOF() override
Destructs a 3DOF gyro sensor device.
Definition of a sample holding a measurement.
Definition Measurement.h:68
const ObjectIds & objectIds() const
Returns the sample object ids specifying possible different measurement units.
Definition Measurement.h:519
const Timestamp & timestamp() const
Returns the sample timestamp.
Definition Measurement.h:509
StackHeapVector< ObjectId, 1 > ObjectIds
Definition of a vector holding object ids.
Definition Measurement.h:52
Sensor(const std::string &name, const DeviceType type)
Creates a new sensor object.
SensorType
Definition of different sensor types.
Definition Sensor.h:43
@ SENSOR_GYRO_RAW_3DOF
3DOF gyro sensor (raw samples).
Definition Sensor.h:51
@ SENSOR_GYRO_UNBIASED_3DOF
3DOF gyro sensor (unbiased samples).
Definition Sensor.h:53
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
Vector like data structure combining stack and heap memory.
Definition StackHeapVector.h:27
This class implements a timestamp.
Definition Timestamp.h:64
SmartDeviceRef< GyroSensor3DOF > GyroSensor3DOFRef
Definition of a smart object reference for a 3DOF gyro sensor.
Definition GyroSensor3DOF.h:34
Namespace of the Devices library.
Definition AccelerationSensor3DOF.h:24
The namespace covering the entire Ocean framework.
Definition Accessor.h:15