Finds a feasible centerline, walls, and a signed-distance field from SLAM output
Get track image and info files from Cartographer or some other SLAM tool. The image file should be in pgm format and the info file should be in yaml format. Here is an example track pgm and yaml combination:
image: track.pgm
resolution: 0.050000
origin: [-5.659398, -4.766974, 0.000000]
negate: 0
occupied_thresh: 0.65
free_thresh: 0.196
Clone the repository and run the racetrack-fitting script:
git clone https://github.com/mlab-upenn/racetrack-fitting.git
cd racetrack-fitting
python src/fit_racetrack.py
To control the plots that are displayed, use
python fit_racetrack.py --plot_mode <0, 1, or 2>
0 shows no plots, 1 (default) shows basic plots, and 2 shows all plots
You can specify the input file paths and output directory using the command line:
python fit_racetrack.py --pgm_path <path to track image> --yaml_path <path to track info> --out_dir <path to output directory>
You can change the subsampling period as follows:
python fit_racetrack.py --subsample_period 20
This changes how sparesly the points are sampled from the centerline and wall paths





