-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStream.cpp
More file actions
109 lines (96 loc) · 3.92 KB
/
Copy pathStream.cpp
File metadata and controls
109 lines (96 loc) · 3.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/******************************************************************************
*
* Slamcore Confidential
* ---------------------
*
* Slamcore Limited
* All Rights Reserved.
* (C) Copyright 2018
*
* NOTICE:
*
* All information contained herein is, and remains the property of Slamcore
* Limited and its suppliers, if any. The intellectual and technical concepts
* contained herein are proprietary to Slamcore Limited and its suppliers and
* may be covered by patents in process, and are protected by trade secret or
* copyright law. Dissemination of this information or reproduction of this
* material is strictly forbidden unless prior written permission is obtained
* from Slamcore Limited.
*
******************************************************************************/
#include <slamcore/sensor_source_interface.hpp>
#include <slamcore/types/sensor_id.hpp>
#include <slamcore/types/reference_frame.hpp>
#include <slamcore/objects/static_pose.hpp>
class OdomSource : public slamcore::SensorSourceInterface
{
public:
virtual ~OdomSource() = default;
/**
* @return The unique serial identifier associated with this sensor source.
*
* @note Must be one of the device(s) identifiers agreed upon with Slamcore in design phase.
*/
virtual std::string getSerial() const = 0;
/**
* @return A lists all the sensors this source is able to provide.
*
* @note
* - Slamcore can invoke this method at any point during the sensor source
* instance lifecycle.
*
* For example, a sensor with an infrared stereo pair and an IMU might return:
*
* {
* {SensorType::Infrared, 0},
* {SensorType::Infrared, 1},
* {SensorType::Accelerometer, 0},
* {SensorType::Gyroscope, 0},
* }
*/
virtual std::vector<slamcore::SensorIDT> listSensors() const = 0;
/**
* Provides the reference frame for a given sensor.
*
* @param[in] sensor One of the `listSensors` entries.
* @return The reference frame.
*
* @note
* - Implementers may throw an exception if the requested sensor does not exist.
* - Slamcore can only invoke this method between `open` and `close`, with reference
* to the lifecycle diagram above.
*
* For example, a sensor with an infrared stereo pair and an IMU might return:
*
* {SensorType::Infrared, 0} --> {ReferenceFrameCategory::Camera, 0}
* {SensorType::Infrared, 1} --> {ReferenceFrameCategory::Camera, 1}
* {SensorType::Accelerometer, 0} --> {ReferenceFrameCategory::IMU, 0}
* {SensorType::Gyroscope, 0} --> {ReferenceFrameCategory::IMU, 0}
*/
virtual slamcore::ReferenceFrame getSensorReferenceFrame(slamcore::SensorIDT sensor) const = 0;
virtual slamcore::StaticPoseMeasurement
getStaticTransform(const slamcore::ReferenceFrame& to, const slamcore::ReferenceFrame& from) const = 0;
/**
* Provides the time offset between the given destination and source sensors
* available on the system, such that:
*
* t_destination = t_source + offset
*
* @param[in] source One of the sensors listed in `SensorSourceInterface::listSensors`,
* @param[in] destination Another sensor listed in `SensorSourceInterface::listSensors`.
* @return The offset in nanoseconds from the given source to the destination sensor.
*
* @note
* - Implementers may throw an error if the offset is not known. In this case it is expected
* that the offset will be provided through calibration file.
* - Slamcore can only invoke this method between `open` and `close`, with reference
* to the lifecycle diagram above.
*/
virtual std::chrono::nanoseconds getTimeOffset(slamcore::SensorIDT source, slamcore::SensorIDT destination) const = 0;
virtual std::error_code open() = 0;
virtual std::error_code close() = 0;
virtual std::error_code start() = 0;
virtual std::error_code stop() = 0;
virtual bool isOpen() const = 0;
virtual bool isRunning() const = 0;
};