GroundSurfaceModel.hh
Go to the documentation of this file.
1 
39 #ifndef LibMultiSense_GroundSurfaceModelHeader
40 #define LibMultiSense_GroundSurfaceModelHeader
41 
43 
44 namespace crl {
45 namespace multisense {
46 namespace details {
47 namespace wire {
48 
50 public:
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 
110 public:
111 
113 
114  //
115  // Constructors
116 
118  GroundSurfaceModel() : controlPointsDataP(NULL) {};
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 
133  message & controlPointsBitsPerPixel;
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
GroundSurfaceModel(utility::BufferStreamReader &r, VersionType v)
static CRL_CONSTEXPR IdType ID_DATA_GROUND_SURFACE_SPLINE_DATA_MESSAGE
Definition: Protocol.hh:224
void serialize(Archive &message, const VersionType version)
std::string * frameId(M &m)
void serialize(Stream &stream, const T &t)
Definition: channel.cc:58
#define WIRE_HEADER_ATTRIBS_
Definition: Protocol.hh:64
#define CRL_CONSTEXPR
Definition: Portability.hh:49


multisense_lib
Author(s):
autogenerated on Sat Jun 24 2023 03:01:21