A suggested visualization tool for MPC is plotjuggler
Install plotjuggler:
sudo snap install plotjuggler-ros
Start-test:
plotjuggler-ros
Step 1: start the simulator
# define the parameter of the simulator:stack_master/config/<racecar_version>/<racecar_version>_pacejka.yaml
roslaunch stack_master base_system.launch map_name:=f racecar_version:=<racecar_version> sim:=true tire_model:=pacejkafor example
roslaunch stack_master base_system.launch map_name:=f racecar_version:=NUC5 sim:=true tire_model:=pacejkastep 2: start the mpc controller
roslaunch stack_master time_trials.launch ctrl_algo:=STMPCstep 3: open plotjuggler
plotjuggler-ros
# load xml file to visualization from:
<race_stack_folder>/controller/mpc/config/mpc_plot.xmlstep 3: follow the command
Two MPC versions are available, one with a kinematic model, one with a single track, pacejka-tire model. To see the full list of parameters see, for example, NUC5 configs, and to see which of those are dynamically reconfigurable, checkout the source code in the (STMPC) config schema.
- Start the simulator with the desired map and racecar version:
roslaunch stack_master base_system.launch map_name:=f racecar_version:=NUC5 sim:=true tire_model:=pacejka- Start the MPC controller with the time trials launch:
# for single-track mpc
roslaunch stack_master time_trials.launch ctrl_algo:=STMPC or
# for kinematic mpc
roslaunch stack_master time_trials.launch ctrl_algo:=KMPC NOTE: the parameters are implicitly chosen using the racecar_version and the floor in the base_system.launch step.