Go to the documentation of this file. 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);
89 if(
p.sigma_theta_deg > 0) {
90 e[2] = gsl_ran_gaussian(
rng,
deg2rad(
p.sigma_theta_deg));
void copy_d(const double *from, int n, double *to)
int any_nan(const double *d, int n)
void sm_debug(const char *msg,...)
int ld_valid_fields(LDP ld)
FILE * open_file_for_writing(const char *filename)
void options_double(struct option *, const char *name, double *p, double def_value, const char *desc)
void sm_set_program_name(const char *name)
const char * friendly_pose(const double *pose)
struct option * options_allocate(int n)
void options_int(struct option *, const char *name, int *p, int def_value, const char *desc)
FILE * open_file_for_reading(const char *filename)
int main(int argc, const char **argv)
void options_print_help(struct option *options, FILE *f)
void sm_error(const char *msg,...)
LDP ld_read_smart(FILE *)
void options_string(struct option *, const char *name, const char **p, const char *def_balue, const char *desc)
int options_parse_args(struct option *ops, int argc, const char *argv[])
void ld_write_as_json(LDP ld, FILE *stream)
void sm_debug_write(int flag)
void options_banner(const char *message)
csm
Author(s): Andrea Censi
autogenerated on Wed Aug 17 2022 02:50:33