velodyne.h
Go to the documentation of this file.
1 /**************************************************************************************************
2  Software License Agreement (BSD License)
3 
4  Copyright (c) 2011-2013, LAR toolkit developers - University of Aveiro - http://lars.mec.ua.pt
5  All rights reserved.
6 
7  Redistribution and use in source and binary forms, with or without modification, are permitted
8  provided that the following conditions are met:
9 
10  *Redistributions of source code must retain the above copyright notice, this list of
11  conditions and the following disclaimer.
12  *Redistributions in binary form must reproduce the above copyright notice, this list of
13  conditions and the following disclaimer in the documentation and/or other materials provided
14  with the distribution.
15  *Neither the name of the University of Aveiro nor the names of its contributors may be used to
16  endorse or promote products derived from this software without specific prior written permission.
17 
18  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
19  IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
21  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
24  IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
25  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 ***************************************************************************************************/
33 #ifndef _VELODYNE_H
34 #define _VELODYNE_H
35 
36 #include <stdint.h>
37 #include <math.h>
38 
43 #define VELODYNE_NUM_LASERS 64
44 
47 {
48  uint8_t *data;
49  uint8_t *p;
51 
52  int i; // which laser within the current block are we processing?
55 
57  char version_string[16];
58 };
59 
62 {
63  double xyz[3]; // calibrated, projected into velodyne coordinate system
64  double raw_range; // raw return directly from sensor
65  double range; // corrected range
66  double ctheta; // theta of sensor head at time of sample, **always [0, 2*PI)**
67  double theta; // calibrated theta (horizontal/yaw angle) **always [0, 2*PI)**
68  double phi; // calibrated phi (veritcle/pitch angle)
69  double intensity; // normalized intensity [0, 1]
70  int physical; // physical laser number (0-31 lower, 32-63 upper)
71  int logical; // logical laser number (in order of increasing pitch)
72 };
73 
75 {
76  double rcf; // radians (rotational/yaw offset)
77  double vcf; // radians (vertical offset)
78  double hcf; // meters (horizontal off-axis offset)
79  double range_offset; // meters
80  double range_scale_offset; // (scalar)
81 };
82 
83 typedef struct
84 {
85  struct velodyne_laser_calib lasers[VELODYNE_NUM_LASERS]; // physical idx
86  int physical2logical[VELODYNE_NUM_LASERS];
87  int logical2physical[VELODYNE_NUM_LASERS];
88  double sincos[VELODYNE_NUM_LASERS][2];
90 
92 
93 
94 // Velodyne lidars are numbered in two different ways:
95 // Physical: The order given by the hardware.
96 // Logical: In order of increasing phi
97 
99 
100 // NOT REENTRANT.
101 // Compute the logical laser numbers given the current phi angles
102 // (necessary before calls to p2l or l2p)
104 
105 static inline int velodyne_physical_to_logical(velodyne_calib_t *v, int phys)
106 {
107  return v->physical2logical[phys];
108 }
109 
110 static inline int velodyne_logical_to_physical(velodyne_calib_t *v, int logical)
111 {
112  return v->logical2physical[logical];
113 }
114 
115 // return an upper bound on the # of samples in this message
116 int velodyne_decoder_estimate_samples(velodyne_calib_t *v, const void *_data, int datalen);
117 
118 int velodyne_decoder_init(velodyne_calib_t *v, velodyne_decoder_t *vd, const void *_data, int datalen);
120 
121 #endif
122 
int velodyne_calib_precompute(velodyne_calib_t *v)
Definition: velodyne.cpp:246
int physical2logical[VELODYNE_NUM_LASERS]
Definition: velodyne.h:86
int velodyne_decoder_estimate_samples(velodyne_calib_t *v, const void *_data, int datalen)
Definition: velodyne.cpp:55
velodyne_calib_t * velodyne_calib_create()
Definition: velodyne.cpp:273
int velodyne_decoder_init(velodyne_calib_t *v, velodyne_decoder_t *vd, const void *_data, int datalen)
Definition: velodyne.cpp:61
int logical2physical[VELODYNE_NUM_LASERS]
Definition: velodyne.h:87
char version_string[16]
Definition: velodyne.h:57
double ctheta
Definition: velodyne.h:54
int32_t revolution_count
Definition: velodyne.h:56
static int velodyne_physical_to_logical(velodyne_calib_t *v, int phys)
Definition: velodyne.h:105
int velodyne_decoder_next(velodyne_calib_t *v, velodyne_decoder_t *vd, struct velodyne_sample *sample)
Definition: velodyne.cpp:87
double theta
Definition: velodyne.h:67
double phi
Definition: velodyne.h:68
int data_remaining
Definition: velodyne.h:50
uint8_t * p
Definition: velodyne.h:49
double cos_ctheta
Definition: velodyne.h:54
static int velodyne_logical_to_physical(velodyne_calib_t *v, int logical)
Definition: velodyne.h:110
void velodyne_dump_calib(velodyne_calib_t *v)
double sin_ctheta
Definition: velodyne.h:54
double intensity
Definition: velodyne.h:69
uint8_t * data
Definition: velodyne.h:48
double raw_range
Definition: velodyne.h:64
double xyz[3]
Definition: velodyne.h:63
double range_scale_offset
Definition: velodyne.h:80
double ctheta
Definition: velodyne.h:66
#define VELODYNE_NUM_LASERS
Definition: velodyne.h:43
double range
Definition: velodyne.h:65


mit_darpa_logs_player
Author(s): Miguel Oliveira
autogenerated on Mon Mar 2 2015 01:32:15