A python library for the Kinematic Bicycle model. The model can be defined with the following state-space representation,
where
At initialisation
:param wheelbase: (float) vehicle's wheelbase [m]
:param max_steer: (float) vehicle's steering limits [rad]
:param delta_time: (float) discrete time period [s]
At every time step
:param x: (float) vehicle's x-coordinate [m]
:param y: (float) vehicle's y-coordinate [m]
:param yaw: (float) vehicle's heading [rad]
:param velocity: (float) vehicle's velocity in the x-axis [m/s]
:param acceleration: (float) vehicle's accleration [m/s^2]
:param steering_angle: (float) vehicle's steering angle [rad]
:return x: (float) vehicle's x-coordinate [m]
:return y: (float) vehicle's y-coordinate [m]
:return yaw: (float) vehicle's heading [rad]
:return velocity: (float) vehicle's velocity in the x-axis [m/s]
:return steering_angle: (float) vehicle's steering angle [rad]
:return angular_velocity: (float) vehicle's angular velocity [rad/s]
Just like with all other bicycle models, this model is a discrete model and loses its accuracy when the time step is set too large or the vehicle is made to travel at unreasonably high speeds. Usually, the FPS of the simulation should be set to the highest possible value for the greatest accuracy. However, for rendering high-quality GIFs, 50 FPS is found to be most optimal. See the GIF89a specification.
The model itself has zero dependencies and can run its fastest on vanilla python. However, to support type-hinting, Python 3.10 or greater is required.
Recursively git clone the repository
git clone --recursive https://github.com/RI-SE/PreMAT-Vehicle-Models.git
Install the requirements
pip install -r requirements.txt
Play the animation
python animate.py
Though our implementation is titled the Kinematic Bicycle Model
, it does take into account some forward friction. This was never intended to improve the accuracy of the model. Instead, it provides a more intuitive API by removing the need to constantly control the input throttle. However, that is where the differences end. You can read about the bicycle model in full detail by Theers et al., here.