scripts/optimize_tire_model.py
finds the optimal parameters for the Pacejka model to minimize error against experimental data.
The validate_model.py
script plots the trajectory from a given log against the trajectory predicted by the optimized dynamics model.
- The script takes in the filepath of the ROS bag to run as a command line argument.
- The predicted trajectory (green) is plotted if the
-p
flag is specified. It is not plotted by default. - Plots of the heading, yaw rate, and velocity are shown prior to the simulation if the
-s
flag is specified.
Note: These steps assume that ROS 2 is installed.
- Since the script loads a ROS bag that depends on custom message types (
AckermannDriveStamped
,ViconObject
), the script must be run within a ROS workspace with the packages that define these types. First, create a ROS workspace by runningmkdir -p ros_ws/src
. - Navigate to
ros_ws/src
and clone this repository. Then- Clone the
ackermann_msgs
repo by runninggit clone -b ros2 https://github.com/ros-drivers/ackermann_msgs.git
- Clone the
vicon_ros
repo by runninggit clone https://github.com/yambati03/vicon_ros.git
- Clone the
- Build the workspace by running
colcon build --symlink-install
in the top-levelros_ws
directory. Then, source the install directory by running. install/setup.bash
- Then, navigate to
dcsl-ddc/scripts
. Thevalidate_model.py
script can be run using the following command.
python3 validate_model.py /path/to/bag.db3 -p -s