-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBikeModel.h
32 lines (22 loc) · 1023 Bytes
/
BikeModel.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//
// Created by Misha on 12/24/2020.
// Bike model for linearized second order motion in phi and delta with constant velocity
// Derived from the work of Schwarm and Meijaard
//
#ifndef AUTOCYCLE_STABILITY_FIRMWARE_BIKEMODEL_H
#define AUTOCYCLE_STABILITY_FIRMWARE_BIKEMODEL_H
#include <BasicLinearAlgebra.h>
class BikeModel {
public:
BikeModel();
BLA::Matrix<4, 4> dynamicsMatrix(float v, bool free_running);
BLA::Matrix<4, 2> controlsMatrix(float v, bool free_running);
BLA::Matrix<4, 4> kalmanTransitionMatrix(float v, float dt, bool free_running);
BLA::Matrix<4, 2> kalmanControlsMatrix(float v, float dt, bool free_running);
BLA::Matrix<2, 2> M{}; // Equivalent mass matrix
BLA::Matrix<2, 2> M_inv{};
BLA::Matrix<2, 2> C1{}; // Linear-velocity equivalent damping matrix
BLA::Matrix<2, 2> K0{}; // Constant equivalent stiffness matrix
BLA::Matrix<2, 2> K2{}; // Velocity-squared equivalent stiffness matrix
};
#endif //AUTOCYCLE_STABILITY_FIRMWARE_BIKEMODEL_H