4 #include "../csm/csm_all.h" 5 #include "../csm/laser_data_drawing.h" 12 int main(
int argc,
const char * argv[]) {
15 const char *in_filename;
16 const char *ref_filename;
17 const char *out_filename;
22 options_string(ops,
"in", &in_filename,
"stdin",
"scan matching log");
24 options_string(ops,
"out", &out_filename,
"stdout",
"output file");
26 options_string(ops,
"ref_field", &ref_field_string,
"estimate",
"What field to find in ref.");
27 options_string(ops,
"out_field", &out_field_string,
"true_pose",
"What field to copy to.");
30 fprintf(stderr,
" This program works on two logs: A and B. " 31 "For each scan in A, the program searches for the scan in B having the same timestamp. " 32 "Then, the true_pose field in B is copied to the scan form A, and it is written to the output.\n");
45 if(!in_stream || !ref_stream || !out_stream)
return -1;
57 copy_d(ref_pose, 3, out_pose);
59 fputs(
"\n", out_stream);
67 if(feof(ref_stream)) {
68 sm_error(
"..because ref stream has ended.\n");
83 return (ld1->
tv.tv_sec == ld2->
tv.tv_sec) &&
84 (ld1->
tv.tv_usec == ld2->
tv.tv_usec);
89 sprintf(
buf,
"LD, tv=%d,%d", (
int) ld->
tv.tv_sec, (
int) ld->
tv.tv_usec);
void sm_set_program_name(const char *name)
void ld_write_as_json(LDP ld, FILE *stream)
void copy_d(const double *from, int n, double *to)
int same_scan(LDP ld1, LDP ld2)
FILE * open_file_for_writing(const char *filename)
LDP ld_read_smart(FILE *)
double * ld_get_reference_pose(LDP ld, ld_reference use_reference)
struct option * options_allocate(int n)
int main(int argc, const char *argv[])
FILE * open_file_for_reading(const char *filename)
void options_print_help(struct option *options, FILE *f)
double * ld_get_reference_pose_silent(LDP ld, ld_reference use_reference)
void options_string(struct option *, const char *name, const char **p, const char *def_balue, const char *desc)
const char * short_desc(LDP ld)
void sm_error(const char *msg,...)
int options_parse_args(struct option *ops, int argc, const char *argv[])
ld_reference ld_string_to_reference(const char *s)