14 int i;
for(i=1;i<=3;i++)
18 sm_error(
"Could not translate string '%s' to a reference name.\n", s);
23 double pose[3],
double horizon) {
26 int i;
for(i=0;i<ld->
nrays;i++) {
27 if(!ld->
valid[i])
continue;
28 if(ld->
readings[i]>horizon)
continue;
39 bb_min[0] = bb_max[0] = p[0];
40 bb_min[1] = bb_max[1] = p[1];
42 int j=0;
for(j=0;j<2;j++) {
43 bb_min[j] = GSL_MIN(bb_min[j], p[j]);
44 bb_max[j] = GSL_MAX(bb_max[j], p[j]);
61 double offset[3],
ld_reference use_reference,
double horizon) {
69 sm_error(
"Pose %s not set in scan #%d.\n",
80 double this_min[2], this_max[2];
82 int i;
for(i=0;i<2;i++) {
83 bb_min[i] = GSL_MIN(bb_min[i], this_min[i]);
84 bb_max[i] = GSL_MAX(bb_max[i], this_max[i]);
92 switch(use_reference) {
97 sm_error(
"Could not find pose identified by %d.\n", (
int) use_reference);
106 sm_error(
"Required field '%s' not set in laser scan.\n",
115 double horizon,
double connect_threshold) {
116 int last_valid = -1;
int first = 1;
117 int i;
for(i=0;i<ld->
nrays;i++) {
119 draw_info[i].
valid = 0;
122 draw_info[i].
valid = 1;
131 int near =
square(connect_threshold) >
double distance_squared_d(const double a[2], const double b[2])
void transform_d(const double point2d[2], const double pose[3], double result2d[2])
const char * ld_reference_name[4]
const char * ld_reference_to_string(ld_reference r)
void compute_stroke_sequence(LDP ld, struct stroke_sequence *draw_info, double horizon, double connect_threshold)
INLINE int ld_valid_ray(LDP ld, int i)
double * ld_get_reference_pose(LDP ld, ld_reference use_reference)
double *restrict readings
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)
void oplus_d(const double x1[3], const double x2[3], double res[3])
double * ld_get_reference_pose_silent(LDP ld, ld_reference use_reference)
int any_nan(const double *d, int n)
void sm_error(const char *msg,...)
int ld_get_bounding_box(LDP ld, double bb_min[2], double bb_max[2], double pose[3], double horizon)
ld_reference ld_string_to_reference(const char *s)