19 int main(
int argc,
const char*argv[]) {
30 "File for journaling -- if left empty, journal not open.");
31 options_int(ops,
"algo", &
p.
algo, 0,
"Which algorithm to use (0:icp 1:gpm-stripped) ");
38 fprintf(stderr,
"\n\nUsage:\n");
46 if(!file_in)
return -1;
48 if(!file_out)
return -1;
59 if(!file_out_stats)
return -1;
65 sm_error(
"Could not read first scan.\n");
69 sm_error(
"Invalid laser data in first scan.\n");
83 sm_error(
"Invalid laser data in (#%d in file).\n", count);
93 double ominus_laser[3], temp[3];
95 oplus_d(ominus_laser, odometry, temp);
101 sm_icp(¶ms, &result);
break;
103 sm_gpm(¶ms, &result);
break;
119 fputs(
"\n", file_out_stats);
123 ld_free(laser_ref); laser_ref = laser_sens;
void sm_set_program_name(const char *name)
int main(int argc, const char *argv[])
void sm_icp(struct sm_params *input, struct sm_result *output)
void ld_write_as_json(LDP ld, FILE *stream)
void copy_d(const double *from, int n, double *to)
const char * file_out_stats
int ld_valid_fields(LDP ld)
FILE * open_file_for_writing(const char *filename)
LDP ld_read_smart(FILE *)
JO result_to_json(struct sm_params *p, struct sm_result *r)
struct option * options_allocate(int n)
void options_int(struct option *, const char *name, int *p, int def_value, const char *desc)
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 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,...)
void sm_gpm(struct sm_params *input, struct sm_result *output)
void jj_set_stream(FILE *f)
int options_parse_args(struct option *ops, int argc, const char *argv[])
void sm_options(struct sm_params *p, struct option *ops)