Skip to content

Commit

Permalink
Add fields for LQR lateral control
Browse files Browse the repository at this point in the history
  • Loading branch information
pd0wm committed Jul 24, 2019
1 parent 654860c commit f27249e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
15 changes: 15 additions & 0 deletions car.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ struct CarParams {
lateralTuning :union {
pid @26 :LateralPIDTuning;
indi @27 :LateralINDITuning;
lqr @40 :LateralLQRTuning;
}

steerLimitAlert @28 :Bool;
Expand Down Expand Up @@ -366,6 +367,20 @@ struct CarParams {
actuatorEffectiveness @3 :Float32;
}

struct LateralLQRTuning {
scale @0 :Float32;
ki @1 :Float32;
dcGain @2 :Float32;

# State space system
a @3 :List(Float32);
b @4 :List(Float32);
c @5 :List(Float32);

k @6 :List(Float32); # LQR gain
l @7 :List(Float32); # Kalman gain
}


enum SafetyModel {
# does NOT match board setting
Expand Down
8 changes: 8 additions & 0 deletions log.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@ struct ControlsState @0x97ff69c53601abf1 {
lateralControlState :union {
indiState @52 :LateralINDIState;
pidState @53 :LateralPIDState;
lqrState @55 :LateralLQRState;
}

enum OpenpilotState @0xdbe58b96d2d1ac61 {
Expand Down Expand Up @@ -508,6 +509,13 @@ struct ControlsState @0x97ff69c53601abf1 {
saturated @8 :Bool;
}

struct LateralLQRState {
active @0 :Bool;
steerAngle @1 :Float32;
i @2 :Float32;
output @3 :Float32;
}

}

struct LiveEventData {
Expand Down

0 comments on commit f27249e

Please sign in to comment.