LibMultiSense
LibMultiSense Documentation
Loading...
Searching...
No Matches
GroundSurfaceModel.hh
Go to the documentation of this file.
1
39#ifndef LibMultiSense_GroundSurfaceModelHeader
40#define LibMultiSense_GroundSurfaceModelHeader
41
43
44namespace crl {
45namespace multisense {
46namespace details {
47namespace wire {
48
50public:
51 static CRL_CONSTEXPR IdType ID = ID_DATA_GROUND_SURFACE_SPLINE_DATA_MESSAGE;
52 static CRL_CONSTEXPR VersionType VERSION = 1;
53
54#ifdef SENSORPOD_FIRMWARE
55 IdType id;
56 VersionType version;
57#endif // SENSORPOD_FIRMWARE
58
59 //
60 // Frame ID timestamp and success flag of images that the algorithm was processed on
61
62 int64_t frameId;
63 int64_t timestamp;
64 uint8_t success;
65
66 //
67 // Control points dynamic array (treated as image) members
68
72
73 //
74 // Spline origin and size details
75
76 float xzCellOrigin[2];
77 float xzCellSize[2];
78 float xzLimit[2];
79 float minMaxAzimuthAngle[2];
80
81 //
82 // Extrinsic calibration that was used during the computation of the spline
83
84 float extrinsics[6];
85
86 //
87 // Ground Base Model (ax^2 + by^2 + cxy + dx + ey + f)
88
89 float quadraticParams[6];
90
91 //
92 // Constructors
94#ifdef SENSORPOD_FIRMWARE
95 id(ID),
96 version(VERSION),
97#endif // SENSORPOD_FIRMWARE
98 frameId(0),
99 timestamp(0),
100 success(0),
101 controlPointsBitsPerPixel(0),
102 controlPointsWidth(0),
103 controlPointsHeight(0)
104 {};
105};
106
107#ifndef SENSORPOD_FIRMWARE
108
110public:
111
113
114 //
115 // Constructors
116
119
120 //
121 // Serialization routine
122
123 template<class Archive>
124 void serialize(Archive& message,
125 const VersionType version)
126 {
127 (void) version;
128
129 message & frameId;
130 message & timestamp;
131 message & success;
132
134 message & controlPointsWidth;
135 message & controlPointsHeight;
136
137 for (unsigned int i = 0; i < 2; i++)
138 message & xzCellOrigin[i];
139
140 for (unsigned int i = 0; i < 2; i++)
141 message & xzCellSize[i];
142
143 for (unsigned int i = 0; i < 2; i++)
144 message & xzLimit[i];
145
146 for (unsigned int i = 0; i < 2; i++)
147 message & minMaxAzimuthAngle[i];
148
149 for (unsigned int i = 0; i < 6; i++)
150 message & extrinsics[i];
151
152 for (unsigned int i = 0; i < 6; i++)
153 message & quadraticParams[i];
154
155 const uint32_t imageSize = static_cast<uint32_t> (std::ceil(((double) controlPointsBitsPerPixel / 8.0) * controlPointsWidth * controlPointsHeight));
156
157 if (typeid(Archive) == typeid(utility::BufferStreamWriter)) {
158
159 message.write(controlPointsDataP, imageSize);
160
161 } else {
162
163 controlPointsDataP = message.peek();
164 message.seek(message.tell() + imageSize);
165 }
166 }
167};
168
169#endif // !SENSORPOD_FIRMWARE
170
171}}}} // namespaces
172
173#endif
Macros and symbols to help portability between different compiler versions.
#define CRL_CONSTEXPR
#define WIRE_HEADER_ATTRIBS_
Definition Protocol.hh:65
GroundSurfaceModel(utility::BufferStreamReader &r, VersionType v)
void serialize(Archive &message, const VersionType version)