packet_structure.h
Go to the documentation of this file.
1 // Copyright (c) 2014, Pepperl+Fuchs GmbH, Mannheim
2 // Copyright (c) 2014, Denis Dillenberger
3 // All rights reserved.
4 //
5 // Use, modification, and distribution is subject to the
6 // 3-clause BSD license ("Revised BSD License",
7 // "New BSD License", or "Modified BSD License")
8 // You should have received a copy of this license
9 // in a file named COPYING or LICENSE.
10 
11 #ifndef PACKET_STRUCTURE_H
12 #define PACKET_STRUCTURE_H
13 #include <cstdint>
14 #include <vector>
15 
16 namespace pepperl_fuchs {
17 
18 #pragma pack(1)
19 struct PacketHeader
22 {
24  std::uint16_t magic;
25 
27  std::uint16_t packet_type;
28 
30  std::uint32_t packet_size;
31 
33  std::uint16_t header_size;
34 
36  std::uint16_t scan_number;
37 
39  std::uint16_t packet_number;
40 
42  std::uint64_t timestamp_raw;
43 
45  std::uint64_t timestamp_sync;
46 
48  std::uint32_t status_flags;
49 
51  std::uint32_t scan_frequency;
52 
54  std::uint16_t num_points_scan;
55 
57  std::uint16_t num_points_packet;
58 
60  std::uint16_t first_index;
61 
63  std::int32_t first_angle;
64 
66  std::int32_t angular_increment;
67 
69  std::uint32_t output_status;
70 
72  std::uint32_t field_status;
73 
75  //std::uint8 padding[0];
76 };
77 
81 {
83  std::uint32_t distance_amplitude_payload; // distance 20 bit, amplitude 12 bit
84 };
85 #pragma pack()
86 
89 struct ScanData
90 {
92  std::vector<std::uint32_t> distance_data;
93 
95  std::vector<std::uint32_t> amplitude_data;
96 
98  std::vector<PacketHeader> headers;
99 };
100 
101 }
102 
103 #endif // PACKET_STRUCTURE_H
std::uint64_t timestamp_sync
With an external NTP server synced Timestamp (currenty not available and and set to zero) ...
std::int32_t angular_increment
Delta between two succeding scan points 1/10000°
std::uint32_t status_flags
Status flags.
std::uint16_t magic
Magic bytes, must be 5C A2 (hex)
std::uint16_t packet_number
Sequence number for packet (counting packets of a particular scan, starting with 1) ...
std::uint32_t field_status
Field status.
std::uint16_t num_points_scan
Total number of scan points (samples) within complete scan.
std::int32_t first_angle
Absolute angle of first scan point within this packet in 1/10000°
Normally contains one complete laserscan (a full rotation of the scanner head)
std::uint32_t packet_size
Overall packet size (header+payload), 1404 bytes with maximum payload.
std::uint32_t distance_amplitude_payload
std::uint16_t num_points_packet
Total number of scan points within this packet.
std::vector< std::uint32_t > distance_data
Distance data in polar form in millimeter.
std::uint16_t scan_number
Sequence for scan (incremented for every scan, starting with 0, overflows)
Header of a TCP or UDP data packet from the scanner.
std::uint32_t scan_frequency
Frequency of scan-head rotation in mHz (Milli-Hertz)
std::uint64_t timestamp_raw
Raw timestamp of internal clock in NTP time format.
std::vector< std::uint32_t > amplitude_data
Amplitude data in the range 32-4095, values lower than 32 indicate an error or undefined values...
std::uint32_t output_status
Output status.
std::vector< PacketHeader > headers
Header received with the distance and amplitude data.
Structure of a UDP or TCP data packet from the laserscanner.
std::uint16_t header_size
Header size, defaults to 60 bytes.
std::uint16_t packet_type
Packet type, must be 43 00 (hex)
std::uint16_t first_index
Index of first scan point within this packet.


pepperl_fuchs_r2000
Author(s): Denis Dillenberger
autogenerated on Mon Jun 10 2019 14:12:48