Assumptions :
- No tire slip
- 0 steer angle at rear wheel
class VehicleModel(object): L = 0.5 def __init__(self, x=0.0, y=0.0, yaw=0.0, v=0.0): self.x = x self.y = y self.yaw = yaw self.v = v self.max_steering = np.radians(30) def update(self, steer, a=0): steer = np.clip(steer, -self.max_steering, self.max_steering) self.x += self.v * np.cos(self.yaw) * dt self.y += self.v * np.sin(self.yaw) * dt self.yaw += self.v / self.L * np.tan(steer) * dt self.yaw = self.yaw % (2.0 * np.pi) self.v += a * dt