33 LDP * ar = (
LDP*) malloc(
sizeof(
LDP)*size);
40 if( ! (*accept)(ld) ) {
50 if(! (ar = (
LDP*) realloc(ar,
sizeof(
LDP)*size)) ) {
51 sm_error(
"Cannot allocate (size=%d)\n", size);
66 int accept = interval_count % interval_interval == 0;
85 distance_interval_xy = interval_xy;
86 distance_interval_th = interval_th;
87 distance_reference = which;
92 if(!this_pose)
return 0;
95 if(distance_count == 1) {
96 copy_d(this_pose, 3, distance_last_pose);
103 if(distance >= distance_interval_xy ||
104 fabs(diff[2]) >= distance_interval_th )
106 copy_d(this_pose, 3, distance_last_pose);
139 if(!isspace(c))
break;
159 char max_line[10000];
160 char * res = fgets(max_line, 10000-2, f);
162 sm_error(
"Could not skip line. \n");
165 fprintf(stderr,
"s");
182 sm_error(
"Invalid laserdata format: '%s'.", line);
LDP ld_from_carmen_string(const char *line)
double norm_d(const double p[2])
int interval_accept(LDP ld)
void distance_accept_reset(ld_reference, double interval_xy, double interval_th)
void copy_d(const double *from, int n, double *to)
LDP ld_read_smart_string(const char *line)
int distance_accept(LDP ld)
int ld_read_all(FILE *file, LDP **array, int *num)
double * ld_get_reference_pose(LDP ld, ld_reference use_reference)
int ld_read_some(FILE *file, LDP **array, int *num, int(*accept)(LDP))
static double distance_last_pose[3]
LDP ld_from_json_stream(FILE *file)
int ld_read_some_scans_distance(FILE *file, LDP **array, int *num, ld_reference which, double d_xy, double d_th)
static ld_reference distance_reference
int ld_read_next_laser_carmen(FILE *, LDP *ld)
static double distance_interval_xy
static int distance_count
LDP ld_read_smart(FILE *f)
static double distance_interval_th
void pose_diff_d(const double pose2[3], const double pose1[3], double res[3])
int ld_read_some_scans(FILE *file, LDP **array, int *num, int interval)
LDP ld_from_json_string(const char *s)
void sm_error(const char *msg,...)
double distance(const gsl_vector *a, const gsl_vector *b)