-
Notifications
You must be signed in to change notification settings - Fork 18
/
PacketBundler.h
35 lines (29 loc) · 930 Bytes
/
PacketBundler.h
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
// Velodyne HDL Packet Bundler
// Nick Rypkema (rypkema@mit.edu), MIT 2017
// shared library to bundle velodyne packets into enough for a single frame
#ifndef PACKET_BUNDLER_H_INCLUDED
#define PACKET_BUNDLER_H_INCLUDED
#include <string>
#include <deque>
#include "PacketDecoder.h"
class PacketBundler
{
public:
PacketBundler();
virtual ~PacketBundler();
void SetMaxNumberOfBundles(unsigned int max_num_of_bundles);
void BundlePacket(std::string* data, unsigned int* data_length);
std::deque<std::string> GetBundles();
void ClearBundles();
bool GetLatestBundle(std::string* bundle, unsigned int* bundle_length);
protected:
void UnloadData();
void BundleHDLPacket(unsigned char *data, unsigned int data_length);
void SplitBundle();
private:
unsigned int _last_azimuth;
unsigned int _max_num_of_bundles;
std::string* _bundle;
std::deque<std::string> _bundles;
};
#endif // PACKET_BUNDLER_H_INCLUDED