icp_debug.c
Go to the documentation of this file.
1 #include <string.h>
2 #include "icp.h"
3 
5  LDP laser_sens = params->laser_sens;
8  struct correspondence c1[laser_sens->nrays];
9  struct correspondence * c2 = laser_sens->corr;
10  memcpy(c1, c2, sizeof(struct correspondence) * laser_sens->nrays);
11  long hash1 = ld_corr_hash(laser_sens);
12  find_correspondences(params);
13  long hash2 = ld_corr_hash(laser_sens);
14  if(hash1 != hash2) {
15  sm_error("find_correspondences_tricks might be buggy\n");
16  int i = 0; for(i=0;i<laser_sens->nrays;i++) {
17  if( (c1[i].valid != c2[i].valid) ||
18  (c1[i].j1 != c2[i].j1) || (c1[i].j2 != c2[i].j2) ) {
19  sm_error("\t tricks: c1[%d].valid = %d j1 = %d j2 = %d dist2_j1 = %f\n",
20  i, c1[i].valid, c1[i].j1, c1[i].j2, c1[i].dist2_j1);
21  sm_error("\tno tricks: c2[%d].valid = %d j1 = %d j2 = %d dist2_j1 = %f\n",
22  i, c2[i].valid, c2[i].j1, c2[i].j2, c2[i].dist2_j1);
23  }
24  }
25  if(1) exit(-1);
26  }
27 }
double dist2_j1
Definition: laser_data.h:71
void debug_correspondences(struct sm_params *params)
Definition: icp_debug.c:4
void find_correspondences(struct sm_params *params)
Definition: icp_corr_dumb.c:30
LDP laser_sens
Definition: algos.h:16
unsigned int ld_corr_hash(LDP ld)
Definition: laser_data.c:267
void find_correspondences_tricks(struct sm_params *params)
void sm_error(const char *msg,...)
Definition: logging.c:49


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