laser_data.h File Reference
#include <sys/time.h>
#include <stdio.h>
#include "restrict.h"
#include "laser_data_inline.h"
Go to the source code of this file.
Classes |
struct | correspondence |
struct | laser_data |
struct | point2d |
Typedefs |
typedef struct laser_data * | LDP |
Functions |
void | ld_alloc (LDP, int nrays) |
LDP | ld_alloc_new (int nrays) |
void | ld_compute_cartesian (LDP) |
void | ld_compute_orientation (LDP ld, int size_neighbourhood, double sigma) |
void | ld_compute_world_coords (LDP, const double *pose) |
unsigned int | ld_corr_hash (LDP) |
void | ld_create_jump_tables (LDP) |
void | ld_dealloc (LDP) |
void | ld_free (LDP) |
LDP | ld_from_carmen_string (const char *line) |
int | ld_num_valid_correspondences (LDP) |
int | ld_read_all (FILE *file, LDP **array, int *num) |
int | ld_read_next_laser_carmen (FILE *, LDP *ld) |
LDP | ld_read_smart (FILE *) |
LDP | ld_read_smart_string (const char *) |
int | ld_read_some_scans (FILE *file, LDP **array, int *num, int interval) |
void | ld_simple_clustering (LDP ld, double threshold) |
int | ld_valid_fields (LDP) |
void | ld_write_as_carmen (LDP ld, FILE *stream) |
void | ld_write_format (LDP ld, FILE *stream, const char *out_format) |
void | possible_interval (const double *p_i_w, LDP laser_sens, double max_angular_correction_deg, double max_linear_correction, int *from, int *to, int *start_cell) |
Typedef Documentation
Function Documentation
void ld_alloc |
( |
LDP |
, |
|
|
int |
nrays | |
|
) |
| | |
This allocs the fields in the given structure. Use ld_alloc_new(), not this.
LDP ld_alloc_new |
( |
int |
nrays |
) |
|
This returns a new structure, with all fields initialized
void ld_compute_cartesian |
( |
LDP |
|
) |
|
Fills the x,y fields in "points" by transforming (theta, reading) to cartesian
void ld_compute_orientation |
( |
LDP |
ld, |
|
|
int |
size_neighbourhood, |
|
|
double |
sigma | |
|
) |
| | |
A cool orientation estimation algorithm. Needs cluster.
void ld_compute_world_coords |
( |
LDP |
, |
|
|
const double * |
pose | |
|
) |
| | |
Computes the "points_w" coordinates by roto-translating "points"
unsigned int ld_corr_hash |
( |
LDP |
|
) |
|
Computes an hash of the correspondences
void ld_create_jump_tables |
( |
LDP |
|
) |
|
Fills the fields: *up_bigger, *up_smaller, *down_bigger, *down_smaller.
This does NOT free the pointer. Don't use -- use ld_alloc_new()/ld_free() instead.
This DOES free() the pointer
LDP ld_from_carmen_string |
( |
const char * |
line |
) |
|
Read laser data from a Carmen-formatted line
int ld_num_valid_correspondences |
( |
LDP |
|
) |
|
Returns the number of valid correspondences.
int ld_read_all |
( |
FILE * |
file, |
|
|
LDP ** |
array, |
|
|
int * |
num | |
|
) |
| | |
Reads all the scans it can find.
int ld_read_next_laser_carmen |
( |
FILE * |
, |
|
|
LDP * |
ld | |
|
) |
| | |
Read next FLASER line in file (initializes ld). Returns 0 on failure. If the file is EOF, it returns 1 and sets ld to 0. You probably want to use the ld_read_smart() function.
LDP ld_read_smart |
( |
FILE * |
|
) |
|
Tries to read a laser scan from file. If error or EOF, it returns 0. Whitespace is skipped. If first valid char is '{', it tries to read it as JSON. If next char is 'F' (first character of "FLASER"), it tries to read in Carmen format. Else, 0 is returned.
LDP ld_read_smart_string |
( |
const char * |
|
) |
|
Tries to read a laser scan from a string.
int ld_read_some_scans |
( |
FILE * |
file, |
|
|
LDP ** |
array, |
|
|
int * |
num, |
|
|
int |
interval | |
|
) |
| | |
Read a scan every interval (1=all)
void ld_simple_clustering |
( |
LDP |
ld, |
|
|
double |
threshold | |
|
) |
| | |
A simple clustering algorithm. Sets the `cluster' field in the structure.
int ld_valid_fields |
( |
LDP |
|
) |
|
Do an extensive sanity check about the data contained in the structure.
void ld_write_as_carmen |
( |
LDP |
ld, |
|
|
FILE * |
stream | |
|
) |
| | |
Write a scan in carmen format
void ld_write_format |
( |
LDP |
ld, |
|
|
FILE * |
stream, |
|
|
const char * |
out_format | |
|
) |
| | |
Write a scan according to out_format = {"carmen", "json"}
void possible_interval |
( |
const double * |
p_i_w, |
|
|
LDP |
laser_sens, |
|
|
double |
max_angular_correction_deg, |
|
|
double |
max_linear_correction, |
|
|
int * |
from, |
|
|
int * |
to, |
|
|
int * |
start_cell | |
|
) |
| | |