This commit is contained in:
firestarsdog
2026-07-08 14:04:50 -04:00
parent 3aa2801ce7
commit 30245e7d34
94 changed files with 1428 additions and 1402 deletions
Binary file not shown.
+1
View File
@@ -589,6 +589,7 @@ inline static std::unordered_map<std::string, ParamKeyAttributes> keys = {
{"SteerOffsetStock", {PERSISTENT, FLOAT, "0.0", "0.0", 3}},
{"SteerRatio", {PERSISTENT, FLOAT, "0.0", "0.0", 3}},
{"SteerRatioStock", {PERSISTENT, FLOAT, "0.0", "0.0", 3}},
{"EnableTorqueBarWidget", {PERSISTENT, BOOL, "1", "0", 0}},
{"StockConfidenceBallWidget", {PERSISTENT, BOOL, "0", "0", 0}},
{"StockDongleId", {PERSISTENT, STRING, "", ""}},
{"StopAccel", {PERSISTENT, FLOAT, "0.0", "0.0", 3}},
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -1,2 +1,2 @@
extern const uint8_t gitversion[19];
const uint8_t gitversion[19] = "DEV-cb82059d-DEBUG";
const uint8_t gitversion[19] = "DEV-231eb68f-DEBUG";
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -1 +1 @@
DEV-cb82059d-DEBUG
DEV-231eb68f-DEBUG
+342 -342
View File
@@ -45,326 +45,326 @@ const static double MAHA_THRESH_31 = 3.8414588206941227;
* *
* This file is part of 'ekf' *
******************************************************************************/
void err_fun(double *nom_x, double *delta_x, double *out_6125726627663246664) {
out_6125726627663246664[0] = delta_x[0] + nom_x[0];
out_6125726627663246664[1] = delta_x[1] + nom_x[1];
out_6125726627663246664[2] = delta_x[2] + nom_x[2];
out_6125726627663246664[3] = delta_x[3] + nom_x[3];
out_6125726627663246664[4] = delta_x[4] + nom_x[4];
out_6125726627663246664[5] = delta_x[5] + nom_x[5];
out_6125726627663246664[6] = delta_x[6] + nom_x[6];
out_6125726627663246664[7] = delta_x[7] + nom_x[7];
out_6125726627663246664[8] = delta_x[8] + nom_x[8];
void err_fun(double *nom_x, double *delta_x, double *out_1393219424364542669) {
out_1393219424364542669[0] = delta_x[0] + nom_x[0];
out_1393219424364542669[1] = delta_x[1] + nom_x[1];
out_1393219424364542669[2] = delta_x[2] + nom_x[2];
out_1393219424364542669[3] = delta_x[3] + nom_x[3];
out_1393219424364542669[4] = delta_x[4] + nom_x[4];
out_1393219424364542669[5] = delta_x[5] + nom_x[5];
out_1393219424364542669[6] = delta_x[6] + nom_x[6];
out_1393219424364542669[7] = delta_x[7] + nom_x[7];
out_1393219424364542669[8] = delta_x[8] + nom_x[8];
}
void inv_err_fun(double *nom_x, double *true_x, double *out_87606233557452672) {
out_87606233557452672[0] = -nom_x[0] + true_x[0];
out_87606233557452672[1] = -nom_x[1] + true_x[1];
out_87606233557452672[2] = -nom_x[2] + true_x[2];
out_87606233557452672[3] = -nom_x[3] + true_x[3];
out_87606233557452672[4] = -nom_x[4] + true_x[4];
out_87606233557452672[5] = -nom_x[5] + true_x[5];
out_87606233557452672[6] = -nom_x[6] + true_x[6];
out_87606233557452672[7] = -nom_x[7] + true_x[7];
out_87606233557452672[8] = -nom_x[8] + true_x[8];
void inv_err_fun(double *nom_x, double *true_x, double *out_8544281472794776121) {
out_8544281472794776121[0] = -nom_x[0] + true_x[0];
out_8544281472794776121[1] = -nom_x[1] + true_x[1];
out_8544281472794776121[2] = -nom_x[2] + true_x[2];
out_8544281472794776121[3] = -nom_x[3] + true_x[3];
out_8544281472794776121[4] = -nom_x[4] + true_x[4];
out_8544281472794776121[5] = -nom_x[5] + true_x[5];
out_8544281472794776121[6] = -nom_x[6] + true_x[6];
out_8544281472794776121[7] = -nom_x[7] + true_x[7];
out_8544281472794776121[8] = -nom_x[8] + true_x[8];
}
void H_mod_fun(double *state, double *out_1571740516032572076) {
out_1571740516032572076[0] = 1.0;
out_1571740516032572076[1] = 0.0;
out_1571740516032572076[2] = 0.0;
out_1571740516032572076[3] = 0.0;
out_1571740516032572076[4] = 0.0;
out_1571740516032572076[5] = 0.0;
out_1571740516032572076[6] = 0.0;
out_1571740516032572076[7] = 0.0;
out_1571740516032572076[8] = 0.0;
out_1571740516032572076[9] = 0.0;
out_1571740516032572076[10] = 1.0;
out_1571740516032572076[11] = 0.0;
out_1571740516032572076[12] = 0.0;
out_1571740516032572076[13] = 0.0;
out_1571740516032572076[14] = 0.0;
out_1571740516032572076[15] = 0.0;
out_1571740516032572076[16] = 0.0;
out_1571740516032572076[17] = 0.0;
out_1571740516032572076[18] = 0.0;
out_1571740516032572076[19] = 0.0;
out_1571740516032572076[20] = 1.0;
out_1571740516032572076[21] = 0.0;
out_1571740516032572076[22] = 0.0;
out_1571740516032572076[23] = 0.0;
out_1571740516032572076[24] = 0.0;
out_1571740516032572076[25] = 0.0;
out_1571740516032572076[26] = 0.0;
out_1571740516032572076[27] = 0.0;
out_1571740516032572076[28] = 0.0;
out_1571740516032572076[29] = 0.0;
out_1571740516032572076[30] = 1.0;
out_1571740516032572076[31] = 0.0;
out_1571740516032572076[32] = 0.0;
out_1571740516032572076[33] = 0.0;
out_1571740516032572076[34] = 0.0;
out_1571740516032572076[35] = 0.0;
out_1571740516032572076[36] = 0.0;
out_1571740516032572076[37] = 0.0;
out_1571740516032572076[38] = 0.0;
out_1571740516032572076[39] = 0.0;
out_1571740516032572076[40] = 1.0;
out_1571740516032572076[41] = 0.0;
out_1571740516032572076[42] = 0.0;
out_1571740516032572076[43] = 0.0;
out_1571740516032572076[44] = 0.0;
out_1571740516032572076[45] = 0.0;
out_1571740516032572076[46] = 0.0;
out_1571740516032572076[47] = 0.0;
out_1571740516032572076[48] = 0.0;
out_1571740516032572076[49] = 0.0;
out_1571740516032572076[50] = 1.0;
out_1571740516032572076[51] = 0.0;
out_1571740516032572076[52] = 0.0;
out_1571740516032572076[53] = 0.0;
out_1571740516032572076[54] = 0.0;
out_1571740516032572076[55] = 0.0;
out_1571740516032572076[56] = 0.0;
out_1571740516032572076[57] = 0.0;
out_1571740516032572076[58] = 0.0;
out_1571740516032572076[59] = 0.0;
out_1571740516032572076[60] = 1.0;
out_1571740516032572076[61] = 0.0;
out_1571740516032572076[62] = 0.0;
out_1571740516032572076[63] = 0.0;
out_1571740516032572076[64] = 0.0;
out_1571740516032572076[65] = 0.0;
out_1571740516032572076[66] = 0.0;
out_1571740516032572076[67] = 0.0;
out_1571740516032572076[68] = 0.0;
out_1571740516032572076[69] = 0.0;
out_1571740516032572076[70] = 1.0;
out_1571740516032572076[71] = 0.0;
out_1571740516032572076[72] = 0.0;
out_1571740516032572076[73] = 0.0;
out_1571740516032572076[74] = 0.0;
out_1571740516032572076[75] = 0.0;
out_1571740516032572076[76] = 0.0;
out_1571740516032572076[77] = 0.0;
out_1571740516032572076[78] = 0.0;
out_1571740516032572076[79] = 0.0;
out_1571740516032572076[80] = 1.0;
void H_mod_fun(double *state, double *out_542719001883324995) {
out_542719001883324995[0] = 1.0;
out_542719001883324995[1] = 0.0;
out_542719001883324995[2] = 0.0;
out_542719001883324995[3] = 0.0;
out_542719001883324995[4] = 0.0;
out_542719001883324995[5] = 0.0;
out_542719001883324995[6] = 0.0;
out_542719001883324995[7] = 0.0;
out_542719001883324995[8] = 0.0;
out_542719001883324995[9] = 0.0;
out_542719001883324995[10] = 1.0;
out_542719001883324995[11] = 0.0;
out_542719001883324995[12] = 0.0;
out_542719001883324995[13] = 0.0;
out_542719001883324995[14] = 0.0;
out_542719001883324995[15] = 0.0;
out_542719001883324995[16] = 0.0;
out_542719001883324995[17] = 0.0;
out_542719001883324995[18] = 0.0;
out_542719001883324995[19] = 0.0;
out_542719001883324995[20] = 1.0;
out_542719001883324995[21] = 0.0;
out_542719001883324995[22] = 0.0;
out_542719001883324995[23] = 0.0;
out_542719001883324995[24] = 0.0;
out_542719001883324995[25] = 0.0;
out_542719001883324995[26] = 0.0;
out_542719001883324995[27] = 0.0;
out_542719001883324995[28] = 0.0;
out_542719001883324995[29] = 0.0;
out_542719001883324995[30] = 1.0;
out_542719001883324995[31] = 0.0;
out_542719001883324995[32] = 0.0;
out_542719001883324995[33] = 0.0;
out_542719001883324995[34] = 0.0;
out_542719001883324995[35] = 0.0;
out_542719001883324995[36] = 0.0;
out_542719001883324995[37] = 0.0;
out_542719001883324995[38] = 0.0;
out_542719001883324995[39] = 0.0;
out_542719001883324995[40] = 1.0;
out_542719001883324995[41] = 0.0;
out_542719001883324995[42] = 0.0;
out_542719001883324995[43] = 0.0;
out_542719001883324995[44] = 0.0;
out_542719001883324995[45] = 0.0;
out_542719001883324995[46] = 0.0;
out_542719001883324995[47] = 0.0;
out_542719001883324995[48] = 0.0;
out_542719001883324995[49] = 0.0;
out_542719001883324995[50] = 1.0;
out_542719001883324995[51] = 0.0;
out_542719001883324995[52] = 0.0;
out_542719001883324995[53] = 0.0;
out_542719001883324995[54] = 0.0;
out_542719001883324995[55] = 0.0;
out_542719001883324995[56] = 0.0;
out_542719001883324995[57] = 0.0;
out_542719001883324995[58] = 0.0;
out_542719001883324995[59] = 0.0;
out_542719001883324995[60] = 1.0;
out_542719001883324995[61] = 0.0;
out_542719001883324995[62] = 0.0;
out_542719001883324995[63] = 0.0;
out_542719001883324995[64] = 0.0;
out_542719001883324995[65] = 0.0;
out_542719001883324995[66] = 0.0;
out_542719001883324995[67] = 0.0;
out_542719001883324995[68] = 0.0;
out_542719001883324995[69] = 0.0;
out_542719001883324995[70] = 1.0;
out_542719001883324995[71] = 0.0;
out_542719001883324995[72] = 0.0;
out_542719001883324995[73] = 0.0;
out_542719001883324995[74] = 0.0;
out_542719001883324995[75] = 0.0;
out_542719001883324995[76] = 0.0;
out_542719001883324995[77] = 0.0;
out_542719001883324995[78] = 0.0;
out_542719001883324995[79] = 0.0;
out_542719001883324995[80] = 1.0;
}
void f_fun(double *state, double dt, double *out_7904413896065989389) {
out_7904413896065989389[0] = state[0];
out_7904413896065989389[1] = state[1];
out_7904413896065989389[2] = state[2];
out_7904413896065989389[3] = state[3];
out_7904413896065989389[4] = state[4];
out_7904413896065989389[5] = dt*((-state[4] + (-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/(mass*state[4]))*state[6] - 9.8100000000000005*state[8] + stiffness_front*(-state[2] - state[3] + state[7])*state[0]/(mass*state[1]) + (-stiffness_front*state[0] - stiffness_rear*state[0])*state[5]/(mass*state[4])) + state[5];
out_7904413896065989389[6] = dt*(center_to_front*stiffness_front*(-state[2] - state[3] + state[7])*state[0]/(rotational_inertia*state[1]) + (-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])*state[5]/(rotational_inertia*state[4]) + (-pow(center_to_front, 2)*stiffness_front*state[0] - pow(center_to_rear, 2)*stiffness_rear*state[0])*state[6]/(rotational_inertia*state[4])) + state[6];
out_7904413896065989389[7] = state[7];
out_7904413896065989389[8] = state[8];
void f_fun(double *state, double dt, double *out_9203753821438188332) {
out_9203753821438188332[0] = state[0];
out_9203753821438188332[1] = state[1];
out_9203753821438188332[2] = state[2];
out_9203753821438188332[3] = state[3];
out_9203753821438188332[4] = state[4];
out_9203753821438188332[5] = dt*((-state[4] + (-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/(mass*state[4]))*state[6] - 9.8100000000000005*state[8] + stiffness_front*(-state[2] - state[3] + state[7])*state[0]/(mass*state[1]) + (-stiffness_front*state[0] - stiffness_rear*state[0])*state[5]/(mass*state[4])) + state[5];
out_9203753821438188332[6] = dt*(center_to_front*stiffness_front*(-state[2] - state[3] + state[7])*state[0]/(rotational_inertia*state[1]) + (-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])*state[5]/(rotational_inertia*state[4]) + (-pow(center_to_front, 2)*stiffness_front*state[0] - pow(center_to_rear, 2)*stiffness_rear*state[0])*state[6]/(rotational_inertia*state[4])) + state[6];
out_9203753821438188332[7] = state[7];
out_9203753821438188332[8] = state[8];
}
void F_fun(double *state, double dt, double *out_6516583174049416628) {
out_6516583174049416628[0] = 1;
out_6516583174049416628[1] = 0;
out_6516583174049416628[2] = 0;
out_6516583174049416628[3] = 0;
out_6516583174049416628[4] = 0;
out_6516583174049416628[5] = 0;
out_6516583174049416628[6] = 0;
out_6516583174049416628[7] = 0;
out_6516583174049416628[8] = 0;
out_6516583174049416628[9] = 0;
out_6516583174049416628[10] = 1;
out_6516583174049416628[11] = 0;
out_6516583174049416628[12] = 0;
out_6516583174049416628[13] = 0;
out_6516583174049416628[14] = 0;
out_6516583174049416628[15] = 0;
out_6516583174049416628[16] = 0;
out_6516583174049416628[17] = 0;
out_6516583174049416628[18] = 0;
out_6516583174049416628[19] = 0;
out_6516583174049416628[20] = 1;
out_6516583174049416628[21] = 0;
out_6516583174049416628[22] = 0;
out_6516583174049416628[23] = 0;
out_6516583174049416628[24] = 0;
out_6516583174049416628[25] = 0;
out_6516583174049416628[26] = 0;
out_6516583174049416628[27] = 0;
out_6516583174049416628[28] = 0;
out_6516583174049416628[29] = 0;
out_6516583174049416628[30] = 1;
out_6516583174049416628[31] = 0;
out_6516583174049416628[32] = 0;
out_6516583174049416628[33] = 0;
out_6516583174049416628[34] = 0;
out_6516583174049416628[35] = 0;
out_6516583174049416628[36] = 0;
out_6516583174049416628[37] = 0;
out_6516583174049416628[38] = 0;
out_6516583174049416628[39] = 0;
out_6516583174049416628[40] = 1;
out_6516583174049416628[41] = 0;
out_6516583174049416628[42] = 0;
out_6516583174049416628[43] = 0;
out_6516583174049416628[44] = 0;
out_6516583174049416628[45] = dt*(stiffness_front*(-state[2] - state[3] + state[7])/(mass*state[1]) + (-stiffness_front - stiffness_rear)*state[5]/(mass*state[4]) + (-center_to_front*stiffness_front + center_to_rear*stiffness_rear)*state[6]/(mass*state[4]));
out_6516583174049416628[46] = -dt*stiffness_front*(-state[2] - state[3] + state[7])*state[0]/(mass*pow(state[1], 2));
out_6516583174049416628[47] = -dt*stiffness_front*state[0]/(mass*state[1]);
out_6516583174049416628[48] = -dt*stiffness_front*state[0]/(mass*state[1]);
out_6516583174049416628[49] = dt*((-1 - (-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/(mass*pow(state[4], 2)))*state[6] - (-stiffness_front*state[0] - stiffness_rear*state[0])*state[5]/(mass*pow(state[4], 2)));
out_6516583174049416628[50] = dt*(-stiffness_front*state[0] - stiffness_rear*state[0])/(mass*state[4]) + 1;
out_6516583174049416628[51] = dt*(-state[4] + (-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/(mass*state[4]));
out_6516583174049416628[52] = dt*stiffness_front*state[0]/(mass*state[1]);
out_6516583174049416628[53] = -9.8100000000000005*dt;
out_6516583174049416628[54] = dt*(center_to_front*stiffness_front*(-state[2] - state[3] + state[7])/(rotational_inertia*state[1]) + (-center_to_front*stiffness_front + center_to_rear*stiffness_rear)*state[5]/(rotational_inertia*state[4]) + (-pow(center_to_front, 2)*stiffness_front - pow(center_to_rear, 2)*stiffness_rear)*state[6]/(rotational_inertia*state[4]));
out_6516583174049416628[55] = -center_to_front*dt*stiffness_front*(-state[2] - state[3] + state[7])*state[0]/(rotational_inertia*pow(state[1], 2));
out_6516583174049416628[56] = -center_to_front*dt*stiffness_front*state[0]/(rotational_inertia*state[1]);
out_6516583174049416628[57] = -center_to_front*dt*stiffness_front*state[0]/(rotational_inertia*state[1]);
out_6516583174049416628[58] = dt*(-(-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])*state[5]/(rotational_inertia*pow(state[4], 2)) - (-pow(center_to_front, 2)*stiffness_front*state[0] - pow(center_to_rear, 2)*stiffness_rear*state[0])*state[6]/(rotational_inertia*pow(state[4], 2)));
out_6516583174049416628[59] = dt*(-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/(rotational_inertia*state[4]);
out_6516583174049416628[60] = dt*(-pow(center_to_front, 2)*stiffness_front*state[0] - pow(center_to_rear, 2)*stiffness_rear*state[0])/(rotational_inertia*state[4]) + 1;
out_6516583174049416628[61] = center_to_front*dt*stiffness_front*state[0]/(rotational_inertia*state[1]);
out_6516583174049416628[62] = 0;
out_6516583174049416628[63] = 0;
out_6516583174049416628[64] = 0;
out_6516583174049416628[65] = 0;
out_6516583174049416628[66] = 0;
out_6516583174049416628[67] = 0;
out_6516583174049416628[68] = 0;
out_6516583174049416628[69] = 0;
out_6516583174049416628[70] = 1;
out_6516583174049416628[71] = 0;
out_6516583174049416628[72] = 0;
out_6516583174049416628[73] = 0;
out_6516583174049416628[74] = 0;
out_6516583174049416628[75] = 0;
out_6516583174049416628[76] = 0;
out_6516583174049416628[77] = 0;
out_6516583174049416628[78] = 0;
out_6516583174049416628[79] = 0;
out_6516583174049416628[80] = 1;
void F_fun(double *state, double dt, double *out_1821220582526959893) {
out_1821220582526959893[0] = 1;
out_1821220582526959893[1] = 0;
out_1821220582526959893[2] = 0;
out_1821220582526959893[3] = 0;
out_1821220582526959893[4] = 0;
out_1821220582526959893[5] = 0;
out_1821220582526959893[6] = 0;
out_1821220582526959893[7] = 0;
out_1821220582526959893[8] = 0;
out_1821220582526959893[9] = 0;
out_1821220582526959893[10] = 1;
out_1821220582526959893[11] = 0;
out_1821220582526959893[12] = 0;
out_1821220582526959893[13] = 0;
out_1821220582526959893[14] = 0;
out_1821220582526959893[15] = 0;
out_1821220582526959893[16] = 0;
out_1821220582526959893[17] = 0;
out_1821220582526959893[18] = 0;
out_1821220582526959893[19] = 0;
out_1821220582526959893[20] = 1;
out_1821220582526959893[21] = 0;
out_1821220582526959893[22] = 0;
out_1821220582526959893[23] = 0;
out_1821220582526959893[24] = 0;
out_1821220582526959893[25] = 0;
out_1821220582526959893[26] = 0;
out_1821220582526959893[27] = 0;
out_1821220582526959893[28] = 0;
out_1821220582526959893[29] = 0;
out_1821220582526959893[30] = 1;
out_1821220582526959893[31] = 0;
out_1821220582526959893[32] = 0;
out_1821220582526959893[33] = 0;
out_1821220582526959893[34] = 0;
out_1821220582526959893[35] = 0;
out_1821220582526959893[36] = 0;
out_1821220582526959893[37] = 0;
out_1821220582526959893[38] = 0;
out_1821220582526959893[39] = 0;
out_1821220582526959893[40] = 1;
out_1821220582526959893[41] = 0;
out_1821220582526959893[42] = 0;
out_1821220582526959893[43] = 0;
out_1821220582526959893[44] = 0;
out_1821220582526959893[45] = dt*(stiffness_front*(-state[2] - state[3] + state[7])/(mass*state[1]) + (-stiffness_front - stiffness_rear)*state[5]/(mass*state[4]) + (-center_to_front*stiffness_front + center_to_rear*stiffness_rear)*state[6]/(mass*state[4]));
out_1821220582526959893[46] = -dt*stiffness_front*(-state[2] - state[3] + state[7])*state[0]/(mass*pow(state[1], 2));
out_1821220582526959893[47] = -dt*stiffness_front*state[0]/(mass*state[1]);
out_1821220582526959893[48] = -dt*stiffness_front*state[0]/(mass*state[1]);
out_1821220582526959893[49] = dt*((-1 - (-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/(mass*pow(state[4], 2)))*state[6] - (-stiffness_front*state[0] - stiffness_rear*state[0])*state[5]/(mass*pow(state[4], 2)));
out_1821220582526959893[50] = dt*(-stiffness_front*state[0] - stiffness_rear*state[0])/(mass*state[4]) + 1;
out_1821220582526959893[51] = dt*(-state[4] + (-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/(mass*state[4]));
out_1821220582526959893[52] = dt*stiffness_front*state[0]/(mass*state[1]);
out_1821220582526959893[53] = -9.8100000000000005*dt;
out_1821220582526959893[54] = dt*(center_to_front*stiffness_front*(-state[2] - state[3] + state[7])/(rotational_inertia*state[1]) + (-center_to_front*stiffness_front + center_to_rear*stiffness_rear)*state[5]/(rotational_inertia*state[4]) + (-pow(center_to_front, 2)*stiffness_front - pow(center_to_rear, 2)*stiffness_rear)*state[6]/(rotational_inertia*state[4]));
out_1821220582526959893[55] = -center_to_front*dt*stiffness_front*(-state[2] - state[3] + state[7])*state[0]/(rotational_inertia*pow(state[1], 2));
out_1821220582526959893[56] = -center_to_front*dt*stiffness_front*state[0]/(rotational_inertia*state[1]);
out_1821220582526959893[57] = -center_to_front*dt*stiffness_front*state[0]/(rotational_inertia*state[1]);
out_1821220582526959893[58] = dt*(-(-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])*state[5]/(rotational_inertia*pow(state[4], 2)) - (-pow(center_to_front, 2)*stiffness_front*state[0] - pow(center_to_rear, 2)*stiffness_rear*state[0])*state[6]/(rotational_inertia*pow(state[4], 2)));
out_1821220582526959893[59] = dt*(-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/(rotational_inertia*state[4]);
out_1821220582526959893[60] = dt*(-pow(center_to_front, 2)*stiffness_front*state[0] - pow(center_to_rear, 2)*stiffness_rear*state[0])/(rotational_inertia*state[4]) + 1;
out_1821220582526959893[61] = center_to_front*dt*stiffness_front*state[0]/(rotational_inertia*state[1]);
out_1821220582526959893[62] = 0;
out_1821220582526959893[63] = 0;
out_1821220582526959893[64] = 0;
out_1821220582526959893[65] = 0;
out_1821220582526959893[66] = 0;
out_1821220582526959893[67] = 0;
out_1821220582526959893[68] = 0;
out_1821220582526959893[69] = 0;
out_1821220582526959893[70] = 1;
out_1821220582526959893[71] = 0;
out_1821220582526959893[72] = 0;
out_1821220582526959893[73] = 0;
out_1821220582526959893[74] = 0;
out_1821220582526959893[75] = 0;
out_1821220582526959893[76] = 0;
out_1821220582526959893[77] = 0;
out_1821220582526959893[78] = 0;
out_1821220582526959893[79] = 0;
out_1821220582526959893[80] = 1;
}
void h_25(double *state, double *unused, double *out_6845996924949086281) {
out_6845996924949086281[0] = state[6];
void h_25(double *state, double *unused, double *out_7848411301120641124) {
out_7848411301120641124[0] = state[6];
}
void H_25(double *state, double *unused, double *out_4925282443857457875) {
out_4925282443857457875[0] = 0;
out_4925282443857457875[1] = 0;
out_4925282443857457875[2] = 0;
out_4925282443857457875[3] = 0;
out_4925282443857457875[4] = 0;
out_4925282443857457875[5] = 0;
out_4925282443857457875[6] = 1;
out_4925282443857457875[7] = 0;
out_4925282443857457875[8] = 0;
void H_25(double *state, double *unused, double *out_6136977117952979916) {
out_6136977117952979916[0] = 0;
out_6136977117952979916[1] = 0;
out_6136977117952979916[2] = 0;
out_6136977117952979916[3] = 0;
out_6136977117952979916[4] = 0;
out_6136977117952979916[5] = 0;
out_6136977117952979916[6] = 1;
out_6136977117952979916[7] = 0;
out_6136977117952979916[8] = 0;
}
void h_24(double *state, double *unused, double *out_76787194833890602) {
out_76787194833890602[0] = state[4];
out_76787194833890602[1] = state[5];
void h_24(double *state, double *unused, double *out_8292657587405145092) {
out_8292657587405145092[0] = state[4];
out_8292657587405145092[1] = state[5];
}
void H_24(double *state, double *unused, double *out_2493109189819469018) {
out_2493109189819469018[0] = 0;
out_2493109189819469018[1] = 0;
out_2493109189819469018[2] = 0;
out_2493109189819469018[3] = 0;
out_2493109189819469018[4] = 1;
out_2493109189819469018[5] = 0;
out_2493109189819469018[6] = 0;
out_2493109189819469018[7] = 0;
out_2493109189819469018[8] = 0;
out_2493109189819469018[9] = 0;
out_2493109189819469018[10] = 0;
out_2493109189819469018[11] = 0;
out_2493109189819469018[12] = 0;
out_2493109189819469018[13] = 0;
out_2493109189819469018[14] = 1;
out_2493109189819469018[15] = 0;
out_2493109189819469018[16] = 0;
out_2493109189819469018[17] = 0;
void H_24(double *state, double *unused, double *out_3964327518947480350) {
out_3964327518947480350[0] = 0;
out_3964327518947480350[1] = 0;
out_3964327518947480350[2] = 0;
out_3964327518947480350[3] = 0;
out_3964327518947480350[4] = 1;
out_3964327518947480350[5] = 0;
out_3964327518947480350[6] = 0;
out_3964327518947480350[7] = 0;
out_3964327518947480350[8] = 0;
out_3964327518947480350[9] = 0;
out_3964327518947480350[10] = 0;
out_3964327518947480350[11] = 0;
out_3964327518947480350[12] = 0;
out_3964327518947480350[13] = 0;
out_3964327518947480350[14] = 1;
out_3964327518947480350[15] = 0;
out_3964327518947480350[16] = 0;
out_3964327518947480350[17] = 0;
}
void h_30(double *state, double *unused, double *out_7304198287107647943) {
out_7304198287107647943[0] = state[4];
void h_30(double *state, double *unused, double *out_1692964105279980995) {
out_1692964105279980995[0] = state[4];
}
void H_30(double *state, double *unused, double *out_8993765299724485543) {
out_8993765299724485543[0] = 0;
out_8993765299724485543[1] = 0;
out_8993765299724485543[2] = 0;
out_8993765299724485543[3] = 0;
out_8993765299724485543[4] = 1;
out_8993765299724485543[5] = 0;
out_8993765299724485543[6] = 0;
out_8993765299724485543[7] = 0;
out_8993765299724485543[8] = 0;
void H_30(double *state, double *unused, double *out_8655310076460228543) {
out_8655310076460228543[0] = 0;
out_8655310076460228543[1] = 0;
out_8655310076460228543[2] = 0;
out_8655310076460228543[3] = 0;
out_8655310076460228543[4] = 1;
out_8655310076460228543[5] = 0;
out_8655310076460228543[6] = 0;
out_8655310076460228543[7] = 0;
out_8655310076460228543[8] = 0;
}
void h_26(double *state, double *unused, double *out_6360688434205985508) {
out_6360688434205985508[0] = state[7];
void h_26(double *state, double *unused, double *out_6694637372940826640) {
out_6694637372940826640[0] = state[7];
}
void H_26(double *state, double *unused, double *out_8666785762731514099) {
out_8666785762731514099[0] = 0;
out_8666785762731514099[1] = 0;
out_8666785762731514099[2] = 0;
out_8666785762731514099[3] = 0;
out_8666785762731514099[4] = 0;
out_8666785762731514099[5] = 0;
out_8666785762731514099[6] = 0;
out_8666785762731514099[7] = 1;
out_8666785762731514099[8] = 0;
void H_26(double *state, double *unused, double *out_2395473799078923692) {
out_2395473799078923692[0] = 0;
out_2395473799078923692[1] = 0;
out_2395473799078923692[2] = 0;
out_2395473799078923692[3] = 0;
out_2395473799078923692[4] = 0;
out_2395473799078923692[5] = 0;
out_2395473799078923692[6] = 0;
out_2395473799078923692[7] = 1;
out_2395473799078923692[8] = 0;
}
void h_27(double *state, double *unused, double *out_2448044843667457269) {
out_2448044843667457269[0] = state[3];
void h_27(double *state, double *unused, double *out_3658606002300167844) {
out_3658606002300167844[0] = state[3];
}
void H_27(double *state, double *unused, double *out_6819001987924060632) {
out_6819001987924060632[0] = 0;
out_6819001987924060632[1] = 0;
out_6819001987924060632[2] = 0;
out_6819001987924060632[3] = 1;
out_6819001987924060632[4] = 0;
out_6819001987924060632[5] = 0;
out_6819001987924060632[6] = 0;
out_6819001987924060632[7] = 0;
out_6819001987924060632[8] = 0;
void H_27(double *state, double *unused, double *out_6480546764659803632) {
out_6480546764659803632[0] = 0;
out_6480546764659803632[1] = 0;
out_6480546764659803632[2] = 0;
out_6480546764659803632[3] = 1;
out_6480546764659803632[4] = 0;
out_6480546764659803632[5] = 0;
out_6480546764659803632[6] = 0;
out_6480546764659803632[7] = 0;
out_6480546764659803632[8] = 0;
}
void h_29(double *state, double *unused, double *out_2302525019446802298) {
out_2302525019446802298[0] = state[1];
void h_29(double *state, double *unused, double *out_3383411940015661955) {
out_3383411940015661955[0] = state[1];
}
void H_29(double *state, double *unused, double *out_8942747429670673889) {
out_8942747429670673889[0] = 0;
out_8942747429670673889[1] = 1;
out_8942747429670673889[2] = 0;
out_8942747429670673889[3] = 0;
out_8942747429670673889[4] = 0;
out_8942747429670673889[5] = 0;
out_8942747429670673889[6] = 0;
out_8942747429670673889[7] = 0;
out_8942747429670673889[8] = 0;
void H_29(double *state, double *unused, double *out_9165541420774620727) {
out_9165541420774620727[0] = 0;
out_9165541420774620727[1] = 1;
out_9165541420774620727[2] = 0;
out_9165541420774620727[3] = 0;
out_9165541420774620727[4] = 0;
out_9165541420774620727[5] = 0;
out_9165541420774620727[6] = 0;
out_9165541420774620727[7] = 0;
out_9165541420774620727[8] = 0;
}
void h_28(double *state, double *unused, double *out_2553628423993388376) {
out_2553628423993388376[0] = state[0];
void h_28(double *state, double *unused, double *out_2219679485258547244) {
out_2219679485258547244[0] = state[0];
}
void H_28(double *state, double *unused, double *out_4421597626969347153) {
out_4421597626969347153[0] = 1;
out_4421597626969347153[1] = 0;
out_4421597626969347153[2] = 0;
out_4421597626969347153[3] = 0;
out_4421597626969347153[4] = 0;
out_4421597626969347153[5] = 0;
out_4421597626969347153[6] = 0;
out_4421597626969347153[7] = 0;
out_4421597626969347153[8] = 0;
void H_28(double *state, double *unused, double *out_4083142403705090153) {
out_4083142403705090153[0] = 1;
out_4083142403705090153[1] = 0;
out_4083142403705090153[2] = 0;
out_4083142403705090153[3] = 0;
out_4083142403705090153[4] = 0;
out_4083142403705090153[5] = 0;
out_4083142403705090153[6] = 0;
out_4083142403705090153[7] = 0;
out_4083142403705090153[8] = 0;
}
void h_31(double *state, double *unused, double *out_7359576434127226352) {
out_7359576434127226352[0] = state[8];
void h_31(double *state, double *unused, double *out_8123605363405147013) {
out_8123605363405147013[0] = state[8];
}
void H_31(double *state, double *unused, double *out_9153750208744686041) {
out_9153750208744686041[0] = 0;
out_9153750208744686041[1] = 0;
out_9153750208744686041[2] = 0;
out_9153750208744686041[3] = 0;
out_9153750208744686041[4] = 0;
out_9153750208744686041[5] = 0;
out_9153750208744686041[6] = 0;
out_9153750208744686041[7] = 0;
out_9153750208744686041[8] = 1;
void H_31(double *state, double *unused, double *out_1769265696845572216) {
out_1769265696845572216[0] = 0;
out_1769265696845572216[1] = 0;
out_1769265696845572216[2] = 0;
out_1769265696845572216[3] = 0;
out_1769265696845572216[4] = 0;
out_1769265696845572216[5] = 0;
out_1769265696845572216[6] = 0;
out_1769265696845572216[7] = 0;
out_1769265696845572216[8] = 1;
}
#include <eigen3/Eigen/Dense>
#include <iostream>
@@ -518,68 +518,68 @@ void car_update_28(double *in_x, double *in_P, double *in_z, double *in_R, doubl
void car_update_31(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) {
update<1, 3, 0>(in_x, in_P, h_31, H_31, NULL, in_z, in_R, in_ea, MAHA_THRESH_31);
}
void car_err_fun(double *nom_x, double *delta_x, double *out_6125726627663246664) {
err_fun(nom_x, delta_x, out_6125726627663246664);
void car_err_fun(double *nom_x, double *delta_x, double *out_1393219424364542669) {
err_fun(nom_x, delta_x, out_1393219424364542669);
}
void car_inv_err_fun(double *nom_x, double *true_x, double *out_87606233557452672) {
inv_err_fun(nom_x, true_x, out_87606233557452672);
void car_inv_err_fun(double *nom_x, double *true_x, double *out_8544281472794776121) {
inv_err_fun(nom_x, true_x, out_8544281472794776121);
}
void car_H_mod_fun(double *state, double *out_1571740516032572076) {
H_mod_fun(state, out_1571740516032572076);
void car_H_mod_fun(double *state, double *out_542719001883324995) {
H_mod_fun(state, out_542719001883324995);
}
void car_f_fun(double *state, double dt, double *out_7904413896065989389) {
f_fun(state, dt, out_7904413896065989389);
void car_f_fun(double *state, double dt, double *out_9203753821438188332) {
f_fun(state, dt, out_9203753821438188332);
}
void car_F_fun(double *state, double dt, double *out_6516583174049416628) {
F_fun(state, dt, out_6516583174049416628);
void car_F_fun(double *state, double dt, double *out_1821220582526959893) {
F_fun(state, dt, out_1821220582526959893);
}
void car_h_25(double *state, double *unused, double *out_6845996924949086281) {
h_25(state, unused, out_6845996924949086281);
void car_h_25(double *state, double *unused, double *out_7848411301120641124) {
h_25(state, unused, out_7848411301120641124);
}
void car_H_25(double *state, double *unused, double *out_4925282443857457875) {
H_25(state, unused, out_4925282443857457875);
void car_H_25(double *state, double *unused, double *out_6136977117952979916) {
H_25(state, unused, out_6136977117952979916);
}
void car_h_24(double *state, double *unused, double *out_76787194833890602) {
h_24(state, unused, out_76787194833890602);
void car_h_24(double *state, double *unused, double *out_8292657587405145092) {
h_24(state, unused, out_8292657587405145092);
}
void car_H_24(double *state, double *unused, double *out_2493109189819469018) {
H_24(state, unused, out_2493109189819469018);
void car_H_24(double *state, double *unused, double *out_3964327518947480350) {
H_24(state, unused, out_3964327518947480350);
}
void car_h_30(double *state, double *unused, double *out_7304198287107647943) {
h_30(state, unused, out_7304198287107647943);
void car_h_30(double *state, double *unused, double *out_1692964105279980995) {
h_30(state, unused, out_1692964105279980995);
}
void car_H_30(double *state, double *unused, double *out_8993765299724485543) {
H_30(state, unused, out_8993765299724485543);
void car_H_30(double *state, double *unused, double *out_8655310076460228543) {
H_30(state, unused, out_8655310076460228543);
}
void car_h_26(double *state, double *unused, double *out_6360688434205985508) {
h_26(state, unused, out_6360688434205985508);
void car_h_26(double *state, double *unused, double *out_6694637372940826640) {
h_26(state, unused, out_6694637372940826640);
}
void car_H_26(double *state, double *unused, double *out_8666785762731514099) {
H_26(state, unused, out_8666785762731514099);
void car_H_26(double *state, double *unused, double *out_2395473799078923692) {
H_26(state, unused, out_2395473799078923692);
}
void car_h_27(double *state, double *unused, double *out_2448044843667457269) {
h_27(state, unused, out_2448044843667457269);
void car_h_27(double *state, double *unused, double *out_3658606002300167844) {
h_27(state, unused, out_3658606002300167844);
}
void car_H_27(double *state, double *unused, double *out_6819001987924060632) {
H_27(state, unused, out_6819001987924060632);
void car_H_27(double *state, double *unused, double *out_6480546764659803632) {
H_27(state, unused, out_6480546764659803632);
}
void car_h_29(double *state, double *unused, double *out_2302525019446802298) {
h_29(state, unused, out_2302525019446802298);
void car_h_29(double *state, double *unused, double *out_3383411940015661955) {
h_29(state, unused, out_3383411940015661955);
}
void car_H_29(double *state, double *unused, double *out_8942747429670673889) {
H_29(state, unused, out_8942747429670673889);
void car_H_29(double *state, double *unused, double *out_9165541420774620727) {
H_29(state, unused, out_9165541420774620727);
}
void car_h_28(double *state, double *unused, double *out_2553628423993388376) {
h_28(state, unused, out_2553628423993388376);
void car_h_28(double *state, double *unused, double *out_2219679485258547244) {
h_28(state, unused, out_2219679485258547244);
}
void car_H_28(double *state, double *unused, double *out_4421597626969347153) {
H_28(state, unused, out_4421597626969347153);
void car_H_28(double *state, double *unused, double *out_4083142403705090153) {
H_28(state, unused, out_4083142403705090153);
}
void car_h_31(double *state, double *unused, double *out_7359576434127226352) {
h_31(state, unused, out_7359576434127226352);
void car_h_31(double *state, double *unused, double *out_8123605363405147013) {
h_31(state, unused, out_8123605363405147013);
}
void car_H_31(double *state, double *unused, double *out_9153750208744686041) {
H_31(state, unused, out_9153750208744686041);
void car_H_31(double *state, double *unused, double *out_1769265696845572216) {
H_31(state, unused, out_1769265696845572216);
}
void car_predict(double *in_x, double *in_P, double *in_Q, double dt) {
predict(in_x, in_P, in_Q, dt);
+21 -21
View File
@@ -9,27 +9,27 @@ void car_update_27(double *in_x, double *in_P, double *in_z, double *in_R, doubl
void car_update_29(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea);
void car_update_28(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea);
void car_update_31(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea);
void car_err_fun(double *nom_x, double *delta_x, double *out_6125726627663246664);
void car_inv_err_fun(double *nom_x, double *true_x, double *out_87606233557452672);
void car_H_mod_fun(double *state, double *out_1571740516032572076);
void car_f_fun(double *state, double dt, double *out_7904413896065989389);
void car_F_fun(double *state, double dt, double *out_6516583174049416628);
void car_h_25(double *state, double *unused, double *out_6845996924949086281);
void car_H_25(double *state, double *unused, double *out_4925282443857457875);
void car_h_24(double *state, double *unused, double *out_76787194833890602);
void car_H_24(double *state, double *unused, double *out_2493109189819469018);
void car_h_30(double *state, double *unused, double *out_7304198287107647943);
void car_H_30(double *state, double *unused, double *out_8993765299724485543);
void car_h_26(double *state, double *unused, double *out_6360688434205985508);
void car_H_26(double *state, double *unused, double *out_8666785762731514099);
void car_h_27(double *state, double *unused, double *out_2448044843667457269);
void car_H_27(double *state, double *unused, double *out_6819001987924060632);
void car_h_29(double *state, double *unused, double *out_2302525019446802298);
void car_H_29(double *state, double *unused, double *out_8942747429670673889);
void car_h_28(double *state, double *unused, double *out_2553628423993388376);
void car_H_28(double *state, double *unused, double *out_4421597626969347153);
void car_h_31(double *state, double *unused, double *out_7359576434127226352);
void car_H_31(double *state, double *unused, double *out_9153750208744686041);
void car_err_fun(double *nom_x, double *delta_x, double *out_1393219424364542669);
void car_inv_err_fun(double *nom_x, double *true_x, double *out_8544281472794776121);
void car_H_mod_fun(double *state, double *out_542719001883324995);
void car_f_fun(double *state, double dt, double *out_9203753821438188332);
void car_F_fun(double *state, double dt, double *out_1821220582526959893);
void car_h_25(double *state, double *unused, double *out_7848411301120641124);
void car_H_25(double *state, double *unused, double *out_6136977117952979916);
void car_h_24(double *state, double *unused, double *out_8292657587405145092);
void car_H_24(double *state, double *unused, double *out_3964327518947480350);
void car_h_30(double *state, double *unused, double *out_1692964105279980995);
void car_H_30(double *state, double *unused, double *out_8655310076460228543);
void car_h_26(double *state, double *unused, double *out_6694637372940826640);
void car_H_26(double *state, double *unused, double *out_2395473799078923692);
void car_h_27(double *state, double *unused, double *out_3658606002300167844);
void car_H_27(double *state, double *unused, double *out_6480546764659803632);
void car_h_29(double *state, double *unused, double *out_3383411940015661955);
void car_H_29(double *state, double *unused, double *out_9165541420774620727);
void car_h_28(double *state, double *unused, double *out_2219679485258547244);
void car_H_28(double *state, double *unused, double *out_4083142403705090153);
void car_h_31(double *state, double *unused, double *out_8123605363405147013);
void car_H_31(double *state, double *unused, double *out_1769265696845572216);
void car_predict(double *in_x, double *in_P, double *in_Q, double dt);
void car_set_mass(double x);
void car_set_rotational_inertia(double x);
File diff suppressed because it is too large Load Diff
+13 -13
View File
@@ -5,18 +5,18 @@ void pose_update_4(double *in_x, double *in_P, double *in_z, double *in_R, doubl
void pose_update_10(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea);
void pose_update_13(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea);
void pose_update_14(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea);
void pose_err_fun(double *nom_x, double *delta_x, double *out_5340642756295943636);
void pose_inv_err_fun(double *nom_x, double *true_x, double *out_6968876690248087810);
void pose_H_mod_fun(double *state, double *out_3389862186663429553);
void pose_f_fun(double *state, double dt, double *out_4802700997878092668);
void pose_F_fun(double *state, double dt, double *out_8725044315227912670);
void pose_h_4(double *state, double *unused, double *out_1359340648735360631);
void pose_H_4(double *state, double *unused, double *out_4587809668546327657);
void pose_h_10(double *state, double *unused, double *out_6036145492114111302);
void pose_H_10(double *state, double *unused, double *out_7466880812702133914);
void pose_h_13(double *state, double *unused, double *out_863073697323037062);
void pose_H_13(double *state, double *unused, double *out_7800083493878660458);
void pose_h_14(double *state, double *unused, double *out_1770197321873156194);
void pose_H_14(double *state, double *unused, double *out_1505021236250955361);
void pose_err_fun(double *nom_x, double *delta_x, double *out_4967863734907407968);
void pose_inv_err_fun(double *nom_x, double *true_x, double *out_554301816764323460);
void pose_H_mod_fun(double *state, double *out_3047027985808074405);
void pose_f_fun(double *state, double dt, double *out_986492010673501731);
void pose_F_fun(double *state, double dt, double *out_4336070434649428420);
void pose_h_4(double *state, double *unused, double *out_5526642384709914880);
void pose_H_4(double *state, double *unused, double *out_5691168246274914733);
void pose_h_10(double *state, double *unused, double *out_6728942981811315921);
void pose_H_10(double *state, double *unused, double *out_4278506402956144046);
void pose_h_13(double *state, double *unused, double *out_1205451540469147746);
void pose_H_13(double *state, double *unused, double *out_8903442071607247534);
void pose_h_14(double *state, double *unused, double *out_3303339494882182614);
void pose_H_14(double *state, double *unused, double *out_8792334971095152354);
void pose_predict(double *in_x, double *in_P, double *in_Q, double dt);
}
Binary file not shown.
@@ -309,6 +309,11 @@ class StarPilotAppearanceLayout(_SettingsPage):
get_state=lambda: self._params.get_bool("ShowSteering"),
set_state=lambda s: self._params.put_bool("ShowSteering", s),
visible=hud_on),
SettingRow("EnableTorqueBarWidget", "toggle", tr_noop("Torque Bar"),
subtitle=tr_noop("Show a curved torque-utilization indicator at the bottom of the driving screen."),
get_state=lambda: self._params.get_bool("EnableTorqueBarWidget"),
set_state=lambda s: self._params.put_bool("EnableTorqueBarWidget", s),
visible=hud_on),
SettingRow("SignalMetrics", "toggle", tr_noop("Turn Signal Borders"),
subtitle="",
get_state=lambda: self._params.get_bool("SignalMetrics"),
+11
View File
@@ -2,9 +2,20 @@ from __future__ import annotations
import math
import pyray as rl
from openpilot.common.params import Params
def blend_colors(a: rl.Color, b: rl.Color, f: float) -> rl.Color:
h0, s0, v0 = (hsv0 := rl.color_to_hsv(a)).x, hsv0.y, hsv0.z
h1, s1, v1 = (hsv1 := rl.color_to_hsv(b)).x, hsv1.y, hsv1.z
dh = ((h1 - h0 + 180) % 360) - 180 # shortest hue delta
return rl.color_from_hsv((h0 + f * dh) % 360,
s0 + f * (s1 - s0),
v0 + f * (v1 - v0))
def get_border_width(base_width: int, params: Params | None = None) -> int:
active_params = params if params is not None else Params()
@@ -60,6 +60,7 @@ class VisualsLayoutMici(NavScroller):
self._driver_camera_btn = BigParamControl("driver camera on reverse", "DriverCamera")
self._stopped_timer_btn = BigParamControl("stopped timer", "StoppedTimer")
self._stock_confidence_ball_btn = BigParamControl("stock confidence ball", "StockConfidenceBallWidget")
self._torque_bar_btn = BigParamControl("torque bar", "EnableTorqueBarWidget")
self._rainbow_path_btn = BigParamControl("rainbow road", "RainbowPath")
self._lead_indicator_btn = LeadIndicatorBigButton()
self._speed_limit_signs_btn = BigParamControl("speed limit signs", "ShowSpeedLimits")
@@ -72,6 +73,7 @@ class VisualsLayoutMici(NavScroller):
self._driver_camera_btn,
self._stopped_timer_btn,
self._stock_confidence_ball_btn,
self._torque_bar_btn,
self._rainbow_path_btn,
self._lead_indicator_btn,
self._speed_limit_signs_btn,
-11
View File
@@ -1,12 +1 @@
import pyray as rl
SIDE_PANEL_WIDTH = 60
def blend_colors(a: rl.Color, b: rl.Color, f: float) -> rl.Color:
h0, s0, v0 = (hsv0 := rl.color_to_hsv(a)).x, hsv0.y, hsv0.z
h1, s1, v1 = (hsv1 := rl.color_to_hsv(b)).x, hsv1.y, hsv1.z
dh = ((h1 - h0 + 180) % 360) - 180 # shortest hue delta
return rl.color_from_hsv((h0 + f * dh) % 360,
s0 + f * (s1 - s0),
v0 + f * (v1 - v0))
+3 -2
View File
@@ -3,7 +3,7 @@ import math
import pyray as rl
from dataclasses import dataclass
from openpilot.common.constants import CV
from openpilot.selfdrive.ui.mici.onroad.torque_bar import TorqueBar
from openpilot.selfdrive.ui.onroad.starpilot.torque_bar import TorqueBar
from openpilot.selfdrive.ui.mici.onroad.speed_limit_utils import resolve_display_speed_limit_ms
from openpilot.selfdrive.ui.onroad.starpilot.navigation_card import NavigationCardRenderer
from openpilot.selfdrive.ui.ui_state import ui_state, UIStatus
@@ -269,7 +269,8 @@ class HudRenderer(Widget):
def render_foreground(self) -> None:
"""Draw HUD elements that should sit above alerts."""
if ui_state.sm['controlsState'].lateralControlState.which() != 'angleState':
if ui_state.sm['controlsState'].lateralControlState.which() != 'angleState' and \
ui_state.params.get_bool("EnableTorqueBarWidget", default=True):
self._torque_bar.render(self._rect)
if self.is_cruise_set:
+1 -2
View File
@@ -9,9 +9,8 @@ from openpilot.common.filter_simple import FirstOrderFilter
from openpilot.selfdrive.locationd.calibrationd import HEIGHT_INIT
from openpilot.selfdrive.ui.lib.starpilot_theme import get_param_color, get_theme_color, get_visual_color, is_stock_color_scheme, with_alpha
from openpilot.selfdrive.ui.onroad.starpilot.rainbow_path import RainbowPath
from openpilot.selfdrive.ui.lib.starpilot_visuals import lead_indicator_enabled
from openpilot.selfdrive.ui.lib.starpilot_visuals import blend_colors, lead_indicator_enabled
from openpilot.selfdrive.ui.ui_state import ui_state, UIStatus
from openpilot.selfdrive.ui.mici.onroad import blend_colors
from openpilot.selfdrive.ui.mici.onroad.starpilot_status import get_border_color
from openpilot.system.ui.lib.application import gui_app
from openpilot.system.ui.lib.shader_polygon import draw_polygon, Gradient
@@ -15,7 +15,6 @@ from openpilot.system.ui.widgets import Widget
ASSETS_PATH = Path(__file__).resolve().parents[4] / "starpilot" / "assets" / "navigation"
FALLBACK_ICON = "direction_turn_straight.png"
NAV_CANCEL_HOLD_SECONDS = 0.65
_LEFT_UI_EXTENT = 424 # left UI (DM icon + personality button) extent from content_rect.x: offset(126) + x_shift(202) + radius(96)
def _format_distance(distance_m: float, is_metric: bool) -> str:
@@ -58,6 +57,7 @@ def _normalize_maneuver_type(maneuver_type: str) -> str:
class NavigationCardRenderer(Widget):
def __init__(self, layout_variant: str = "default"):
"""layout_variant: "default" (tici/tizi) or "mici"."""
super().__init__()
self._font_bold = gui_app.font(FontWeight.BOLD)
self._font_medium = gui_app.font(FontWeight.MEDIUM)
@@ -278,31 +278,31 @@ class NavigationCardRenderer(Widget):
line_y = y + index * (font_size + line_gap)
rl.draw_text_ex(self._font_bold, line, rl.Vector2(x, line_y), font_size, 0, rl.WHITE)
def _render_default(self, rect: rl.Rectangle) -> None:
container_width = min(int(rect.width - 2 * _LEFT_UI_EXTENT - 20), 1080)
container_width = max(container_width, 760)
container_height = 225 if rect.width >= 1200 else 195
container_x = int(rect.x + (rect.width - container_width) / 2)
container_y = int(rect.y + rect.height - container_height - 80)
border_radius = 42 if container_height == 225 else 34
icon_size = 150 if container_height == 225 else 122
icon_padding = 30 if container_height == 225 else 24
then_section_width = 180 if container_height == 225 else 144
then_icon_size = 105 if container_height == 225 else 82
preferred_font_size = 75 if container_height == 225 else 58
minimum_font_size = 60 if container_height == 225 else 46
distance_font_size = 48 if container_height == 225 else 40
def _render_default(self, rect: rl.Rectangle) -> None: # tici/tizi expanded card
right_margin = 40
card_width = 560
card_height = 195
container_x = int(rect.x + rect.width - card_width - right_margin)
container_y = int(rect.y + rect.height - card_height - 440)
container = rl.Rectangle(container_x, container_y, container_width, container_height)
icon_size = 100
icon_padding = 24
then_section_width = 130
then_icon_size = 72
preferred_font_size = 48
minimum_font_size = 38
distance_font_size = 32
container = rl.Rectangle(container_x, container_y, card_width, card_height)
self._interactive_rect = container
rl.draw_rectangle_rounded(container, border_radius / container_height, 10, rl.Color(0, 0, 0, 192))
rl.draw_rectangle_rounded(container, 34 / card_height, 10, rl.Color(0, 0, 0, 192))
icon_x = container_x + icon_padding
icon = self._get_icon(self._maneuver_type, self._modifier)
distance_size = measure_text_cached(self._font_bold, self._distance, distance_font_size)
icon_block_height = icon_size + 8 + int(distance_size.y)
icon_y = container_y + (container_height - icon_block_height) // 2
icon_y = container_y + (card_height - icon_block_height) // 2
dest_rect = rl.Rectangle(icon_x, icon_y, icon_size, icon_size)
rl.draw_texture_pro(icon, rl.Rectangle(0, 0, icon.width, icon.height), dest_rect, rl.Vector2(0, 0), 0, rl.WHITE)
@@ -311,16 +311,17 @@ class NavigationCardRenderer(Widget):
rl.draw_text_ex(self._font_bold, self._distance, rl.Vector2(distance_x, distance_y), distance_font_size, 0, rl.WHITE)
show_next = self._has_next
text_x = icon_x + icon_size + 53
gap_after_icon = 32
text_x = icon_x + icon_size + gap_after_icon
right_gutter = icon_padding + (then_section_width if show_next else 0)
text_area_width = container_width - (text_x - container_x) - right_gutter
text_area_width = card_width - (text_x - container_x) - right_gutter
title_lines, title_font_size = self._fit_title(self._primary_text, text_area_width, preferred_font_size, minimum_font_size)
secondary_font_size = 38 if container_height == 225 else 30
secondary_font_size = 26
text_block_h = len(title_lines) * title_font_size
if self._secondary_text:
text_block_h += 8 + secondary_font_size
text_block_y = container_y + (container_height - text_block_h) // 2
text_block_y = container_y + (card_height - text_block_h) // 2
for index, line in enumerate(title_lines[:2]):
rl.draw_text_ex(self._font_bold, line, rl.Vector2(text_x, text_block_y + index * title_font_size), title_font_size, 0, rl.WHITE)
@@ -340,24 +341,24 @@ class NavigationCardRenderer(Widget):
if not show_next:
return
divider_x = container_x + container_width - then_section_width - 8
divider_x = container_x + card_width - then_section_width - 8
rl.draw_line_ex(
rl.Vector2(divider_x, container_y + 23),
rl.Vector2(divider_x, container_y + container_height - 23),
rl.Vector2(divider_x, container_y + card_height - 23),
2,
rl.Color(255, 255, 255, 50),
)
then_x = divider_x + 15
then_label = "Then"
then_font_size = 53 if container_height == 225 else 40
then_font_size = 36
then_size = measure_text_cached(self._font_medium, then_label, then_font_size)
then_label_x = then_x + (then_section_width - 23 - then_size.x) / 2
rl.draw_text_ex(self._font_medium, then_label, rl.Vector2(then_label_x, container_y + 30), then_font_size, 0, rl.WHITE)
next_icon = self._get_icon(self._next_maneuver_type, self._next_modifier)
then_icon_x = then_x + (then_section_width - 23 - then_icon_size) / 2
then_icon_y = container_y + (84 if container_height == 225 else 72)
then_icon_y = container_y + 72
rl.draw_texture_pro(
next_icon,
rl.Rectangle(0, 0, next_icon.width, next_icon.height),
@@ -367,10 +368,10 @@ class NavigationCardRenderer(Widget):
rl.WHITE,
)
def _render_collapsed_default(self, rect: rl.Rectangle) -> None:
def _render_collapsed_default(self, rect: rl.Rectangle) -> None: # tici/tizi collapsed chip
chip_size = 94
chip_x = int(rect.x + rect.width - 126 - chip_size / 2) # center-aligned with steering wheel icon horizontally
chip_y = int(rect.y + (rect.height - chip_size) / 2) # half way down vertically
chip_x = int(rect.x + rect.width - chip_size - 40) # right-aligned, 40px margin
chip_y = int(rect.y + 340) # above expanded card
chip_rect = rl.Rectangle(chip_x, chip_y, chip_size, chip_size)
self._interactive_rect = chip_rect
@@ -390,7 +391,7 @@ class NavigationCardRenderer(Widget):
rl.WHITE,
)
def _render_mici(self, rect: rl.Rectangle) -> None:
def _render_mici(self, rect: rl.Rectangle) -> None: # MICI expanded card
left_safe = 96
right_margin = 12
available_width = max(260, int(rect.width - left_safe - right_margin))
@@ -485,7 +486,7 @@ class NavigationCardRenderer(Widget):
rl.WHITE,
)
def _render_collapsed_mici(self, rect: rl.Rectangle) -> None:
def _render_collapsed_mici(self, rect: rl.Rectangle) -> None: # MICI collapsed chip
chip_size = 72
right_reserved = 160
chip_x = int(rect.x + rect.width - chip_size - right_reserved)
@@ -515,11 +516,11 @@ class NavigationCardRenderer(Widget):
return
if self._collapsed:
if self._layout_variant == "mici":
self._render_collapsed_mici(rect)
self._render_collapsed_mici(rect) # MICI: top-right chip
else:
self._render_collapsed_default(rect)
self._render_collapsed_default(rect) # tici/tizi: right edge
return
if self._layout_variant == "mici":
self._render_mici(rect)
self._render_mici(rect) # MICI: top-left card
else:
self._render_default(rect)
self._render_default(rect) # tici/tizi: right edge, bottom-aligned
@@ -12,6 +12,7 @@ from openpilot.selfdrive.ui.onroad.starpilot.slc_speed_limit import (
)
from openpilot.selfdrive.ui.ui_state import ui_state
from openpilot.selfdrive.ui.onroad.starpilot.aethergauge import AetherGauge
from openpilot.selfdrive.ui.onroad.starpilot.torque_bar import TorqueBar
from openpilot.selfdrive.ui.lib.starpilot_status import (
get_screen_edge_color, ENGAGED_COLOR,
EXPERIMENTAL_COLOR, TRAFFIC_COLOR,
@@ -30,6 +31,7 @@ class StarPilotOnroadView(AugmentedRoadView):
self._font_medium = gui_app.font(FontWeight.MEDIUM)
self._standstill_started_at = 0.0
self._aethergauge = AetherGauge()
self._torque_bar = TorqueBar()
def _render(self, rect: rl.Rectangle):
self._position_personality_button()
@@ -72,9 +74,23 @@ class StarPilotOnroadView(AugmentedRoadView):
)
else:
self._aethergauge.render(self._content_rect, self._font_bold, self._font_medium, current_speed=self._hud_renderer.speed)
self._render_torque_bar()
self._render_bottom_row_widgets()
self._render_pedals()
def _render_torque_bar(self) -> None:
"""Draw the curved torque-utilization indicator at the bottom of the screen."""
if not self._params.get_bool("EnableTorqueBarWidget", default=True):
return
if ui_state.sm['controlsState'].lateralControlState.which() == 'angleState':
return
rl.begin_scissor_mode(
int(self._content_rect.x), int(self._content_rect.y),
int(self._content_rect.width), int(self._content_rect.height),
)
self._torque_bar.render(self._content_rect)
rl.end_scissor_mode()
def _render_path_features(self, rect: rl.Rectangle):
"""Render path-related features (adjacent paths, blind spot, path edges)."""
mr = self.model_renderer
@@ -6,7 +6,7 @@ from collections import OrderedDict
import numpy as np
import pyray as rl
from opendbc.car import ACCELERATION_DUE_TO_GRAVITY
from openpilot.selfdrive.ui.mici.onroad import blend_colors
from openpilot.selfdrive.ui.lib.starpilot_visuals import blend_colors
from openpilot.selfdrive.ui.ui_state import ui_state, UIStatus
from openpilot.system.ui.lib.application import gui_app
from openpilot.system.ui.lib.shader_polygon import draw_polygon, Gradient
@@ -189,9 +189,10 @@ class TorqueBar(Widget):
self._torque_filter.update(-ui_state.sm['carOutput'].actuatorsOutput.torque)
def _render(self, rect: rl.Rectangle) -> None:
SCALE = rect.height / 240.0
# adjust y pos with torque
torque_line_offset = np.interp(abs(self._torque_filter.x), [0.5, 1], [22, 26])
torque_line_height = np.interp(abs(self._torque_filter.x), [0.5, 1], [14, 56])
torque_line_offset = np.interp(abs(self._torque_filter.x), [0.5, 1], [22 * SCALE, 26 * SCALE])
torque_line_height = np.interp(abs(self._torque_filter.x), [0.5, 1], [14 * SCALE, 56 * SCALE])
lateral_ui_active = ui_state.status == UIStatus.ENGAGED or ui_state.always_on_lateral_active
# animate alpha and angle span
@@ -206,7 +207,7 @@ class TorqueBar(Widget):
torque_line_bg_color = rl.Color(255, 255, 255, int(255 * 0.15 * self._torque_line_alpha_filter.x))
# draw curved line polygon torque bar
torque_line_radius = 1200
torque_line_radius = 1200 * SCALE
top_angle = -90
torque_bg_angle_span = self._torque_line_alpha_filter.x * TORQUE_ANGLE_SPAN
torque_start_angle = top_angle - torque_bg_angle_span / 2
@@ -263,5 +264,5 @@ class TorqueBar(Widget):
# draw center torque bar dot
if abs(self._torque_filter.x) < 0.5:
dot_y = self._rect.y + self._rect.height - torque_line_offset - torque_line_height / 2
rl.draw_circle(int(cx), int(dot_y), 10 // 2,
rl.draw_circle(int(cx), int(dot_y), (10 * SCALE) / 2,
rl.Color(182, 182, 182, int(255 * 0.9 * self._torque_line_alpha_filter.x)))
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.