check.cpp
Go to the documentation of this file.
1 #include <iostream>
2 #include <stdio.h>
3 #include <cmath>
4 using namespace std;
5 
6 typedef unsigned long uint64_t;
7 
8 int main() {
9 
10  int BLOCKS_PER_PACKET = 12 ;
11  int FIRINGS_PER_BLOCK = 2;
12  int SCANS_PER_FIRING = 16;
13  double DSR_TOFFSET=2.304;
14  double FIRING_TOFFSET =55.296;
15 int RAW_SCAN_SIZE = 3;
16 double DISTANCE_RESOLUTION = 0.01;
17 
18  for (size_t blk_idx = 0; blk_idx < BLOCKS_PER_PACKET; ++blk_idx) {
19 
20  for (size_t blk_fir_idx = 0; blk_fir_idx < FIRINGS_PER_BLOCK; ++blk_fir_idx){
21  size_t fir_idx = blk_idx*FIRINGS_PER_BLOCK + blk_fir_idx;
22 
23  for (size_t scan_fir_idx = 0; scan_fir_idx < SCANS_PER_FIRING; ++scan_fir_idx){
24  size_t byte_idx = RAW_SCAN_SIZE * (
25  SCANS_PER_FIRING*blk_fir_idx + scan_fir_idx);
26  printf("blk_idx=%lu, blk_fir_idx=%lu, fir_idx=%lu, scan_fir_idx=%lu,byte_idx=%lu\n", blk_idx, blk_fir_idx, fir_idx, scan_fir_idx, byte_idx);
27 
28  }
29  }
30  }
31 
32  printf("%d\n", 1236%1000);
33  uint64_t t1 = 123456;
34  uint64_t t2 = 789011;
35  double t;
36  t = t1*1.0 + t2 * 1e-6;
37  printf("timestamp =%f\n", t);
38 
39  return 0;
40 }
static const int SCANS_PER_FIRING
static const int BLOCKS_PER_PACKET
static const double FIRING_TOFFSET
int main()
Definition: check.cpp:8
static const double DSR_TOFFSET
static const int RAW_SCAN_SIZE
unsigned long uint64_t
Definition: check.cpp:6
static const int FIRINGS_PER_BLOCK
static const double DISTANCE_RESOLUTION


lslidar_n301_decoder
Author(s): Nick Shu
autogenerated on Thu Sep 26 2019 03:58:31