6 #include <linux/limits.h> 10 #include <cairo-pdf.h> 14 #include "../csm/csm_all.h" 15 #include "../csm/laser_data_drawing.h" 16 #include "../csm/laser_data_cairo.h" 48 "This program draws laser scans.\n" 50 "IMPORTANT: it is likely you have to set one or more parameters. \n" 51 " the default parameters are OK to draw very long laser logs\n\n";
53 int main(
int argc,
const char* argv[]) {
76 options_string(ops,
"use", &p.
use,
"estimate",
"One in 'odometry','estimate','true_pose'");
84 sm_error(
"Could not parse arguments.\n");
100 "Use one in 'odometry','estimate','true_pose'.\n", p.
use);
113 if(!input_file)
return 0;
115 LDP*scans;
int nscans;
128 sm_debug(
"Read map: %d scans in total.\n", nscans);
131 double bb_min[2], bb_max[2];
132 double offset[3] = {0,0,0};
141 sm_debug(
"Bounding box: %f %f -- %f %f.\n", bb_min[0], bb_min[1],
142 bb_max[0], bb_max[1]);
148 cairo_surface_t *surface;
152 bb_min, bb_max, &surface, &cr))
return 0;
162 cairo_set_source_rgb(cr, 0.3, 0.0, 1.0);
172 int k;
for(k=0;k<nscans;k++) {
178 double world_pose[3];
179 oplus_d(offset, pose, world_pose);
187 cairo_show_page (cr);
190 cairo_surface_destroy (surface);
void options_banner(const char *message)
void sm_set_program_name(const char *name)
ld_reference use_reference
void ls_add_options(line_style *ls, struct option *ops, const char *prefix, const char *desc_prefix)
void cr_lda_draw_pose_path(cairo_t *cr, LDP *scans, int nscans, ld_reference use_reference)
void lds_add_options(ld_style *lds, struct option *ops, const char *prefix, const char *desc_prefix)
int main(int argc, const char *argv[])
const char * output_filename
int create_pdf_surface(const char *file, int max_width_points, int max_height_points, double bb_min[2], double bb_max[2], cairo_surface_t **surface_p, cairo_t **cr)
void options_double(struct option *, const char *name, double *p, double def_value, const char *desc)
void cr_set_reference(cairo_t *cr, double *pose)
double * ld_get_reference_pose(LDP ld, ld_reference use_reference)
void cr_ld_draw(cairo_t *cr, LDP ld, ld_style *p)
struct option * options_allocate(int n)
void lda_get_bounding_box(LDP *lda, int nld, double bb_min[2], double bb_max[2], double offset[3], ld_reference use_reference, double horizon)
FILE * open_file_for_reading(const char *filename)
void oplus_d(const double x1[3], const double x2[3], double res[3])
int log2pdf(log2pdf_params *p)
void options_print_help(struct option *options, FILE *f)
void ls_set_defaults(line_style *ls)
void sm_debug(const char *msg,...)
char * my_strdup(const char *s)
void options_string(struct option *, const char *name, const char **p, const char *def_balue, const char *desc)
const char * input_filename
void cr_set_style(cairo_t *cr, line_style *ls)
int ld_read_some_scans_distance(FILE *file, LDP **array, int *num, ld_reference which, double d_xy, double d_th)
void sm_error(const char *msg,...)
void lds_set_defaults(ld_style *lds)
int options_parse_args(struct option *ops, int argc, const char *argv[])
ld_reference ld_string_to_reference(const char *s)