mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-24 01:33:46 +08:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5672975434 | |||
| 9031dde7ec | |||
| 57e5d6e0b7 | |||
| 4286fa9204 |
Binary file not shown.
@@ -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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -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.
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 @@
|
||||
DEV-cb82059d-DEBUG
|
||||
DEV-231eb68f-DEBUG
|
||||
@@ -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);
|
||||
|
||||
@@ -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
@@ -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.
@@ -253,6 +253,19 @@ def draw_rounded_stroke(rect: rl.Rectangle, color: rl.Color, thickness: int = 1,
|
||||
rl.draw_rectangle_rounded_lines_ex(snapped, _roundness_for(snapped, radius_px), segments or _segments_for(snapped, radius_px), thickness, color)
|
||||
|
||||
|
||||
def truncate_text_ellipsis(
|
||||
font: rl.Font, text: str, max_width: float, font_size: int
|
||||
) -> str:
|
||||
if measure_text_cached(font, text, font_size).x <= max_width:
|
||||
return text
|
||||
shortened = text.rstrip()
|
||||
candidate = f"{shortened}..."
|
||||
while shortened and measure_text_cached(font, candidate, font_size).x > max_width:
|
||||
shortened = shortened[:-1].rstrip()
|
||||
candidate = f"{shortened}..." if shortened else "..."
|
||||
return candidate
|
||||
|
||||
|
||||
class AetherListColors:
|
||||
PANEL_BG = rl.Color(8, 8, 10, 255)
|
||||
PANEL_BORDER = rl.Color(255, 255, 255, 22)
|
||||
@@ -307,8 +320,7 @@ class AetherListMetrics:
|
||||
adjustor_preset_height: int = 64
|
||||
adjustor_preset_gap: int = 14
|
||||
adjustor_scrubber_height: int = 75
|
||||
adjustor_value_pill_height: int = 52
|
||||
adjustor_value_pill_width: int = 209
|
||||
|
||||
utility_value_right: int = 391
|
||||
utility_value_width: int = 319
|
||||
utility_chevron_right: int = 90
|
||||
@@ -1016,8 +1028,6 @@ class PanelManagerView(AetherInteractiveMixin, Widget):
|
||||
|
||||
class BreadcrumbController:
|
||||
EXPAND_DURATION: float = 2.5
|
||||
TRIGGER_DEPTH: int = 4
|
||||
RECENT_KEEP: int = 3
|
||||
|
||||
def __init__(self):
|
||||
self._rects: dict[str, rl.Rectangle] = {}
|
||||
@@ -1167,8 +1177,8 @@ class BreadcrumbController:
|
||||
target = 1.0 if self._expanded else 0.0
|
||||
self._expand_alpha += (target - self._expand_alpha) * ANIM_LERP
|
||||
|
||||
ACTIVE_SIZE = 64
|
||||
PAST_SIZE = 52
|
||||
ACTIVE_SIZE = 58
|
||||
PAST_SIZE = 50
|
||||
CHEVRON_SIZE = 38
|
||||
CHEVRON_W = 32
|
||||
GAP = 23
|
||||
@@ -1188,23 +1198,56 @@ class BreadcrumbController:
|
||||
|
||||
mouse_pos = gui_app.last_mouse_event.pos
|
||||
|
||||
depth = len(path)
|
||||
has_overflow = depth > self.TRIGGER_DEPTH
|
||||
MIN_ACTIVE_SIZE = 34
|
||||
CAPSULE_W = 102
|
||||
capsule_need = CAPSULE_W + GAP + CHEVRON_W + GAP
|
||||
|
||||
if not has_overflow:
|
||||
# Shallow path: render everything, no ellipsis.
|
||||
display_path = list(path)
|
||||
overflow_alpha = 1.0
|
||||
elif self._expanded:
|
||||
# Expanded: reveal the entire path and allow it to overflow.
|
||||
# The overflow will be cleanly masked by a scissor clip and fade out gradient.
|
||||
active_size = ACTIVE_SIZE
|
||||
|
||||
if self._expanded:
|
||||
display_path = list(path)
|
||||
overflow_alpha = 0.0
|
||||
else:
|
||||
# Collapsed: single … at front, most-recent RECENT_KEEP crumbs visible.
|
||||
recent = path[-self.RECENT_KEEP:]
|
||||
display_path = [("...", "action:breadcrumb_history")] + recent
|
||||
overflow_alpha = 1.0
|
||||
active = path[-1]
|
||||
med_font = gui_app.font(FontWeight.MEDIUM)
|
||||
active_ts = measure_text_cached(gui_app.font(FontWeight.BOLD), active[0], ACTIVE_SIZE)
|
||||
remaining = rect.width - 20 - active_ts.x - GAP
|
||||
|
||||
while remaining < capsule_need and active_size > MIN_ACTIVE_SIZE:
|
||||
active_size -= 6
|
||||
active_ts = measure_text_cached(gui_app.font(FontWeight.BOLD), active[0], active_size)
|
||||
remaining = rect.width - 20 - active_ts.x - GAP
|
||||
|
||||
if remaining < capsule_need:
|
||||
display_path = [active]
|
||||
overflow_alpha = 0.0
|
||||
else:
|
||||
budget = remaining - capsule_need
|
||||
sep = GAP + CHEVRON_W + GAP
|
||||
before = []
|
||||
for i in range(len(path) - 2, -1, -1):
|
||||
slot = budget - sep
|
||||
if slot <= 0:
|
||||
break
|
||||
full_text, action = path[i]
|
||||
full_ts = measure_text_cached(med_font, full_text, PAST_SIZE)
|
||||
if full_ts.x <= slot:
|
||||
before.insert(0, (full_text, action))
|
||||
budget -= full_ts.x + sep
|
||||
else:
|
||||
trunc = truncate_text_ellipsis(med_font, full_text, slot, PAST_SIZE)
|
||||
visible = trunc.removesuffix("...").rstrip()
|
||||
if len(visible) < 3:
|
||||
break
|
||||
before.insert(0, (trunc, action))
|
||||
budget -= measure_text_cached(med_font, trunc, PAST_SIZE).x + sep
|
||||
|
||||
hidden = len(path) - 1 - len(before)
|
||||
if hidden > 0:
|
||||
display_path = [("...", "action:breadcrumb_history")] + before + [active]
|
||||
else:
|
||||
display_path = before + [active]
|
||||
overflow_alpha = 1.0
|
||||
|
||||
current_x = rect.x + 20
|
||||
|
||||
@@ -1221,7 +1264,7 @@ class BreadcrumbController:
|
||||
current_x += GAP
|
||||
continue
|
||||
|
||||
capsule_w, capsule_h = 102, 58
|
||||
capsule_w, capsule_h = CAPSULE_W, 58
|
||||
cap_rect = rl.Rectangle(current_x, center_y - capsule_h / 2, capsule_w, capsule_h)
|
||||
hovered = point_hits(mouse_pos, cap_rect, None, pad_x=4, pad_y=6)
|
||||
|
||||
@@ -1265,7 +1308,7 @@ class BreadcrumbController:
|
||||
|
||||
if is_last:
|
||||
font = gui_app.font(FontWeight.BOLD)
|
||||
font_size = ACTIVE_SIZE
|
||||
font_size = active_size
|
||||
c_normal = rl.Color(252, 252, 255, item_alpha)
|
||||
c_hover = rl.Color(252, 252, 255, item_alpha)
|
||||
c_pressed = rl.Color(200, 200, 200, item_alpha)
|
||||
@@ -1318,6 +1361,7 @@ PANEL_HEADER_TITLE_FONT_SIZE: int = 58
|
||||
PANEL_HEADER_SUBTITLE_FONT_SIZE: int = 29
|
||||
PANEL_HEADER_TITLE_FONT: FontWeight = FontWeight.SEMI_BOLD
|
||||
PANEL_HEADER_SUBTITLE_FONT: FontWeight = FontWeight.NORMAL
|
||||
PANEL_HEADER_SUBTITLE_LINE_HEIGHT: float = 33.0 # subtitle_size(29) + interline_gap(4)
|
||||
|
||||
|
||||
def draw_settings_panel_header(header_rect: rl.Rectangle, title: str, subtitle: str | None = None,
|
||||
@@ -1879,16 +1923,16 @@ def draw_metric_strip(
|
||||
)
|
||||
|
||||
|
||||
GROUP_HEADER_HEIGHT = 20.0
|
||||
GROUP_HEADER_GAP = 2.0
|
||||
GROUP_HEADER_LINE_GAP = 2.0
|
||||
GROUP_HEADER_HEIGHT = 26.0
|
||||
GROUP_HEADER_GAP = 1.0
|
||||
GROUP_HEADER_LINE_GAP = 1.0
|
||||
GROUP_OVERHEAD = 8.0 + GROUP_HEADER_HEIGHT + GROUP_HEADER_LINE_GAP + GROUP_HEADER_GAP
|
||||
GROUP_HAIRLINE_COLOR = rl.Color(255, 255, 255, 30)
|
||||
GROUP_HEADER_COLOR = AetherListColors.HEADER
|
||||
|
||||
|
||||
def draw_group_header(x: float, y: float, width: float, label: str) -> float:
|
||||
gui_label(rl.Rectangle(x, y, max(1.0, width), GROUP_HEADER_HEIGHT), label, 16, GROUP_HEADER_COLOR, FontWeight.MEDIUM)
|
||||
gui_label(rl.Rectangle(x, y, max(1.0, width), GROUP_HEADER_HEIGHT), label, 20, GROUP_HEADER_COLOR, FontWeight.MEDIUM)
|
||||
y += GROUP_HEADER_HEIGHT + GROUP_HEADER_LINE_GAP
|
||||
rl.draw_line(int(x), int(y), int(x + width), int(y), GROUP_HAIRLINE_COLOR)
|
||||
return y + GROUP_HEADER_GAP
|
||||
@@ -2420,8 +2464,7 @@ class AetherAdjustorRow(Widget):
|
||||
self._pressed_zone: str | None = None
|
||||
self._is_last = False
|
||||
self._header_rect = rl.Rectangle(0, 0, 0, 0)
|
||||
self._value_rect = rl.Rectangle(0, 0, 0, 0)
|
||||
self._hint_rect = rl.Rectangle(0, 0, 0, 0)
|
||||
self._progress_bar_rect = rl.Rectangle(0, 0, 0, 0)
|
||||
self._preset_rects: list[tuple[float, rl.Rectangle]] = []
|
||||
self._scrubber_rect = rl.Rectangle(0, 0, 0, 0)
|
||||
self._scrubber = self._child(
|
||||
@@ -2493,7 +2536,7 @@ class AetherAdjustorRow(Widget):
|
||||
self._pressed_zone = "scrubber"
|
||||
return
|
||||
|
||||
if rl.check_collision_point_rec(mouse_pos, self._header_rect) or rl.check_collision_point_rec(mouse_pos, self._value_rect) or rl.check_collision_point_rec(mouse_pos, self._hint_rect):
|
||||
if rl.check_collision_point_rec(mouse_pos, self._header_rect):
|
||||
self._pressed_zone = "header"
|
||||
|
||||
def _handle_mouse_release(self, mouse_pos: MousePos):
|
||||
@@ -2520,7 +2563,7 @@ class AetherAdjustorRow(Widget):
|
||||
|
||||
if pressed_zone == "header":
|
||||
active = self._active()
|
||||
if rl.check_collision_point_rec(mouse_pos, _inflate_rect(self._header_rect, 6, 4)) or rl.check_collision_point_rec(mouse_pos, _inflate_rect(self._value_rect, 6, 4)) or rl.check_collision_point_rec(mouse_pos, _inflate_rect(self._hint_rect, 6, 4)):
|
||||
if rl.check_collision_point_rec(mouse_pos, _inflate_rect(self._header_rect, 6, 4)):
|
||||
self._set_active_state(not active)
|
||||
|
||||
def _handle_mouse_event(self, mouse_event: MouseEvent):
|
||||
@@ -2577,65 +2620,51 @@ class AetherAdjustorRow(Widget):
|
||||
current_border=current_border,
|
||||
)
|
||||
|
||||
title_fs = 24
|
||||
sub_fs = 20
|
||||
val_fs = 20
|
||||
|
||||
value_pill_w = min(float(AETHER_LIST_METRICS.adjustor_value_pill_width), max(118.0, rect.width * 0.22))
|
||||
value_pill_h = float(AETHER_LIST_METRICS.adjustor_value_pill_height)
|
||||
value_y = rect.y + 14
|
||||
|
||||
self._header_rect = rl.Rectangle(rect.x, rect.y, rect.width, min(rect.height, 78))
|
||||
self._value_rect = snap_rect(rl.Rectangle(rect.x + rect.width - value_pill_w - 18, value_y, value_pill_w, value_pill_h))
|
||||
content_right = self._value_rect.x - 18
|
||||
title_fs = 28
|
||||
sub_fs = 24
|
||||
bar_val_fs = 20
|
||||
|
||||
content_left = rect.x + 24
|
||||
content_width = max(120.0, rect.width - 48)
|
||||
|
||||
content_width = max(120.0, content_right - content_left)
|
||||
|
||||
title_y = rect.y + 14
|
||||
title_h = 28
|
||||
title_y = rect.y + 10
|
||||
title_h = 30
|
||||
gui_label(rl.Rectangle(content_left, title_y, content_width, title_h), self._title, title_fs, self._style.title_color, FontWeight.MEDIUM)
|
||||
|
||||
sub_y = rect.y + 44
|
||||
sub_h = 28
|
||||
if self._subtitle:
|
||||
sub_y = rect.y + 44
|
||||
sub_h = 22
|
||||
gui_label(rl.Rectangle(content_left, sub_y, content_width, sub_h), self._subtitle, sub_fs, self._style.subtitle_color, FontWeight.NORMAL)
|
||||
|
||||
pill_fill = rl.Color(255, 255, 255, 5)
|
||||
pill_border = rl.Color(255, 255, 255, 14)
|
||||
if active:
|
||||
pill_fill = mix_colors(rl.Color(18, 22, 28, 255), self._color, 0.20, alpha=255)
|
||||
pill_border = with_alpha(self._color, 64)
|
||||
draw_rounded_fill(self._value_rect, pill_fill, radius_px=16)
|
||||
draw_rounded_stroke(self._value_rect, pill_border, radius_px=16)
|
||||
val_text_y = self._value_rect.y + (self._value_rect.height - val_fs) / 2 - 2
|
||||
bar_h = 30
|
||||
bar_y = (sub_y + sub_h + 6) if self._subtitle else (title_y + title_h + 8)
|
||||
bar_rect = snap_rect(rl.Rectangle(content_left, bar_y, rect.x + rect.width - 24 - content_left, bar_h))
|
||||
self._progress_bar_rect = bar_rect
|
||||
self._header_rect = rl.Rectangle(rect.x, rect.y, rect.width, min(rect.height, bar_y + bar_h - rect.y))
|
||||
|
||||
draw_rounded_fill(bar_rect, rl.Color(255, 255, 255, 8), radius_px=bar_h // 2)
|
||||
draw_rounded_stroke(bar_rect, rl.Color(255, 255, 255, 14), radius_px=bar_h // 2)
|
||||
|
||||
fill_frac = self._scrubber._value_fraction(self._current_value())
|
||||
if fill_frac > 0:
|
||||
fill_rect = snap_rect(rl.Rectangle(bar_rect.x, bar_rect.y, max(1.0, bar_rect.width * fill_frac), bar_h))
|
||||
draw_rounded_fill(fill_rect, with_alpha(self._color, 180 if active else 120), radius_px=bar_h // 2)
|
||||
|
||||
draw_text_fit_common(
|
||||
self._font_value,
|
||||
self.formatted_value(),
|
||||
rl.Vector2(self._value_rect.x + 10, val_text_y),
|
||||
max(1.0, self._value_rect.width - 20),
|
||||
val_fs,
|
||||
rl.Vector2(bar_rect.x + 12, bar_rect.y + (bar_h - bar_val_fs) / 2),
|
||||
max(1.0, bar_rect.width - 24),
|
||||
bar_val_fs,
|
||||
align_center=True,
|
||||
color=self._style.title_color,
|
||||
)
|
||||
|
||||
hint_h = 8
|
||||
value_bottom = self._value_rect.y + self._value_rect.height
|
||||
gap_below = (rect.y + rect.height) - value_bottom
|
||||
hint_y = value_bottom + gap_below / 2 - hint_h / 2
|
||||
self._hint_rect = snap_rect(rl.Rectangle(content_left, hint_y, rect.x + rect.width - 24 - content_left, hint_h + 4))
|
||||
hint_track = snap_rect(rl.Rectangle(self._hint_rect.x, self._hint_rect.y + 2, self._hint_rect.width, hint_h))
|
||||
rl.draw_rectangle_rounded(hint_track, 1.0, 10, rl.Color(255, 255, 255, 10))
|
||||
fill_w = hint_track.width * self._scrubber._value_fraction(self._current_value())
|
||||
if fill_w > 0:
|
||||
rl.draw_rectangle_rounded(snap_rect(rl.Rectangle(hint_track.x, hint_track.y, fill_w, hint_track.height)), 1.0, 10, with_alpha(self._color, 180 if active else 120))
|
||||
|
||||
if not active:
|
||||
return
|
||||
|
||||
tray_alpha = max(0, min(255, int(255 * self._focus_progress)))
|
||||
tray_top = rect.y + 92 - (1.0 - self._focus_progress) * 6
|
||||
tray_top = self._progress_bar_rect.y + self._progress_bar_rect.height + 10
|
||||
current_y = tray_top
|
||||
self._preset_rects.clear()
|
||||
|
||||
@@ -3066,7 +3095,7 @@ class AetherSettingsView(PanelManagerView):
|
||||
if not self._has_header:
|
||||
return 0.0
|
||||
if self._parent_toggle:
|
||||
h = max(42.0, 40.0) # toggle (42px at header top) vs title area (32px + 8px gap)
|
||||
h = max(float(AETHER_LIST_METRICS.toggle_height), 54.0) # toggle vs title(46px + 8px gap)
|
||||
subtitle_text = tr(self._parent_toggle.subtitle) if self._parent_toggle.subtitle else ""
|
||||
if self._header_subtitle:
|
||||
subtitle_text = tr(self._header_subtitle)
|
||||
@@ -3074,18 +3103,18 @@ class AetherSettingsView(PanelManagerView):
|
||||
toggle_take = AETHER_LIST_METRICS.toggle_width + AETHER_LIST_METRICS.toggle_right_inset + 16
|
||||
col_w = max(100.0, content_width + AETHER_LIST_METRICS.content_right_gutter - toggle_take)
|
||||
desc_font = gui_app.font(FontWeight.NORMAL)
|
||||
desc_lines = wrap_text(desc_font, subtitle_text, col_w, 20, max_lines=4)
|
||||
h += len(desc_lines) * 24.0 + 12.0
|
||||
desc_lines = wrap_text(desc_font, subtitle_text, col_w, 29, max_lines=4)
|
||||
h += len(desc_lines) * PANEL_HEADER_SUBTITLE_LINE_HEIGHT + 12.0
|
||||
h += SECTION_GAP
|
||||
return h
|
||||
h = 40.0 # title (32px) + inner gap (8px)
|
||||
h = 54.0 # title (46px) + inner gap (8px)
|
||||
if self._header_subtitle:
|
||||
subtitle_text = tr(self._header_subtitle)
|
||||
if subtitle_text:
|
||||
desc_font = gui_app.font(FontWeight.NORMAL)
|
||||
col_w = (content_width - self.COLUMN_GAP) / 2 if self._uses_two_columns(content_width) else content_width
|
||||
desc_lines = wrap_text(desc_font, subtitle_text, col_w, 20, max_lines=4)
|
||||
h += len(desc_lines) * 24.0 + 12.0
|
||||
desc_lines = wrap_text(desc_font, subtitle_text, col_w, 29, max_lines=4)
|
||||
h += len(desc_lines) * PANEL_HEADER_SUBTITLE_LINE_HEIGHT + 12.0
|
||||
h += SECTION_GAP
|
||||
return h
|
||||
|
||||
@@ -3344,7 +3373,7 @@ class AetherSettingsView(PanelManagerView):
|
||||
is_last=is_last,
|
||||
action_pill=True,
|
||||
title_size=34, subtitle_size=22,
|
||||
action_pill_height=44, action_text_size=18,
|
||||
action_pill_height=AETHER_LIST_METRICS.toggle_height, action_text_size=24,
|
||||
action_text_color=action_text_color,
|
||||
action_fill=action_fill,
|
||||
action_border=action_border,
|
||||
@@ -4031,7 +4060,7 @@ class HubTile(AetherTile):
|
||||
self.desc = desc
|
||||
self.custom_icon_key = icon_key if icon_key in ("sound", "steering", "navigate", "system", "display", "vehicle", "road", "aicar") else None
|
||||
self._icon = None
|
||||
self._font_title = gui_app.font(FontWeight.BOLD)
|
||||
self._font_title = gui_app.font(FontWeight.MEDIUM)
|
||||
self._font_desc = gui_app.font(FontWeight.MEDIUM)
|
||||
|
||||
def _render(self, rect: rl.Rectangle):
|
||||
@@ -4048,7 +4077,7 @@ class HubTile(AetherTile):
|
||||
text_scale = max(0.82, min(1.12, min(rw / 360.0, rh / 205.0)))
|
||||
gap = SPACING.line_gap
|
||||
|
||||
title_size = max(58, int(round(64 * text_scale)))
|
||||
title_size = max(44, int(round(50 * text_scale)))
|
||||
desc_to_render = status_text
|
||||
desc_size = max(46, int(round(52 * text_scale))) if desc_to_render else 0
|
||||
|
||||
|
||||
@@ -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"),
|
||||
@@ -353,6 +358,11 @@ class StarPilotAppearanceLayout(_SettingsPage):
|
||||
get_state=lambda: self._params.get_bool("StoppedTimer"),
|
||||
set_state=lambda s: self._params.put_bool("StoppedTimer", s),
|
||||
visible=hud_on),
|
||||
SettingRow("ShowCSCStatus", "toggle", tr_noop("CSC Status Widget"),
|
||||
subtitle=tr_noop("Show the Curve Speed Controller target speed and ambient border glow."),
|
||||
get_state=lambda: self._params.get_bool("ShowCSCStatus"),
|
||||
set_state=lambda s: self._params.put_bool("ShowCSCStatus", s),
|
||||
visible=hud_on),
|
||||
]
|
||||
|
||||
# ═══ 3. Screen Declutter & Visibility ═══
|
||||
|
||||
@@ -452,7 +452,7 @@ class ConditionalDriveModeView(PanelManagerView):
|
||||
|
||||
max_container_h = available_h
|
||||
|
||||
left_row_h = max(80.0, (max_container_h - 16.0) / max(1, len(keys)))
|
||||
left_row_h = max(95.0, (max_container_h - 16.0) / max(1, len(keys)))
|
||||
for key in keys:
|
||||
self._adjustor_rows[key].custom_row_height = left_row_h
|
||||
|
||||
@@ -502,7 +502,7 @@ class ConditionalDriveModeView(PanelManagerView):
|
||||
|
||||
def _draw_adjustors(self, y: float, x: float, width: float, keys: list[str]):
|
||||
draw_list_group_shell(rl.Rectangle(x, y, width, self._left_container_h), style=PANEL_STYLE)
|
||||
current_y = y + 8
|
||||
current_y = y + 4
|
||||
for index, key in enumerate(keys):
|
||||
adjustor = self._adjustor_rows[key]
|
||||
row_h = adjustor.measure_height(width)
|
||||
@@ -761,11 +761,6 @@ class StarPilotLongitudinalLayout(_SettingsPage):
|
||||
|
||||
# ── 4. Adaptive Speed Controls Rows (CES + CSC + CCM) ──
|
||||
self._curve_speed_controller_rows = [
|
||||
SettingRow("ShowCSCStatus", "toggle", tr_noop("Status Widget"),
|
||||
subtitle=tr_noop("Show the Curve Speed Controller ambient effect on the driving screen."),
|
||||
get_state=lambda: self._params.get_bool("ShowCSCStatus"),
|
||||
set_state=lambda s: self._params.put_bool("ShowCSCStatus", s),
|
||||
visible=csc_on),
|
||||
SettingRow("CalibratedLatAccel", "value", tr_noop("Calibrated Lateral Accel"),
|
||||
subtitle=tr_noop("The learned lateral acceleration from collected driving data. Higher values allow faster cornering."),
|
||||
get_value=lambda: f"{self._params_memory.get_float('CalibratedLateralAcceleration'):.2f} m/s",
|
||||
@@ -920,13 +915,9 @@ class StarPilotLongitudinalLayout(_SettingsPage):
|
||||
self._sub_panels["ce"] = ConditionalDriveModeView(self)
|
||||
|
||||
|
||||
csc_rows = self._curve_speed_controller_rows
|
||||
self._sub_panels["csc"] = AetherSettingsView(
|
||||
self,
|
||||
[
|
||||
SettingSection(tr("Curve Speed Controller"), [x for x in csc_rows if x.type != "toggle"], column_pair="1"),
|
||||
SettingSection(tr("Curve Speed Controller"), [x for x in csc_rows if x.type == "toggle"], column_pair="1"),
|
||||
],
|
||||
[SettingSection(tr("Curve Speed Controller"), self._curve_speed_controller_rows)],
|
||||
header_title=tr("Curve Speed Controller"),
|
||||
header_subtitle=tr("Configure speed control on curves and reset collected calibration data."),
|
||||
parent_toggle=pt_csc,
|
||||
|
||||
@@ -248,14 +248,14 @@ class SoundsManagerView(PanelManagerView):
|
||||
else:
|
||||
available_container_h = 0.0
|
||||
|
||||
left_available_for_rows = available_container_h - 20.0 - 16.0 - hdr_h
|
||||
left_available_for_rows = available_container_h - 12.0 - 4.0 - hdr_h
|
||||
left_row_h = max(80.0, min(107.0, left_available_for_rows / (len(self._controller.VOLUME_KEYS) + 1)))
|
||||
for key in self._controller.VOLUME_KEYS:
|
||||
self._adjustor_rows[key].custom_row_height = left_row_h
|
||||
self._adjustor_rows[self._controller.COOLDOWN_KEY].custom_row_height = left_row_h
|
||||
|
||||
left_content_h = (len(self._controller.VOLUME_KEYS) + 1) * left_row_h + 20 + 16 + hdr_h
|
||||
tiles_needed_h = self.measure_page_grid_height(self._toggle_grid, col_width - 24) + 24 + 8 + hdr_h
|
||||
left_content_h = (len(self._controller.VOLUME_KEYS) + 1) * left_row_h + 12 + 4 + hdr_h
|
||||
tiles_needed_h = self.measure_page_grid_height(self._toggle_grid, col_width - 24) + 24 + 4 + hdr_h
|
||||
max_content_h = max(left_content_h, tiles_needed_h)
|
||||
|
||||
self._left_container_h = max_content_h
|
||||
@@ -289,23 +289,23 @@ class SoundsManagerView(PanelManagerView):
|
||||
style=PANEL_STYLE
|
||||
)
|
||||
|
||||
current_y = y + 8
|
||||
current_y = y + 4
|
||||
current_y = draw_group_header(x + 24, current_y, width - 48, tr("VOLUME"))
|
||||
|
||||
label_rect = rl.Rectangle(x + 24, current_y - GROUP_HEADER_HEIGHT - GROUP_HEADER_LINE_GAP - GROUP_HEADER_GAP, width - 48, GROUP_HEADER_HEIGHT)
|
||||
gui_label(label_rect, tr("Reset All"), 18, AetherListColors.MUTED, FontWeight.NORMAL,
|
||||
gui_label(label_rect, tr("Reset All"), 20, AetherListColors.MUTED, FontWeight.NORMAL,
|
||||
alignment=rl.GuiTextAlignment.TEXT_ALIGN_RIGHT)
|
||||
self._reset_rect = rl.Rectangle(label_rect.x + label_rect.width - 80, label_rect.y, 80, 45)
|
||||
self._interactive_rects["action:restore_defaults"] = self._reset_rect
|
||||
for i, (label, keys) in enumerate(groups):
|
||||
if label is not None:
|
||||
divider_h = 4
|
||||
divider_h = 3
|
||||
divider_color = rl.Color(173, 78, 90, 30) if i == 1 else rl.Color(139, 92, 246, 25)
|
||||
rl.draw_rectangle_rec(
|
||||
rl.Rectangle(x + 24, current_y, width - 48, divider_h),
|
||||
divider_color
|
||||
)
|
||||
current_y += divider_h + 6
|
||||
current_y += divider_h + 3
|
||||
for index, key in enumerate(keys):
|
||||
adjustor = self._adjustor_rows[key]
|
||||
row_h = adjustor.measure_height(width)
|
||||
@@ -317,7 +317,7 @@ class SoundsManagerView(PanelManagerView):
|
||||
|
||||
def _draw_utility_column(self, y: float, x: float, width: float):
|
||||
draw_list_group_shell(rl.Rectangle(x, y, width, self._tiles_container_h), style=PANEL_STYLE)
|
||||
header_y = draw_group_header(x + 24, y + 8, width - 48, tr("ALERTS"))
|
||||
header_y = draw_group_header(x + 24, y + 4, width - 48, tr("ALERTS"))
|
||||
avail_h = self._tiles_container_h - (header_y - y)
|
||||
self._render_page_grid(self._toggle_grid, rl.Rectangle(x + 12, header_y, width - 24, max(0.0, avail_h - 12)))
|
||||
|
||||
|
||||
@@ -482,8 +482,8 @@ class SystemSettingsManagerView(PanelManagerView):
|
||||
|
||||
def _measure_content_height(self, width: float) -> float:
|
||||
hdr_h = GROUP_HEADER_HEIGHT + GROUP_HEADER_LINE_GAP + GROUP_HEADER_GAP
|
||||
display_h = self._slider_section_height(self._display_slider_keys, width) + 8 + hdr_h
|
||||
power_h = self._slider_section_height(self._power_slider_keys, width) + 8 + hdr_h
|
||||
display_h = self._slider_section_height(self._display_slider_keys, width) + 4 + hdr_h
|
||||
power_h = self._slider_section_height(self._power_slider_keys, width) + 4 + hdr_h
|
||||
|
||||
if self._uses_two_columns(width):
|
||||
column_w = self._column_width(width)
|
||||
@@ -496,7 +496,7 @@ class SystemSettingsManagerView(PanelManagerView):
|
||||
display_container_h = self._slider_section_height(self._display_slider_keys, column_w)
|
||||
power_container_h = self._slider_section_height(self._power_slider_keys, column_w)
|
||||
|
||||
left_overhead = 8.0 + 2 * (GROUP_HEADER_HEIGHT + GROUP_HEADER_LINE_GAP + GROUP_HEADER_GAP) + SECTION_GAP
|
||||
left_overhead = 4.0 + 2 * (GROUP_HEADER_HEIGHT + GROUP_HEADER_LINE_GAP + GROUP_HEADER_GAP) + SECTION_GAP
|
||||
left_natural_content_h = left_overhead + display_container_h + power_container_h
|
||||
|
||||
tiles_content_h = self.measure_page_grid_height(self._connectivity_tile_grid, column_w - 24)
|
||||
@@ -548,7 +548,7 @@ class SystemSettingsManagerView(PanelManagerView):
|
||||
|
||||
draw_list_group_shell(rl.Rectangle(x, y, column_w, adj_container_h), style=PANEL_STYLE)
|
||||
|
||||
current_y = y + 8
|
||||
current_y = y + 4
|
||||
current_y = draw_group_header(x + 24, current_y, column_w - 48, tr("DISPLAY"))
|
||||
for index, key in enumerate(self._display_slider_keys):
|
||||
current_y = self._draw_slider_row(rl.Rectangle(x, current_y, column_w, 0), key, is_last=index == len(self._display_slider_keys) - 1)
|
||||
@@ -575,10 +575,10 @@ class SystemSettingsManagerView(PanelManagerView):
|
||||
self._render_page_grid(self._connectivity_tile_grid, rl.Rectangle(x + 12, y + 12, width - 24, tiles_content_h))
|
||||
|
||||
def _draw_slider_section(self, y: float, x: float, width: float, title: str, keys: list[str]) -> float:
|
||||
group_h = self._slider_section_height(keys, width) + 8 + GROUP_HEADER_HEIGHT + GROUP_HEADER_LINE_GAP + GROUP_HEADER_GAP
|
||||
group_h = self._slider_section_height(keys, width) + 4 + GROUP_HEADER_HEIGHT + GROUP_HEADER_LINE_GAP + GROUP_HEADER_GAP
|
||||
group_rect = rl.Rectangle(x, y, width, group_h)
|
||||
draw_list_group_shell(group_rect, style=PANEL_STYLE)
|
||||
current_y = group_rect.y + 8
|
||||
current_y = group_rect.y + 4
|
||||
current_y = draw_group_header(x + 24, current_y, width - 48, title)
|
||||
for index, key in enumerate(keys):
|
||||
current_y = self._draw_slider_row(rl.Rectangle(group_rect.x, current_y, group_rect.width, 0), key, is_last=index == len(keys) - 1)
|
||||
|
||||
@@ -177,9 +177,9 @@ class VehicleSettingsManagerView(PanelManagerView):
|
||||
|
||||
def _draw_section(self, y: float, x: float, width: float, title: str, rows: list[SettingRow], row_height: float = ROW_HEIGHT) -> float:
|
||||
hdr_oh = GROUP_HEADER_HEIGHT + GROUP_HEADER_LINE_GAP + GROUP_HEADER_GAP
|
||||
group_h = len(rows) * row_height + hdr_oh + 8
|
||||
group_h = len(rows) * row_height + hdr_oh + 4
|
||||
draw_list_group_shell(rl.Rectangle(x, y, width, group_h), style=PANEL_STYLE)
|
||||
current_y = y + 8
|
||||
current_y = y + 4
|
||||
current_y = draw_group_header(x + 24, current_y, width - 48, tr(title))
|
||||
for i, row in enumerate(rows):
|
||||
self._draw_row(rl.Rectangle(x, current_y, width, row_height), row, i == len(rows) - 1)
|
||||
@@ -196,7 +196,7 @@ class VehicleSettingsManagerView(PanelManagerView):
|
||||
rx = rect.x + col_w + self.COLUMN_GAP
|
||||
|
||||
draw_list_group_shell(rl.Rectangle(rect.x, y, col_w, self._container_h), style=PANEL_STYLE)
|
||||
row_y = y + 8
|
||||
row_y = y + 4
|
||||
row_y = draw_group_header(rect.x + 24, row_y, col_w - 48, tr("Vehicle Identity"))
|
||||
for i, row in enumerate(identity_rows):
|
||||
self._draw_row(rl.Rectangle(rect.x, row_y, col_w, self._left_row_height),
|
||||
@@ -212,7 +212,7 @@ class VehicleSettingsManagerView(PanelManagerView):
|
||||
|
||||
if self._toggle_grid.tiles:
|
||||
draw_list_group_shell(rl.Rectangle(rx, y, col_w, self._container_h), style=PANEL_STYLE)
|
||||
tile_y = y + 8
|
||||
tile_y = y + 4
|
||||
tile_y = draw_group_header(rx + 24, tile_y, col_w - 48, tr("Features"))
|
||||
avail_h = self._container_h - (tile_y - y)
|
||||
self._render_page_grid(self._toggle_grid, rl.Rectangle(rx + 12, tile_y, col_w - 24, max(0.0, avail_h - 12)))
|
||||
@@ -227,9 +227,9 @@ class VehicleSettingsManagerView(PanelManagerView):
|
||||
avail = width - 24
|
||||
th = self.measure_page_grid_height(self._toggle_grid, avail)
|
||||
hdr_oh = GROUP_HEADER_HEIGHT + GROUP_HEADER_LINE_GAP + GROUP_HEADER_GAP
|
||||
group_h = th + 24 + 8 + hdr_oh
|
||||
group_h = th + 24 + 4 + hdr_oh
|
||||
draw_list_group_shell(rl.Rectangle(rect.x, y, width, group_h), style=PANEL_STYLE)
|
||||
features_y = y + 8
|
||||
features_y = y + 4
|
||||
features_y = draw_group_header(rect.x + 24, features_y, width - 48, tr("Features"))
|
||||
self._render_page_grid(self._toggle_grid, rl.Rectangle(rect.x + 12, features_y, avail, max(0.0, group_h - (features_y - y) - 12)))
|
||||
|
||||
@@ -251,7 +251,7 @@ class VehicleSettingsManagerView(PanelManagerView):
|
||||
|
||||
if self._uses_two_columns(width):
|
||||
hdr_oh = GROUP_HEADER_HEIGHT + GROUP_HEADER_LINE_GAP + GROUP_HEADER_GAP
|
||||
subsection_overhead = hdr_oh + 8
|
||||
subsection_overhead = hdr_oh + 4
|
||||
if steering_rows:
|
||||
subsection_overhead += hdr_oh
|
||||
|
||||
@@ -273,10 +273,10 @@ class VehicleSettingsManagerView(PanelManagerView):
|
||||
|
||||
self._left_row_height = ROW_HEIGHT
|
||||
hdr_oh = GROUP_HEADER_HEIGHT + GROUP_HEADER_LINE_GAP + GROUP_HEADER_GAP
|
||||
identity_natural_h = hdr_oh + 8 + len(identity_rows) * ROW_HEIGHT
|
||||
steering_natural_h = hdr_oh + 8 + len(steering_rows) * ROW_HEIGHT
|
||||
identity_natural_h = hdr_oh + 4 + len(identity_rows) * ROW_HEIGHT
|
||||
steering_natural_h = hdr_oh + 4 + len(steering_rows) * ROW_HEIGHT
|
||||
left_natural_h = identity_natural_h + SECTION_GAP + steering_natural_h
|
||||
tiles_overhead = 8 + hdr_oh + 24 if tiles_h else 0
|
||||
tiles_overhead = 4 + hdr_oh + 24 if tiles_h else 0
|
||||
return left_natural_h + tiles_h + tiles_overhead
|
||||
|
||||
def _build_driving_toggles(self) -> list[dict]:
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -16,10 +27,9 @@ def get_border_width(base_width: int, params: Params | None = None) -> int:
|
||||
return max(1, int(round(base_width * scale / 100.0)))
|
||||
|
||||
|
||||
def lead_indicator_enabled(params: Params | None = None) -> bool:
|
||||
def lead_indicator_enabled(params: Params | None = None, *, hide_by_default: bool = False) -> bool:
|
||||
active_params = params if params is not None else Params()
|
||||
|
||||
return (
|
||||
active_params.get_bool("LeadIndicator", default=False)
|
||||
and not active_params.get_bool("HideLeadMarker", default=False)
|
||||
)
|
||||
if active_params.get("HideLeadMarker") is None:
|
||||
return not hide_by_default
|
||||
return not active_params.get_bool("HideLeadMarker")
|
||||
|
||||
@@ -47,11 +47,10 @@ class LeadIndicatorBigButton(BigToggle):
|
||||
|
||||
def _handle_mouse_release(self, mouse_pos):
|
||||
super()._handle_mouse_release(mouse_pos)
|
||||
self.params.put_bool("LeadIndicator", self._checked)
|
||||
self.params.put_bool("HideLeadMarker", not self._checked)
|
||||
|
||||
def refresh(self):
|
||||
self.set_checked(lead_indicator_enabled(self.params))
|
||||
self.set_checked(lead_indicator_enabled(self.params, hide_by_default=True))
|
||||
|
||||
|
||||
class VisualsLayoutMici(NavScroller):
|
||||
@@ -61,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")
|
||||
@@ -73,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,
|
||||
|
||||
@@ -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,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:
|
||||
|
||||
@@ -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
|
||||
@@ -129,7 +128,7 @@ class ModelRenderer(Widget):
|
||||
model = sm['modelV2']
|
||||
radar_state = sm['radarState'] if sm.valid['radarState'] else None
|
||||
lead_one = radar_state.leadOne if radar_state else None
|
||||
render_lead_indicator = self._longitudinal_control and radar_state is not None and lead_indicator_enabled(self._params)
|
||||
render_lead_indicator = self._longitudinal_control and radar_state is not None and lead_indicator_enabled(self._params, hide_by_default=True)
|
||||
|
||||
# Update model data when needed
|
||||
model_updated = sm.updated['modelV2']
|
||||
|
||||
@@ -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
-5
@@ -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)))
|
||||
@@ -15,6 +15,12 @@ class FakeParams:
|
||||
def __init__(self, values=None):
|
||||
self.values = values or {}
|
||||
|
||||
def get(self, key, block=False, return_default=False, encoding=None, default=None):
|
||||
if key not in self.values:
|
||||
return None
|
||||
v = self.values[key]
|
||||
return v if isinstance(v, bytes) else str(v).encode()
|
||||
|
||||
def get_bool(self, key, block=False, default=False):
|
||||
value = self.values.get(key, default)
|
||||
if isinstance(value, bool):
|
||||
@@ -23,14 +29,14 @@ class FakeParams:
|
||||
|
||||
|
||||
class TestStarPilotVisuals(unittest.TestCase):
|
||||
def test_lead_indicator_disabled_by_default(self):
|
||||
self.assertFalse(lead_indicator_enabled(FakeParams()))
|
||||
def test_lead_indicator_enabled_by_default(self):
|
||||
self.assertTrue(lead_indicator_enabled(FakeParams()))
|
||||
|
||||
def test_lead_indicator_can_be_enabled(self):
|
||||
self.assertTrue(lead_indicator_enabled(FakeParams({"LeadIndicator": True})))
|
||||
def test_hide_lead_marker_disables(self):
|
||||
self.assertFalse(lead_indicator_enabled(FakeParams({"HideLeadMarker": True})))
|
||||
|
||||
def test_hide_lead_marker_suppresses_lead_indicator(self):
|
||||
self.assertFalse(lead_indicator_enabled(FakeParams({"LeadIndicator": True, "HideLeadMarker": True})))
|
||||
def test_hide_by_default_returns_false_when_unset(self):
|
||||
self.assertFalse(lead_indicator_enabled(FakeParams(), hide_by_default=True))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Binary file not shown.
@@ -2557,15 +2557,11 @@ def _get_lead_indicator_enabled(defaults_lookup=None):
|
||||
if defaults_lookup is None:
|
||||
defaults_lookup = _get_default_param_values()
|
||||
|
||||
lead_raw = _safe_params_get_live_raw("LeadIndicator")
|
||||
if _is_blank_param_raw(lead_raw):
|
||||
lead_raw = defaults_lookup.get("LeadIndicator", "0")
|
||||
|
||||
hide_raw = _safe_params_get_live_raw("HideLeadMarker")
|
||||
if _is_blank_param_raw(hide_raw):
|
||||
hide_raw = defaults_lookup.get("HideLeadMarker", "0")
|
||||
|
||||
return _coerce_param_value(lead_raw, bool) and not _coerce_param_value(hide_raw, bool)
|
||||
return not _coerce_param_value(hide_raw, bool)
|
||||
|
||||
|
||||
def _get_custom_accel_profile_initialized():
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user