5 #include "../csm/csm_all.h" 9 int main(
int argc,
const char*argv[]) {
17 options_double(ops,
"epsilon", &epsilon, 0.0001,
"minimum difference between rays to be used");
29 LDP laser_ref=0, laser_sens;
32 int num_discarded = 0;
40 sm_error(
"Invalid laser data (#%d in file)\n", count);
46 laser_ref = laser_sens;
53 sm_debug(
"Ignoring scan #%d, too similar to #%d.\n", count, ref_index);
58 laser_ref = laser_sens;
63 if(laser_ref)
ld_free(laser_ref);
65 sm_info(
"# epsilon: %f m\n", epsilon);
66 sm_info(
"# scans: %d\n", count);
68 sm_info(
"# invalid: %d\n", num_invalid);
69 sm_info(
"# discarded: %d (%d%%)\n", num_discarded, num_discarded * 100 / count);
79 for(i=0;i<ld1->
nrays;i++) {
void sm_set_program_name(const char *name)
void ld_write_as_json(LDP ld, FILE *stream)
INLINE int ld_valid_ray(LDP ld, int i)
void options_double(struct option *, const char *name, double *p, double def_value, const char *desc)
int ld_valid_fields(LDP ld)
LDP ld_read_smart(FILE *)
int ld_equal_readings(LDP ld1, LDP ld2, double epsilon)
int main(int argc, const char *argv[])
double *restrict readings
struct option * options_allocate(int n)
void sm_debug_write(int flag)
void options_print_help(struct option *options, FILE *f)
void sm_debug(const char *msg,...)
void sm_info(const char *msg,...)
void sm_error(const char *msg,...)
int options_parse_args(struct option *ops, int argc, const char *argv[])