1 #include <gsl/gsl_rng.h> 2 #include <gsl/gsl_randist.h> 3 #include <gsl/gsl_math.h> 8 #include "../csm/csm_all.h" 23 "A simple program for adding slip to odometry \n\n" 24 "The 'odometry' field is set to 'true_pose' + noise.\n" 25 "If 'true_pose' is not available, then the 'odometry' \n" 26 "field is set to 'odometry' + noise.\n\n" 27 "Note: this program does *not* simulate the effect of \n" 28 "slip or odometry error in a realistic way; each scan \n" 29 "in the file is considered separately, the error does \n" 30 "not depend on the traveled distance, etc.\n\n";
32 int main(
int argc,
const char ** argv) {
41 "Std deviation of gaussian noise for theta (deg) (disabled if 0)");
43 "Std deviation of gaussian noise for x,y (disabled if 0)");
45 "Seed for random number generator (if 0, use GSL_RNG_SEED env. variable).");
60 gsl_rng *
rng = gsl_rng_alloc (gsl_rng_ranlxs0);
62 gsl_rng_set(rng, (
unsigned int) p.
seed);
75 sm_error(
"Invalid laser data (#%d in file)\n", count);
82 double e[3] = {0,0,0};
85 e[0] = gsl_ran_gaussian(rng, p.
sigma_xy);
86 e[1] = gsl_ran_gaussian(rng, p.
sigma_xy);
void options_banner(const char *message)
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 main(int argc, const char **argv)
const char * friendly_pose(const double *pose)
void options_double(struct option *, const char *name, double *p, double def_value, const char *desc)
int ld_valid_fields(LDP ld)
FILE * open_file_for_writing(const char *filename)
LDP ld_read_smart(FILE *)
struct option * options_allocate(int n)
void options_int(struct option *, const char *name, int *p, int def_value, const char *desc)
void sm_debug_write(int flag)
FILE * open_file_for_reading(const char *filename)
void options_print_help(struct option *options, FILE *f)
void sm_debug(const char *msg,...)
int any_nan(const double *d, int n)
void options_string(struct option *, const char *name, const char **p, const char *def_balue, const char *desc)
void sm_error(const char *msg,...)
int options_parse_args(struct option *ops, int argc, const char *argv[])