laser_data_inline.h
Go to the documentation of this file.
1 #ifndef H_LASER_DATA_INLINE
2 #define H_LASER_DATA_INLINE
3 
4 #include <gsl/gsl_math.h>
5 #include <gsl/gsl_vector.h>
6 
7 #include "csm.h"
8 
9 /* Simple inline functions */
10 
11 /*#warning Seen ld_valid_ray*/
12 
13 INLINE int ld_valid_ray(LDP ld, int i) {
14  return (i>=0) && (i<ld->nrays) && (ld->valid[i]);
15 }
16 
17 INLINE int ld_valid_alpha(LDP ld, int i) {
18  return ld->alpha_valid[i] != 0;
19 }
20 
22  ld->corr[i].valid = 0;
23  ld->corr[i].j1 = -1;
24  ld->corr[i].j2 = -1;
25  ld->corr[i].dist2_j1 = GSL_NAN;
26 }
27 
28 INLINE void ld_set_correspondence(LDP ld, int i, int j1, int j2) {
29  ld->corr[i].valid = 1;
30  ld->corr[i].j1 = j1;
31  ld->corr[i].j2 = j2;
32 }
33 
36 INLINE int ld_next_valid(LDP ld, int i, int dir) {
37  int j;
38  for(j=i+dir;(j<ld->nrays)&&(j>=0)&&!ld_valid_ray(ld,j);j+=dir);
39  return ld_valid_ray(ld,j) ? j : -1;
40 }
41 
42 INLINE int ld_next_valid_up(LDP ld, int i){
43  return ld_next_valid(ld, i, +1);
44 }
45 
46 INLINE int ld_next_valid_down(LDP ld, int i){
47  return ld_next_valid(ld, i, -1);
48 }
49 
50 
51 INLINE int ld_valid_corr(LDP ld, int i) {
52  return ld->corr[i].valid;
53 }
54 
55 #endif
56 
double dist2_j1
Definition: laser_data.h:71
int *restrict valid
Definition: laser_data.h:23
INLINE int ld_next_valid_up(LDP ld, int i)
INLINE int ld_next_valid(LDP ld, int i, int dir)
INLINE int ld_valid_corr(LDP ld, int i)
INLINE void ld_set_correspondence(LDP ld, int i, int j1, int j2)
INLINE int ld_valid_ray(LDP ld, int i)
INLINE int ld_valid_alpha(LDP ld, int i)
#define INLINE
Definition: restrict.h:5
int *restrict alpha_valid
Definition: laser_data.h:30
struct correspondence *restrict corr
Definition: laser_data.h:36
INLINE void ld_set_null_correspondence(LDP ld, int i)
INLINE int ld_next_valid_down(LDP ld, int i)


csm
Author(s): Andrea Censi
autogenerated on Tue May 11 2021 02:18:23