4 #include "../csm/csm_all.h" 17 int main(
int argc,
const char*argv[]) {
29 fprintf(stderr,
"\n\nUsage:\n");
37 LDP *lds;
int lds_size;
39 sm_error(
"Cannot read all laser scans.\n");
43 sm_debug(
"Read %d scans.\n", lds_size);
46 int num_matchings = 0;
47 int num_iterations = 0;
48 clock_t start = clock();
51 for(i=0;i<lds_size-1;i++) {
57 double ominus_laser[3], temp[3];
59 oplus_d(ominus_laser, odometry, temp);
70 clock_t end = clock();
71 float seconds = (end-start)/((
float)CLOCKS_PER_SEC);
74 printf(
"sm3: CPU time = %f (seconds) (start=%d end=%d)\n", seconds,(
int)start,(
int)end);
75 printf(
"sm3: Total number of matchings = %d\n", num_matchings);
76 printf(
"sm3: Total number of iterations = %d\n", num_iterations);
77 printf(
"sm3: Avg. iterations per matching = %f\n", num_iterations/((
float)num_matchings));
78 printf(
"sm3: Avg. seconds per matching = %f\n", seconds/num_matchings);
79 printf(
"sm3: that is, %d matchings per second\n", (
int)floor(num_matchings/seconds));
80 printf(
"sm3: Avg. seconds per iteration = %f (note: very imprecise)\n", seconds/num_iterations);
82 printf(
"sm3: Avg. comparisons per ray per iteration = %f \n",
void sm_set_program_name(const char *name)
void sm_icp(struct sm_params *input, struct sm_result *output)
int main(int argc, const char *argv[])
int ld_read_all(FILE *file, LDP **array, int *num)
struct option * options_allocate(int n)
void sm_options(struct sm_params *p, struct option *ops)
const char * input_filename
FILE * open_file_for_reading(const char *filename)
void oplus_d(const double x1[3], const double x2[3], double res[3])
void options_print_help(struct option *options, FILE *f)
void ominus_d(const double x[3], double res[3])
void sm_debug(const char *msg,...)
void options_string(struct option *, const char *name, const char **p, const char *def_balue, const char *desc)
void pose_diff_d(const double pose2[3], const double pose1[3], double res[3])
void sm_error(const char *msg,...)
int options_parse_args(struct option *ops, int argc, const char *argv[])