mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-10-19 22:43:43 +08:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5ab7566394 | |||
| 273903b26e |
@@ -41,326 +41,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_3585265450871354510) {
|
||||
out_3585265450871354510[0] = delta_x[0] + nom_x[0];
|
||||
out_3585265450871354510[1] = delta_x[1] + nom_x[1];
|
||||
out_3585265450871354510[2] = delta_x[2] + nom_x[2];
|
||||
out_3585265450871354510[3] = delta_x[3] + nom_x[3];
|
||||
out_3585265450871354510[4] = delta_x[4] + nom_x[4];
|
||||
out_3585265450871354510[5] = delta_x[5] + nom_x[5];
|
||||
out_3585265450871354510[6] = delta_x[6] + nom_x[6];
|
||||
out_3585265450871354510[7] = delta_x[7] + nom_x[7];
|
||||
out_3585265450871354510[8] = delta_x[8] + nom_x[8];
|
||||
void err_fun(double *nom_x, double *delta_x, double *out_7360625163823445495) {
|
||||
out_7360625163823445495[0] = delta_x[0] + nom_x[0];
|
||||
out_7360625163823445495[1] = delta_x[1] + nom_x[1];
|
||||
out_7360625163823445495[2] = delta_x[2] + nom_x[2];
|
||||
out_7360625163823445495[3] = delta_x[3] + nom_x[3];
|
||||
out_7360625163823445495[4] = delta_x[4] + nom_x[4];
|
||||
out_7360625163823445495[5] = delta_x[5] + nom_x[5];
|
||||
out_7360625163823445495[6] = delta_x[6] + nom_x[6];
|
||||
out_7360625163823445495[7] = delta_x[7] + nom_x[7];
|
||||
out_7360625163823445495[8] = delta_x[8] + nom_x[8];
|
||||
}
|
||||
void inv_err_fun(double *nom_x, double *true_x, double *out_4534440969468340130) {
|
||||
out_4534440969468340130[0] = -nom_x[0] + true_x[0];
|
||||
out_4534440969468340130[1] = -nom_x[1] + true_x[1];
|
||||
out_4534440969468340130[2] = -nom_x[2] + true_x[2];
|
||||
out_4534440969468340130[3] = -nom_x[3] + true_x[3];
|
||||
out_4534440969468340130[4] = -nom_x[4] + true_x[4];
|
||||
out_4534440969468340130[5] = -nom_x[5] + true_x[5];
|
||||
out_4534440969468340130[6] = -nom_x[6] + true_x[6];
|
||||
out_4534440969468340130[7] = -nom_x[7] + true_x[7];
|
||||
out_4534440969468340130[8] = -nom_x[8] + true_x[8];
|
||||
void inv_err_fun(double *nom_x, double *true_x, double *out_8413491231423970122) {
|
||||
out_8413491231423970122[0] = -nom_x[0] + true_x[0];
|
||||
out_8413491231423970122[1] = -nom_x[1] + true_x[1];
|
||||
out_8413491231423970122[2] = -nom_x[2] + true_x[2];
|
||||
out_8413491231423970122[3] = -nom_x[3] + true_x[3];
|
||||
out_8413491231423970122[4] = -nom_x[4] + true_x[4];
|
||||
out_8413491231423970122[5] = -nom_x[5] + true_x[5];
|
||||
out_8413491231423970122[6] = -nom_x[6] + true_x[6];
|
||||
out_8413491231423970122[7] = -nom_x[7] + true_x[7];
|
||||
out_8413491231423970122[8] = -nom_x[8] + true_x[8];
|
||||
}
|
||||
void H_mod_fun(double *state, double *out_7815971298073658297) {
|
||||
out_7815971298073658297[0] = 1.0;
|
||||
out_7815971298073658297[1] = 0.0;
|
||||
out_7815971298073658297[2] = 0.0;
|
||||
out_7815971298073658297[3] = 0.0;
|
||||
out_7815971298073658297[4] = 0.0;
|
||||
out_7815971298073658297[5] = 0.0;
|
||||
out_7815971298073658297[6] = 0.0;
|
||||
out_7815971298073658297[7] = 0.0;
|
||||
out_7815971298073658297[8] = 0.0;
|
||||
out_7815971298073658297[9] = 0.0;
|
||||
out_7815971298073658297[10] = 1.0;
|
||||
out_7815971298073658297[11] = 0.0;
|
||||
out_7815971298073658297[12] = 0.0;
|
||||
out_7815971298073658297[13] = 0.0;
|
||||
out_7815971298073658297[14] = 0.0;
|
||||
out_7815971298073658297[15] = 0.0;
|
||||
out_7815971298073658297[16] = 0.0;
|
||||
out_7815971298073658297[17] = 0.0;
|
||||
out_7815971298073658297[18] = 0.0;
|
||||
out_7815971298073658297[19] = 0.0;
|
||||
out_7815971298073658297[20] = 1.0;
|
||||
out_7815971298073658297[21] = 0.0;
|
||||
out_7815971298073658297[22] = 0.0;
|
||||
out_7815971298073658297[23] = 0.0;
|
||||
out_7815971298073658297[24] = 0.0;
|
||||
out_7815971298073658297[25] = 0.0;
|
||||
out_7815971298073658297[26] = 0.0;
|
||||
out_7815971298073658297[27] = 0.0;
|
||||
out_7815971298073658297[28] = 0.0;
|
||||
out_7815971298073658297[29] = 0.0;
|
||||
out_7815971298073658297[30] = 1.0;
|
||||
out_7815971298073658297[31] = 0.0;
|
||||
out_7815971298073658297[32] = 0.0;
|
||||
out_7815971298073658297[33] = 0.0;
|
||||
out_7815971298073658297[34] = 0.0;
|
||||
out_7815971298073658297[35] = 0.0;
|
||||
out_7815971298073658297[36] = 0.0;
|
||||
out_7815971298073658297[37] = 0.0;
|
||||
out_7815971298073658297[38] = 0.0;
|
||||
out_7815971298073658297[39] = 0.0;
|
||||
out_7815971298073658297[40] = 1.0;
|
||||
out_7815971298073658297[41] = 0.0;
|
||||
out_7815971298073658297[42] = 0.0;
|
||||
out_7815971298073658297[43] = 0.0;
|
||||
out_7815971298073658297[44] = 0.0;
|
||||
out_7815971298073658297[45] = 0.0;
|
||||
out_7815971298073658297[46] = 0.0;
|
||||
out_7815971298073658297[47] = 0.0;
|
||||
out_7815971298073658297[48] = 0.0;
|
||||
out_7815971298073658297[49] = 0.0;
|
||||
out_7815971298073658297[50] = 1.0;
|
||||
out_7815971298073658297[51] = 0.0;
|
||||
out_7815971298073658297[52] = 0.0;
|
||||
out_7815971298073658297[53] = 0.0;
|
||||
out_7815971298073658297[54] = 0.0;
|
||||
out_7815971298073658297[55] = 0.0;
|
||||
out_7815971298073658297[56] = 0.0;
|
||||
out_7815971298073658297[57] = 0.0;
|
||||
out_7815971298073658297[58] = 0.0;
|
||||
out_7815971298073658297[59] = 0.0;
|
||||
out_7815971298073658297[60] = 1.0;
|
||||
out_7815971298073658297[61] = 0.0;
|
||||
out_7815971298073658297[62] = 0.0;
|
||||
out_7815971298073658297[63] = 0.0;
|
||||
out_7815971298073658297[64] = 0.0;
|
||||
out_7815971298073658297[65] = 0.0;
|
||||
out_7815971298073658297[66] = 0.0;
|
||||
out_7815971298073658297[67] = 0.0;
|
||||
out_7815971298073658297[68] = 0.0;
|
||||
out_7815971298073658297[69] = 0.0;
|
||||
out_7815971298073658297[70] = 1.0;
|
||||
out_7815971298073658297[71] = 0.0;
|
||||
out_7815971298073658297[72] = 0.0;
|
||||
out_7815971298073658297[73] = 0.0;
|
||||
out_7815971298073658297[74] = 0.0;
|
||||
out_7815971298073658297[75] = 0.0;
|
||||
out_7815971298073658297[76] = 0.0;
|
||||
out_7815971298073658297[77] = 0.0;
|
||||
out_7815971298073658297[78] = 0.0;
|
||||
out_7815971298073658297[79] = 0.0;
|
||||
out_7815971298073658297[80] = 1.0;
|
||||
void H_mod_fun(double *state, double *out_2632326835772732722) {
|
||||
out_2632326835772732722[0] = 1.0;
|
||||
out_2632326835772732722[1] = 0.0;
|
||||
out_2632326835772732722[2] = 0.0;
|
||||
out_2632326835772732722[3] = 0.0;
|
||||
out_2632326835772732722[4] = 0.0;
|
||||
out_2632326835772732722[5] = 0.0;
|
||||
out_2632326835772732722[6] = 0.0;
|
||||
out_2632326835772732722[7] = 0.0;
|
||||
out_2632326835772732722[8] = 0.0;
|
||||
out_2632326835772732722[9] = 0.0;
|
||||
out_2632326835772732722[10] = 1.0;
|
||||
out_2632326835772732722[11] = 0.0;
|
||||
out_2632326835772732722[12] = 0.0;
|
||||
out_2632326835772732722[13] = 0.0;
|
||||
out_2632326835772732722[14] = 0.0;
|
||||
out_2632326835772732722[15] = 0.0;
|
||||
out_2632326835772732722[16] = 0.0;
|
||||
out_2632326835772732722[17] = 0.0;
|
||||
out_2632326835772732722[18] = 0.0;
|
||||
out_2632326835772732722[19] = 0.0;
|
||||
out_2632326835772732722[20] = 1.0;
|
||||
out_2632326835772732722[21] = 0.0;
|
||||
out_2632326835772732722[22] = 0.0;
|
||||
out_2632326835772732722[23] = 0.0;
|
||||
out_2632326835772732722[24] = 0.0;
|
||||
out_2632326835772732722[25] = 0.0;
|
||||
out_2632326835772732722[26] = 0.0;
|
||||
out_2632326835772732722[27] = 0.0;
|
||||
out_2632326835772732722[28] = 0.0;
|
||||
out_2632326835772732722[29] = 0.0;
|
||||
out_2632326835772732722[30] = 1.0;
|
||||
out_2632326835772732722[31] = 0.0;
|
||||
out_2632326835772732722[32] = 0.0;
|
||||
out_2632326835772732722[33] = 0.0;
|
||||
out_2632326835772732722[34] = 0.0;
|
||||
out_2632326835772732722[35] = 0.0;
|
||||
out_2632326835772732722[36] = 0.0;
|
||||
out_2632326835772732722[37] = 0.0;
|
||||
out_2632326835772732722[38] = 0.0;
|
||||
out_2632326835772732722[39] = 0.0;
|
||||
out_2632326835772732722[40] = 1.0;
|
||||
out_2632326835772732722[41] = 0.0;
|
||||
out_2632326835772732722[42] = 0.0;
|
||||
out_2632326835772732722[43] = 0.0;
|
||||
out_2632326835772732722[44] = 0.0;
|
||||
out_2632326835772732722[45] = 0.0;
|
||||
out_2632326835772732722[46] = 0.0;
|
||||
out_2632326835772732722[47] = 0.0;
|
||||
out_2632326835772732722[48] = 0.0;
|
||||
out_2632326835772732722[49] = 0.0;
|
||||
out_2632326835772732722[50] = 1.0;
|
||||
out_2632326835772732722[51] = 0.0;
|
||||
out_2632326835772732722[52] = 0.0;
|
||||
out_2632326835772732722[53] = 0.0;
|
||||
out_2632326835772732722[54] = 0.0;
|
||||
out_2632326835772732722[55] = 0.0;
|
||||
out_2632326835772732722[56] = 0.0;
|
||||
out_2632326835772732722[57] = 0.0;
|
||||
out_2632326835772732722[58] = 0.0;
|
||||
out_2632326835772732722[59] = 0.0;
|
||||
out_2632326835772732722[60] = 1.0;
|
||||
out_2632326835772732722[61] = 0.0;
|
||||
out_2632326835772732722[62] = 0.0;
|
||||
out_2632326835772732722[63] = 0.0;
|
||||
out_2632326835772732722[64] = 0.0;
|
||||
out_2632326835772732722[65] = 0.0;
|
||||
out_2632326835772732722[66] = 0.0;
|
||||
out_2632326835772732722[67] = 0.0;
|
||||
out_2632326835772732722[68] = 0.0;
|
||||
out_2632326835772732722[69] = 0.0;
|
||||
out_2632326835772732722[70] = 1.0;
|
||||
out_2632326835772732722[71] = 0.0;
|
||||
out_2632326835772732722[72] = 0.0;
|
||||
out_2632326835772732722[73] = 0.0;
|
||||
out_2632326835772732722[74] = 0.0;
|
||||
out_2632326835772732722[75] = 0.0;
|
||||
out_2632326835772732722[76] = 0.0;
|
||||
out_2632326835772732722[77] = 0.0;
|
||||
out_2632326835772732722[78] = 0.0;
|
||||
out_2632326835772732722[79] = 0.0;
|
||||
out_2632326835772732722[80] = 1.0;
|
||||
}
|
||||
void f_fun(double *state, double dt, double *out_3011916394083426809) {
|
||||
out_3011916394083426809[0] = state[0];
|
||||
out_3011916394083426809[1] = state[1];
|
||||
out_3011916394083426809[2] = state[2];
|
||||
out_3011916394083426809[3] = state[3];
|
||||
out_3011916394083426809[4] = state[4];
|
||||
out_3011916394083426809[5] = dt*(stiffness_front*(-state[2] - state[3] + state[7])*state[0]/state[1] + (-stiffness_front*state[0] - stiffness_rear*state[0])*state[5]/state[4] + ((-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/state[4] - state[4])*state[6] - 9.8100000000000005*state[8]) + state[5];
|
||||
out_3011916394083426809[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_3011916394083426809[7] = state[7];
|
||||
out_3011916394083426809[8] = state[8];
|
||||
void f_fun(double *state, double dt, double *out_8532698894052839577) {
|
||||
out_8532698894052839577[0] = state[0];
|
||||
out_8532698894052839577[1] = state[1];
|
||||
out_8532698894052839577[2] = state[2];
|
||||
out_8532698894052839577[3] = state[3];
|
||||
out_8532698894052839577[4] = state[4];
|
||||
out_8532698894052839577[5] = dt*(stiffness_front*(-state[2] - state[3] + state[7])*state[0]/state[1] + (-stiffness_front*state[0] - stiffness_rear*state[0])*state[5]/state[4] + ((-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/state[4] - state[4])*state[6] - 9.8100000000000005*state[8]) + state[5];
|
||||
out_8532698894052839577[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_8532698894052839577[7] = state[7];
|
||||
out_8532698894052839577[8] = state[8];
|
||||
}
|
||||
void F_fun(double *state, double dt, double *out_4768916904116545459) {
|
||||
out_4768916904116545459[0] = 1;
|
||||
out_4768916904116545459[1] = 0;
|
||||
out_4768916904116545459[2] = 0;
|
||||
out_4768916904116545459[3] = 0;
|
||||
out_4768916904116545459[4] = 0;
|
||||
out_4768916904116545459[5] = 0;
|
||||
out_4768916904116545459[6] = 0;
|
||||
out_4768916904116545459[7] = 0;
|
||||
out_4768916904116545459[8] = 0;
|
||||
out_4768916904116545459[9] = 0;
|
||||
out_4768916904116545459[10] = 1;
|
||||
out_4768916904116545459[11] = 0;
|
||||
out_4768916904116545459[12] = 0;
|
||||
out_4768916904116545459[13] = 0;
|
||||
out_4768916904116545459[14] = 0;
|
||||
out_4768916904116545459[15] = 0;
|
||||
out_4768916904116545459[16] = 0;
|
||||
out_4768916904116545459[17] = 0;
|
||||
out_4768916904116545459[18] = 0;
|
||||
out_4768916904116545459[19] = 0;
|
||||
out_4768916904116545459[20] = 1;
|
||||
out_4768916904116545459[21] = 0;
|
||||
out_4768916904116545459[22] = 0;
|
||||
out_4768916904116545459[23] = 0;
|
||||
out_4768916904116545459[24] = 0;
|
||||
out_4768916904116545459[25] = 0;
|
||||
out_4768916904116545459[26] = 0;
|
||||
out_4768916904116545459[27] = 0;
|
||||
out_4768916904116545459[28] = 0;
|
||||
out_4768916904116545459[29] = 0;
|
||||
out_4768916904116545459[30] = 1;
|
||||
out_4768916904116545459[31] = 0;
|
||||
out_4768916904116545459[32] = 0;
|
||||
out_4768916904116545459[33] = 0;
|
||||
out_4768916904116545459[34] = 0;
|
||||
out_4768916904116545459[35] = 0;
|
||||
out_4768916904116545459[36] = 0;
|
||||
out_4768916904116545459[37] = 0;
|
||||
out_4768916904116545459[38] = 0;
|
||||
out_4768916904116545459[39] = 0;
|
||||
out_4768916904116545459[40] = 1;
|
||||
out_4768916904116545459[41] = 0;
|
||||
out_4768916904116545459[42] = 0;
|
||||
out_4768916904116545459[43] = 0;
|
||||
out_4768916904116545459[44] = 0;
|
||||
out_4768916904116545459[45] = dt*(stiffness_front*(-state[2] - state[3] + state[7])/state[1] + (-stiffness_front - stiffness_rear)*state[5]/state[4] + (-center_to_front*stiffness_front + center_to_rear*stiffness_rear)*state[6]/state[4]);
|
||||
out_4768916904116545459[46] = -dt*stiffness_front*(-state[2] - state[3] + state[7])*state[0]/pow(state[1], 2);
|
||||
out_4768916904116545459[47] = -dt*stiffness_front*state[0]/state[1];
|
||||
out_4768916904116545459[48] = -dt*stiffness_front*state[0]/state[1];
|
||||
out_4768916904116545459[49] = dt*(-(-stiffness_front*state[0] - stiffness_rear*state[0])*state[5]/pow(state[4], 2) + (-(-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/pow(state[4], 2) - 1)*state[6]);
|
||||
out_4768916904116545459[50] = dt*(-stiffness_front*state[0] - stiffness_rear*state[0])/state[4] + 1;
|
||||
out_4768916904116545459[51] = dt*((-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/state[4] - state[4]);
|
||||
out_4768916904116545459[52] = dt*stiffness_front*state[0]/state[1];
|
||||
out_4768916904116545459[53] = -9.8100000000000005*dt;
|
||||
out_4768916904116545459[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_4768916904116545459[55] = -center_to_front*dt*stiffness_front*(-state[2] - state[3] + state[7])*state[0]/(rotational_inertia*pow(state[1], 2));
|
||||
out_4768916904116545459[56] = -center_to_front*dt*stiffness_front*state[0]/(rotational_inertia*state[1]);
|
||||
out_4768916904116545459[57] = -center_to_front*dt*stiffness_front*state[0]/(rotational_inertia*state[1]);
|
||||
out_4768916904116545459[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_4768916904116545459[59] = dt*(-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/(rotational_inertia*state[4]);
|
||||
out_4768916904116545459[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_4768916904116545459[61] = center_to_front*dt*stiffness_front*state[0]/(rotational_inertia*state[1]);
|
||||
out_4768916904116545459[62] = 0;
|
||||
out_4768916904116545459[63] = 0;
|
||||
out_4768916904116545459[64] = 0;
|
||||
out_4768916904116545459[65] = 0;
|
||||
out_4768916904116545459[66] = 0;
|
||||
out_4768916904116545459[67] = 0;
|
||||
out_4768916904116545459[68] = 0;
|
||||
out_4768916904116545459[69] = 0;
|
||||
out_4768916904116545459[70] = 1;
|
||||
out_4768916904116545459[71] = 0;
|
||||
out_4768916904116545459[72] = 0;
|
||||
out_4768916904116545459[73] = 0;
|
||||
out_4768916904116545459[74] = 0;
|
||||
out_4768916904116545459[75] = 0;
|
||||
out_4768916904116545459[76] = 0;
|
||||
out_4768916904116545459[77] = 0;
|
||||
out_4768916904116545459[78] = 0;
|
||||
out_4768916904116545459[79] = 0;
|
||||
out_4768916904116545459[80] = 1;
|
||||
void F_fun(double *state, double dt, double *out_5046006616921834778) {
|
||||
out_5046006616921834778[0] = 1;
|
||||
out_5046006616921834778[1] = 0;
|
||||
out_5046006616921834778[2] = 0;
|
||||
out_5046006616921834778[3] = 0;
|
||||
out_5046006616921834778[4] = 0;
|
||||
out_5046006616921834778[5] = 0;
|
||||
out_5046006616921834778[6] = 0;
|
||||
out_5046006616921834778[7] = 0;
|
||||
out_5046006616921834778[8] = 0;
|
||||
out_5046006616921834778[9] = 0;
|
||||
out_5046006616921834778[10] = 1;
|
||||
out_5046006616921834778[11] = 0;
|
||||
out_5046006616921834778[12] = 0;
|
||||
out_5046006616921834778[13] = 0;
|
||||
out_5046006616921834778[14] = 0;
|
||||
out_5046006616921834778[15] = 0;
|
||||
out_5046006616921834778[16] = 0;
|
||||
out_5046006616921834778[17] = 0;
|
||||
out_5046006616921834778[18] = 0;
|
||||
out_5046006616921834778[19] = 0;
|
||||
out_5046006616921834778[20] = 1;
|
||||
out_5046006616921834778[21] = 0;
|
||||
out_5046006616921834778[22] = 0;
|
||||
out_5046006616921834778[23] = 0;
|
||||
out_5046006616921834778[24] = 0;
|
||||
out_5046006616921834778[25] = 0;
|
||||
out_5046006616921834778[26] = 0;
|
||||
out_5046006616921834778[27] = 0;
|
||||
out_5046006616921834778[28] = 0;
|
||||
out_5046006616921834778[29] = 0;
|
||||
out_5046006616921834778[30] = 1;
|
||||
out_5046006616921834778[31] = 0;
|
||||
out_5046006616921834778[32] = 0;
|
||||
out_5046006616921834778[33] = 0;
|
||||
out_5046006616921834778[34] = 0;
|
||||
out_5046006616921834778[35] = 0;
|
||||
out_5046006616921834778[36] = 0;
|
||||
out_5046006616921834778[37] = 0;
|
||||
out_5046006616921834778[38] = 0;
|
||||
out_5046006616921834778[39] = 0;
|
||||
out_5046006616921834778[40] = 1;
|
||||
out_5046006616921834778[41] = 0;
|
||||
out_5046006616921834778[42] = 0;
|
||||
out_5046006616921834778[43] = 0;
|
||||
out_5046006616921834778[44] = 0;
|
||||
out_5046006616921834778[45] = dt*(stiffness_front*(-state[2] - state[3] + state[7])/state[1] + (-stiffness_front - stiffness_rear)*state[5]/state[4] + (-center_to_front*stiffness_front + center_to_rear*stiffness_rear)*state[6]/state[4]);
|
||||
out_5046006616921834778[46] = -dt*stiffness_front*(-state[2] - state[3] + state[7])*state[0]/pow(state[1], 2);
|
||||
out_5046006616921834778[47] = -dt*stiffness_front*state[0]/state[1];
|
||||
out_5046006616921834778[48] = -dt*stiffness_front*state[0]/state[1];
|
||||
out_5046006616921834778[49] = dt*(-(-stiffness_front*state[0] - stiffness_rear*state[0])*state[5]/pow(state[4], 2) + (-(-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/pow(state[4], 2) - 1)*state[6]);
|
||||
out_5046006616921834778[50] = dt*(-stiffness_front*state[0] - stiffness_rear*state[0])/state[4] + 1;
|
||||
out_5046006616921834778[51] = dt*((-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/state[4] - state[4]);
|
||||
out_5046006616921834778[52] = dt*stiffness_front*state[0]/state[1];
|
||||
out_5046006616921834778[53] = -9.8100000000000005*dt;
|
||||
out_5046006616921834778[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_5046006616921834778[55] = -center_to_front*dt*stiffness_front*(-state[2] - state[3] + state[7])*state[0]/(rotational_inertia*pow(state[1], 2));
|
||||
out_5046006616921834778[56] = -center_to_front*dt*stiffness_front*state[0]/(rotational_inertia*state[1]);
|
||||
out_5046006616921834778[57] = -center_to_front*dt*stiffness_front*state[0]/(rotational_inertia*state[1]);
|
||||
out_5046006616921834778[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_5046006616921834778[59] = dt*(-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/(rotational_inertia*state[4]);
|
||||
out_5046006616921834778[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_5046006616921834778[61] = center_to_front*dt*stiffness_front*state[0]/(rotational_inertia*state[1]);
|
||||
out_5046006616921834778[62] = 0;
|
||||
out_5046006616921834778[63] = 0;
|
||||
out_5046006616921834778[64] = 0;
|
||||
out_5046006616921834778[65] = 0;
|
||||
out_5046006616921834778[66] = 0;
|
||||
out_5046006616921834778[67] = 0;
|
||||
out_5046006616921834778[68] = 0;
|
||||
out_5046006616921834778[69] = 0;
|
||||
out_5046006616921834778[70] = 1;
|
||||
out_5046006616921834778[71] = 0;
|
||||
out_5046006616921834778[72] = 0;
|
||||
out_5046006616921834778[73] = 0;
|
||||
out_5046006616921834778[74] = 0;
|
||||
out_5046006616921834778[75] = 0;
|
||||
out_5046006616921834778[76] = 0;
|
||||
out_5046006616921834778[77] = 0;
|
||||
out_5046006616921834778[78] = 0;
|
||||
out_5046006616921834778[79] = 0;
|
||||
out_5046006616921834778[80] = 1;
|
||||
}
|
||||
void h_25(double *state, double *unused, double *out_8627167620031889565) {
|
||||
out_8627167620031889565[0] = state[6];
|
||||
void h_25(double *state, double *unused, double *out_5546638875155758793) {
|
||||
out_5546638875155758793[0] = state[6];
|
||||
}
|
||||
void H_25(double *state, double *unused, double *out_1719062931467283681) {
|
||||
out_1719062931467283681[0] = 0;
|
||||
out_1719062931467283681[1] = 0;
|
||||
out_1719062931467283681[2] = 0;
|
||||
out_1719062931467283681[3] = 0;
|
||||
out_1719062931467283681[4] = 0;
|
||||
out_1719062931467283681[5] = 0;
|
||||
out_1719062931467283681[6] = 1;
|
||||
out_1719062931467283681[7] = 0;
|
||||
out_1719062931467283681[8] = 0;
|
||||
void H_25(double *state, double *unused, double *out_890653814216758955) {
|
||||
out_890653814216758955[0] = 0;
|
||||
out_890653814216758955[1] = 0;
|
||||
out_890653814216758955[2] = 0;
|
||||
out_890653814216758955[3] = 0;
|
||||
out_890653814216758955[4] = 0;
|
||||
out_890653814216758955[5] = 0;
|
||||
out_890653814216758955[6] = 1;
|
||||
out_890653814216758955[7] = 0;
|
||||
out_890653814216758955[8] = 0;
|
||||
}
|
||||
void h_24(double *state, double *unused, double *out_5179238137807796494) {
|
||||
out_5179238137807796494[0] = state[4];
|
||||
out_5179238137807796494[1] = state[5];
|
||||
void h_24(double *state, double *unused, double *out_4367318711229477977) {
|
||||
out_4367318711229477977[0] = state[4];
|
||||
out_4367318711229477977[1] = state[5];
|
||||
}
|
||||
void H_24(double *state, double *unused, double *out_453586667538215885) {
|
||||
out_453586667538215885[0] = 0;
|
||||
out_453586667538215885[1] = 0;
|
||||
out_453586667538215885[2] = 0;
|
||||
out_453586667538215885[3] = 0;
|
||||
out_453586667538215885[4] = 1;
|
||||
out_453586667538215885[5] = 0;
|
||||
out_453586667538215885[6] = 0;
|
||||
out_453586667538215885[7] = 0;
|
||||
out_453586667538215885[8] = 0;
|
||||
out_453586667538215885[9] = 0;
|
||||
out_453586667538215885[10] = 0;
|
||||
out_453586667538215885[11] = 0;
|
||||
out_453586667538215885[12] = 0;
|
||||
out_453586667538215885[13] = 0;
|
||||
out_453586667538215885[14] = 1;
|
||||
out_453586667538215885[15] = 0;
|
||||
out_453586667538215885[16] = 0;
|
||||
out_453586667538215885[17] = 0;
|
||||
void H_24(double *state, double *unused, double *out_4448579413019082091) {
|
||||
out_4448579413019082091[0] = 0;
|
||||
out_4448579413019082091[1] = 0;
|
||||
out_4448579413019082091[2] = 0;
|
||||
out_4448579413019082091[3] = 0;
|
||||
out_4448579413019082091[4] = 1;
|
||||
out_4448579413019082091[5] = 0;
|
||||
out_4448579413019082091[6] = 0;
|
||||
out_4448579413019082091[7] = 0;
|
||||
out_4448579413019082091[8] = 0;
|
||||
out_4448579413019082091[9] = 0;
|
||||
out_4448579413019082091[10] = 0;
|
||||
out_4448579413019082091[11] = 0;
|
||||
out_4448579413019082091[12] = 0;
|
||||
out_4448579413019082091[13] = 0;
|
||||
out_4448579413019082091[14] = 1;
|
||||
out_4448579413019082091[15] = 0;
|
||||
out_4448579413019082091[16] = 0;
|
||||
out_4448579413019082091[17] = 0;
|
||||
}
|
||||
void h_30(double *state, double *unused, double *out_4528864321752517701) {
|
||||
out_4528864321752517701[0] = state[4];
|
||||
void h_30(double *state, double *unused, double *out_1909189346901736443) {
|
||||
out_1909189346901736443[0] = state[4];
|
||||
}
|
||||
void H_30(double *state, double *unused, double *out_4237395889974532308) {
|
||||
out_4237395889974532308[0] = 0;
|
||||
out_4237395889974532308[1] = 0;
|
||||
out_4237395889974532308[2] = 0;
|
||||
out_4237395889974532308[3] = 0;
|
||||
out_4237395889974532308[4] = 1;
|
||||
out_4237395889974532308[5] = 0;
|
||||
out_4237395889974532308[6] = 0;
|
||||
out_4237395889974532308[7] = 0;
|
||||
out_4237395889974532308[8] = 0;
|
||||
void H_30(double *state, double *unused, double *out_7807344155708375710) {
|
||||
out_7807344155708375710[0] = 0;
|
||||
out_7807344155708375710[1] = 0;
|
||||
out_7807344155708375710[2] = 0;
|
||||
out_7807344155708375710[3] = 0;
|
||||
out_7807344155708375710[4] = 1;
|
||||
out_7807344155708375710[5] = 0;
|
||||
out_7807344155708375710[6] = 0;
|
||||
out_7807344155708375710[7] = 0;
|
||||
out_7807344155708375710[8] = 0;
|
||||
}
|
||||
void h_26(double *state, double *unused, double *out_5472374174654180136) {
|
||||
out_5472374174654180136[0] = state[7];
|
||||
void h_26(double *state, double *unused, double *out_6910862614562582088) {
|
||||
out_6910862614562582088[0] = state[7];
|
||||
}
|
||||
void H_26(double *state, double *unused, double *out_2022440387406772543) {
|
||||
out_2022440387406772543[0] = 0;
|
||||
out_2022440387406772543[1] = 0;
|
||||
out_2022440387406772543[2] = 0;
|
||||
out_2022440387406772543[3] = 0;
|
||||
out_2022440387406772543[4] = 0;
|
||||
out_2022440387406772543[5] = 0;
|
||||
out_2022440387406772543[6] = 0;
|
||||
out_2022440387406772543[7] = 1;
|
||||
out_2022440387406772543[8] = 0;
|
||||
void H_26(double *state, double *unused, double *out_2850849504657297269) {
|
||||
out_2850849504657297269[0] = 0;
|
||||
out_2850849504657297269[1] = 0;
|
||||
out_2850849504657297269[2] = 0;
|
||||
out_2850849504657297269[3] = 0;
|
||||
out_2850849504657297269[4] = 0;
|
||||
out_2850849504657297269[5] = 0;
|
||||
out_2850849504657297269[6] = 0;
|
||||
out_2850849504657297269[7] = 1;
|
||||
out_2850849504657297269[8] = 0;
|
||||
}
|
||||
void h_27(double *state, double *unused, double *out_2749092444325053967) {
|
||||
out_2749092444325053967[0] = state[3];
|
||||
void h_27(double *state, double *unused, double *out_3918136026546952058) {
|
||||
out_3918136026546952058[0] = state[3];
|
||||
}
|
||||
void H_27(double *state, double *unused, double *out_6460989961158475525) {
|
||||
out_6460989961158475525[0] = 0;
|
||||
out_6460989961158475525[1] = 0;
|
||||
out_6460989961158475525[2] = 0;
|
||||
out_6460989961158475525[3] = 1;
|
||||
out_6460989961158475525[4] = 0;
|
||||
out_6460989961158475525[5] = 0;
|
||||
out_6460989961158475525[6] = 0;
|
||||
out_6460989961158475525[7] = 0;
|
||||
out_6460989961158475525[8] = 0;
|
||||
void H_27(double *state, double *unused, double *out_5632580843907950799) {
|
||||
out_5632580843907950799[0] = 0;
|
||||
out_5632580843907950799[1] = 0;
|
||||
out_5632580843907950799[2] = 0;
|
||||
out_5632580843907950799[3] = 1;
|
||||
out_5632580843907950799[4] = 0;
|
||||
out_5632580843907950799[5] = 0;
|
||||
out_5632580843907950799[6] = 0;
|
||||
out_5632580843907950799[7] = 0;
|
||||
out_5632580843907950799[8] = 0;
|
||||
}
|
||||
void h_29(double *state, double *unused, double *out_5132180206428995218) {
|
||||
out_5132180206428995218[0] = state[1];
|
||||
void h_29(double *state, double *unused, double *out_3092483920759109202) {
|
||||
out_3092483920759109202[0] = state[1];
|
||||
}
|
||||
void H_29(double *state, double *unused, double *out_4747627234288924492) {
|
||||
out_4747627234288924492[0] = 0;
|
||||
out_4747627234288924492[1] = 1;
|
||||
out_4747627234288924492[2] = 0;
|
||||
out_4747627234288924492[3] = 0;
|
||||
out_4747627234288924492[4] = 0;
|
||||
out_4747627234288924492[5] = 0;
|
||||
out_4747627234288924492[6] = 0;
|
||||
out_4747627234288924492[7] = 0;
|
||||
out_4747627234288924492[8] = 0;
|
||||
void H_29(double *state, double *unused, double *out_8317575500022767894) {
|
||||
out_8317575500022767894[0] = 0;
|
||||
out_8317575500022767894[1] = 1;
|
||||
out_8317575500022767894[2] = 0;
|
||||
out_8317575500022767894[3] = 0;
|
||||
out_8317575500022767894[4] = 0;
|
||||
out_8317575500022767894[5] = 0;
|
||||
out_8317575500022767894[6] = 0;
|
||||
out_8317575500022767894[7] = 0;
|
||||
out_8317575500022767894[8] = 0;
|
||||
}
|
||||
void h_28(double *state, double *unused, double *out_9148133961738903113) {
|
||||
out_9148133961738903113[0] = state[0];
|
||||
void h_28(double *state, double *unused, double *out_4521451911223429575) {
|
||||
out_4521451911223429575[0] = state[0];
|
||||
}
|
||||
void H_28(double *state, double *unused, double *out_334771782780606082) {
|
||||
out_334771782780606082[0] = 1;
|
||||
out_334771782780606082[1] = 0;
|
||||
out_334771782780606082[2] = 0;
|
||||
out_334771782780606082[3] = 0;
|
||||
out_334771782780606082[4] = 0;
|
||||
out_334771782780606082[5] = 0;
|
||||
out_334771782780606082[6] = 0;
|
||||
out_334771782780606082[7] = 0;
|
||||
out_334771782780606082[8] = 0;
|
||||
void H_28(double *state, double *unused, double *out_1163180900031130808) {
|
||||
out_1163180900031130808[0] = 1;
|
||||
out_1163180900031130808[1] = 0;
|
||||
out_1163180900031130808[2] = 0;
|
||||
out_1163180900031130808[3] = 0;
|
||||
out_1163180900031130808[4] = 0;
|
||||
out_1163180900031130808[5] = 0;
|
||||
out_1163180900031130808[6] = 0;
|
||||
out_1163180900031130808[7] = 0;
|
||||
out_1163180900031130808[8] = 0;
|
||||
}
|
||||
void h_31(double *state, double *unused, double *out_745894969277840380) {
|
||||
out_745894969277840380[0] = state[8];
|
||||
void h_31(double *state, double *unused, double *out_5821832937440264682) {
|
||||
out_5821832937440264682[0] = state[8];
|
||||
}
|
||||
void H_31(double *state, double *unused, double *out_2648648489640124019) {
|
||||
out_2648648489640124019[0] = 0;
|
||||
out_2648648489640124019[1] = 0;
|
||||
out_2648648489640124019[2] = 0;
|
||||
out_2648648489640124019[3] = 0;
|
||||
out_2648648489640124019[4] = 0;
|
||||
out_2648648489640124019[5] = 0;
|
||||
out_2648648489640124019[6] = 0;
|
||||
out_2648648489640124019[7] = 0;
|
||||
out_2648648489640124019[8] = 1;
|
||||
void H_31(double *state, double *unused, double *out_921299776093719383) {
|
||||
out_921299776093719383[0] = 0;
|
||||
out_921299776093719383[1] = 0;
|
||||
out_921299776093719383[2] = 0;
|
||||
out_921299776093719383[3] = 0;
|
||||
out_921299776093719383[4] = 0;
|
||||
out_921299776093719383[5] = 0;
|
||||
out_921299776093719383[6] = 0;
|
||||
out_921299776093719383[7] = 0;
|
||||
out_921299776093719383[8] = 1;
|
||||
}
|
||||
#include <eigen3/Eigen/Dense>
|
||||
#include <iostream>
|
||||
@@ -514,68 +514,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_3585265450871354510) {
|
||||
err_fun(nom_x, delta_x, out_3585265450871354510);
|
||||
void car_err_fun(double *nom_x, double *delta_x, double *out_7360625163823445495) {
|
||||
err_fun(nom_x, delta_x, out_7360625163823445495);
|
||||
}
|
||||
void car_inv_err_fun(double *nom_x, double *true_x, double *out_4534440969468340130) {
|
||||
inv_err_fun(nom_x, true_x, out_4534440969468340130);
|
||||
void car_inv_err_fun(double *nom_x, double *true_x, double *out_8413491231423970122) {
|
||||
inv_err_fun(nom_x, true_x, out_8413491231423970122);
|
||||
}
|
||||
void car_H_mod_fun(double *state, double *out_7815971298073658297) {
|
||||
H_mod_fun(state, out_7815971298073658297);
|
||||
void car_H_mod_fun(double *state, double *out_2632326835772732722) {
|
||||
H_mod_fun(state, out_2632326835772732722);
|
||||
}
|
||||
void car_f_fun(double *state, double dt, double *out_3011916394083426809) {
|
||||
f_fun(state, dt, out_3011916394083426809);
|
||||
void car_f_fun(double *state, double dt, double *out_8532698894052839577) {
|
||||
f_fun(state, dt, out_8532698894052839577);
|
||||
}
|
||||
void car_F_fun(double *state, double dt, double *out_4768916904116545459) {
|
||||
F_fun(state, dt, out_4768916904116545459);
|
||||
void car_F_fun(double *state, double dt, double *out_5046006616921834778) {
|
||||
F_fun(state, dt, out_5046006616921834778);
|
||||
}
|
||||
void car_h_25(double *state, double *unused, double *out_8627167620031889565) {
|
||||
h_25(state, unused, out_8627167620031889565);
|
||||
void car_h_25(double *state, double *unused, double *out_5546638875155758793) {
|
||||
h_25(state, unused, out_5546638875155758793);
|
||||
}
|
||||
void car_H_25(double *state, double *unused, double *out_1719062931467283681) {
|
||||
H_25(state, unused, out_1719062931467283681);
|
||||
void car_H_25(double *state, double *unused, double *out_890653814216758955) {
|
||||
H_25(state, unused, out_890653814216758955);
|
||||
}
|
||||
void car_h_24(double *state, double *unused, double *out_5179238137807796494) {
|
||||
h_24(state, unused, out_5179238137807796494);
|
||||
void car_h_24(double *state, double *unused, double *out_4367318711229477977) {
|
||||
h_24(state, unused, out_4367318711229477977);
|
||||
}
|
||||
void car_H_24(double *state, double *unused, double *out_453586667538215885) {
|
||||
H_24(state, unused, out_453586667538215885);
|
||||
void car_H_24(double *state, double *unused, double *out_4448579413019082091) {
|
||||
H_24(state, unused, out_4448579413019082091);
|
||||
}
|
||||
void car_h_30(double *state, double *unused, double *out_4528864321752517701) {
|
||||
h_30(state, unused, out_4528864321752517701);
|
||||
void car_h_30(double *state, double *unused, double *out_1909189346901736443) {
|
||||
h_30(state, unused, out_1909189346901736443);
|
||||
}
|
||||
void car_H_30(double *state, double *unused, double *out_4237395889974532308) {
|
||||
H_30(state, unused, out_4237395889974532308);
|
||||
void car_H_30(double *state, double *unused, double *out_7807344155708375710) {
|
||||
H_30(state, unused, out_7807344155708375710);
|
||||
}
|
||||
void car_h_26(double *state, double *unused, double *out_5472374174654180136) {
|
||||
h_26(state, unused, out_5472374174654180136);
|
||||
void car_h_26(double *state, double *unused, double *out_6910862614562582088) {
|
||||
h_26(state, unused, out_6910862614562582088);
|
||||
}
|
||||
void car_H_26(double *state, double *unused, double *out_2022440387406772543) {
|
||||
H_26(state, unused, out_2022440387406772543);
|
||||
void car_H_26(double *state, double *unused, double *out_2850849504657297269) {
|
||||
H_26(state, unused, out_2850849504657297269);
|
||||
}
|
||||
void car_h_27(double *state, double *unused, double *out_2749092444325053967) {
|
||||
h_27(state, unused, out_2749092444325053967);
|
||||
void car_h_27(double *state, double *unused, double *out_3918136026546952058) {
|
||||
h_27(state, unused, out_3918136026546952058);
|
||||
}
|
||||
void car_H_27(double *state, double *unused, double *out_6460989961158475525) {
|
||||
H_27(state, unused, out_6460989961158475525);
|
||||
void car_H_27(double *state, double *unused, double *out_5632580843907950799) {
|
||||
H_27(state, unused, out_5632580843907950799);
|
||||
}
|
||||
void car_h_29(double *state, double *unused, double *out_5132180206428995218) {
|
||||
h_29(state, unused, out_5132180206428995218);
|
||||
void car_h_29(double *state, double *unused, double *out_3092483920759109202) {
|
||||
h_29(state, unused, out_3092483920759109202);
|
||||
}
|
||||
void car_H_29(double *state, double *unused, double *out_4747627234288924492) {
|
||||
H_29(state, unused, out_4747627234288924492);
|
||||
void car_H_29(double *state, double *unused, double *out_8317575500022767894) {
|
||||
H_29(state, unused, out_8317575500022767894);
|
||||
}
|
||||
void car_h_28(double *state, double *unused, double *out_9148133961738903113) {
|
||||
h_28(state, unused, out_9148133961738903113);
|
||||
void car_h_28(double *state, double *unused, double *out_4521451911223429575) {
|
||||
h_28(state, unused, out_4521451911223429575);
|
||||
}
|
||||
void car_H_28(double *state, double *unused, double *out_334771782780606082) {
|
||||
H_28(state, unused, out_334771782780606082);
|
||||
void car_H_28(double *state, double *unused, double *out_1163180900031130808) {
|
||||
H_28(state, unused, out_1163180900031130808);
|
||||
}
|
||||
void car_h_31(double *state, double *unused, double *out_745894969277840380) {
|
||||
h_31(state, unused, out_745894969277840380);
|
||||
void car_h_31(double *state, double *unused, double *out_5821832937440264682) {
|
||||
h_31(state, unused, out_5821832937440264682);
|
||||
}
|
||||
void car_H_31(double *state, double *unused, double *out_2648648489640124019) {
|
||||
H_31(state, unused, out_2648648489640124019);
|
||||
void car_H_31(double *state, double *unused, double *out_921299776093719383) {
|
||||
H_31(state, unused, out_921299776093719383);
|
||||
}
|
||||
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_3585265450871354510);
|
||||
void car_inv_err_fun(double *nom_x, double *true_x, double *out_4534440969468340130);
|
||||
void car_H_mod_fun(double *state, double *out_7815971298073658297);
|
||||
void car_f_fun(double *state, double dt, double *out_3011916394083426809);
|
||||
void car_F_fun(double *state, double dt, double *out_4768916904116545459);
|
||||
void car_h_25(double *state, double *unused, double *out_8627167620031889565);
|
||||
void car_H_25(double *state, double *unused, double *out_1719062931467283681);
|
||||
void car_h_24(double *state, double *unused, double *out_5179238137807796494);
|
||||
void car_H_24(double *state, double *unused, double *out_453586667538215885);
|
||||
void car_h_30(double *state, double *unused, double *out_4528864321752517701);
|
||||
void car_H_30(double *state, double *unused, double *out_4237395889974532308);
|
||||
void car_h_26(double *state, double *unused, double *out_5472374174654180136);
|
||||
void car_H_26(double *state, double *unused, double *out_2022440387406772543);
|
||||
void car_h_27(double *state, double *unused, double *out_2749092444325053967);
|
||||
void car_H_27(double *state, double *unused, double *out_6460989961158475525);
|
||||
void car_h_29(double *state, double *unused, double *out_5132180206428995218);
|
||||
void car_H_29(double *state, double *unused, double *out_4747627234288924492);
|
||||
void car_h_28(double *state, double *unused, double *out_9148133961738903113);
|
||||
void car_H_28(double *state, double *unused, double *out_334771782780606082);
|
||||
void car_h_31(double *state, double *unused, double *out_745894969277840380);
|
||||
void car_H_31(double *state, double *unused, double *out_2648648489640124019);
|
||||
void car_err_fun(double *nom_x, double *delta_x, double *out_7360625163823445495);
|
||||
void car_inv_err_fun(double *nom_x, double *true_x, double *out_8413491231423970122);
|
||||
void car_H_mod_fun(double *state, double *out_2632326835772732722);
|
||||
void car_f_fun(double *state, double dt, double *out_8532698894052839577);
|
||||
void car_F_fun(double *state, double dt, double *out_5046006616921834778);
|
||||
void car_h_25(double *state, double *unused, double *out_5546638875155758793);
|
||||
void car_H_25(double *state, double *unused, double *out_890653814216758955);
|
||||
void car_h_24(double *state, double *unused, double *out_4367318711229477977);
|
||||
void car_H_24(double *state, double *unused, double *out_4448579413019082091);
|
||||
void car_h_30(double *state, double *unused, double *out_1909189346901736443);
|
||||
void car_H_30(double *state, double *unused, double *out_7807344155708375710);
|
||||
void car_h_26(double *state, double *unused, double *out_6910862614562582088);
|
||||
void car_H_26(double *state, double *unused, double *out_2850849504657297269);
|
||||
void car_h_27(double *state, double *unused, double *out_3918136026546952058);
|
||||
void car_H_27(double *state, double *unused, double *out_5632580843907950799);
|
||||
void car_h_29(double *state, double *unused, double *out_3092483920759109202);
|
||||
void car_H_29(double *state, double *unused, double *out_8317575500022767894);
|
||||
void car_h_28(double *state, double *unused, double *out_4521451911223429575);
|
||||
void car_H_28(double *state, double *unused, double *out_1163180900031130808);
|
||||
void car_h_31(double *state, double *unused, double *out_5821832937440264682);
|
||||
void car_H_31(double *state, double *unused, double *out_921299776093719383);
|
||||
void car_predict(double *in_x, double *in_P, double *in_Q, double dt);
|
||||
void car_set_rotational_inertia(double x);
|
||||
void car_set_center_to_front(double x);
|
||||
|
||||
Binary file not shown.
Binary file not shown.
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_1372154176746733435);
|
||||
void pose_inv_err_fun(double *nom_x, double *true_x, double *out_1523580565963320994);
|
||||
void pose_H_mod_fun(double *state, double *out_7104221342799173532);
|
||||
void pose_f_fun(double *state, double dt, double *out_7349931890006772642);
|
||||
void pose_F_fun(double *state, double dt, double *out_1064691538495726265);
|
||||
void pose_h_4(double *state, double *unused, double *out_5786601062018184200);
|
||||
void pose_H_4(double *state, double *unused, double *out_8923920068705470393);
|
||||
void pose_h_10(double *state, double *unused, double *out_8200446056116706374);
|
||||
void pose_H_10(double *state, double *unused, double *out_8156688557227160880);
|
||||
void pose_h_13(double *state, double *unused, double *out_9145870174400750931);
|
||||
void pose_H_13(double *state, double *unused, double *out_5711646243373137592);
|
||||
void pose_h_14(double *state, double *unused, double *out_5989511771500844071);
|
||||
void pose_H_14(double *state, double *unused, double *out_6440035572708708927);
|
||||
void pose_err_fun(double *nom_x, double *delta_x, double *out_5308991872147398563);
|
||||
void pose_inv_err_fun(double *nom_x, double *true_x, double *out_5440750294658648606);
|
||||
void pose_H_mod_fun(double *state, double *out_7655853576405724458);
|
||||
void pose_f_fun(double *state, double dt, double *out_4136808220434975141);
|
||||
void pose_F_fun(double *state, double dt, double *out_2537852680944861179);
|
||||
void pose_h_4(double *state, double *unused, double *out_7730454059225088569);
|
||||
void pose_H_4(double *state, double *unused, double *out_7019083287459919586);
|
||||
void pose_h_10(double *state, double *unused, double *out_1910166407148471034);
|
||||
void pose_H_10(double *state, double *unused, double *out_3315929574475692252);
|
||||
void pose_h_13(double *state, double *unused, double *out_2907941445058093810);
|
||||
void pose_H_13(double *state, double *unused, double *out_7593905322947108006);
|
||||
void pose_h_14(double *state, double *unused, double *out_5410884076226838020);
|
||||
void pose_H_14(double *state, double *unused, double *out_8344872353954259734);
|
||||
void pose_predict(double *in_x, double *in_P, double *in_Q, double dt);
|
||||
}
|
||||
@@ -7,7 +7,6 @@ from functools import cached_property
|
||||
import os
|
||||
os.environ['GMMU'] = '0' # for chestnut fast loading, noop for qcom
|
||||
os.environ.setdefault('AM_POWER_LIMIT', '100')
|
||||
os.environ.setdefault('AM_PERF_LEVEL', 'high')
|
||||
from tinygrad.device import Buffer, Device
|
||||
from tinygrad.dtype import DType, dtypes
|
||||
from tinygrad.engine.realize import lower_and_compile
|
||||
|
||||
Binary file not shown.
@@ -8,6 +8,7 @@ from enum import IntEnum
|
||||
|
||||
from openpilot.selfdrive.ui.sunnypilot.layouts.settings.cruise_sub_layouts.speed_limit_settings import SpeedLimitSettingsLayout
|
||||
from openpilot.selfdrive.ui.ui_state import ui_state
|
||||
from openpilot.sunnypilot.mapd import MAPD_AVAILABLE
|
||||
from openpilot.system.ui.lib.multilang import tr, tr_noop
|
||||
from openpilot.system.ui.sunnypilot.widgets.list_view import toggle_item_sp, option_item_sp, simple_button_item_sp
|
||||
from openpilot.system.ui.widgets import Widget
|
||||
@@ -29,6 +30,7 @@ ACC_ENABLED_DESCRIPTION = tr_noop("Enable custom Short & Long press increments f
|
||||
ACC_NOLONG_DESCRIPTION = tr_noop("This feature can only be used with sunnypilot longitudinal control enabled.")
|
||||
ACC_PCMCRUISE_DISABLED_DESCRIPTION = tr_noop("This feature is not supported on this platform due to vehicle limitations.")
|
||||
ONROAD_ONLY_DESCRIPTION = tr_noop("Start the vehicle to check vehicle compatibility.")
|
||||
MAP_UNAVAILABLE_DESCRIPTION = tr_noop("Map data is temporarily unavailable.")
|
||||
|
||||
|
||||
class CruiseLayout(Widget):
|
||||
@@ -54,7 +56,8 @@ class CruiseLayout(Widget):
|
||||
|
||||
self.scc_m_toggle = toggle_item_sp(
|
||||
title=tr("Smart Cruise Control - Map"),
|
||||
description=tr("Use map data to estimate the appropriate speed to drive through turns ahead."),
|
||||
description=(f"<b>{tr(MAP_UNAVAILABLE_DESCRIPTION)}</b>\n\n" if not MAPD_AVAILABLE else "") +
|
||||
tr("Use map data to estimate the appropriate speed to drive through turns ahead."),
|
||||
param="SmartCruiseControlMap")
|
||||
|
||||
self.custom_acc_toggle = toggle_item_sp(
|
||||
@@ -139,7 +142,7 @@ class CruiseLayout(Widget):
|
||||
if has_long or has_icbm:
|
||||
self.custom_acc_toggle.action_item.set_enabled(((has_long and not ui_state.CP.pcmCruise) or has_icbm) and ui_state.is_offroad())
|
||||
self.scc_v_toggle.action_item.set_enabled(True)
|
||||
self.scc_m_toggle.action_item.set_enabled(True)
|
||||
self.scc_m_toggle.action_item.set_enabled(MAPD_AVAILABLE)
|
||||
else:
|
||||
ui_state.params.remove("CustomAccIncrementsEnabled")
|
||||
ui_state.params.remove("SmartCruiseControlVision")
|
||||
|
||||
+6
@@ -8,6 +8,8 @@ from collections.abc import Callable
|
||||
|
||||
import pyray as rl
|
||||
from openpilot.selfdrive.ui.ui_state import ui_state
|
||||
from openpilot.sunnypilot.mapd import MAPD_AVAILABLE
|
||||
from openpilot.sunnypilot.selfdrive.controls.lib.speed_limit.common import Policy
|
||||
from openpilot.system.ui.lib.multilang import tr
|
||||
from openpilot.system.ui.sunnypilot.widgets.list_view import multiple_button_item_sp
|
||||
from openpilot.system.ui.widgets.network import NavButton
|
||||
@@ -43,6 +45,8 @@ class SpeedLimitPolicyLayout(Widget):
|
||||
param="SpeedLimitPolicy",
|
||||
button_width=250,
|
||||
)
|
||||
if not MAPD_AVAILABLE:
|
||||
self._speed_limit_policy.action_item.set_enabled_buttons({Policy.car_state_only})
|
||||
|
||||
items = [
|
||||
self._speed_limit_policy
|
||||
@@ -51,6 +55,8 @@ class SpeedLimitPolicyLayout(Widget):
|
||||
|
||||
@staticmethod
|
||||
def _get_policy_description():
|
||||
if not MAPD_AVAILABLE:
|
||||
return f"<b>{tr('Map data is temporarily unavailable. Using Speed Limit data only from Car.')}</b>"
|
||||
return get_highlighted_description(ui_state.params, "SpeedLimitPolicy", SPEED_LIMIT_POLICY_DESCRIPTIONS)
|
||||
|
||||
def _render(self, rect):
|
||||
|
||||
@@ -1 +1 @@
|
||||
#define SUNNYPILOT_VERSION "2026.003.000"
|
||||
#define SUNNYPILOT_VERSION "2026.10.18-4943"
|
||||
|
||||
@@ -3,3 +3,7 @@ from openpilot.common.basedir import BASEDIR
|
||||
|
||||
MAPD_BIN_DIR = os.path.join(BASEDIR, 'openpilot', 'third_party/mapd_pfeiferj')
|
||||
MAPD_PATH = os.path.join(MAPD_BIN_DIR, 'mapd')
|
||||
|
||||
# mapd still runs (OSM downloads) but has no position source since ubloxd owns LastGPSPosition;
|
||||
# map-based features stay off until mapd is rebuilt
|
||||
MAPD_AVAILABLE = False
|
||||
|
||||
@@ -4,7 +4,6 @@ Copyright (c) 2021-, Haibin Wen, sunnypilot, and a number of other contributors.
|
||||
This file is part of sunnypilot and is licensed under the MIT License.
|
||||
See the LICENSE.md file in the root directory for more details.
|
||||
"""
|
||||
import json
|
||||
import math
|
||||
import platform
|
||||
|
||||
@@ -27,21 +26,6 @@ class OsmMapData(BaseMapData):
|
||||
self.last_bearing = math.degrees(location.calibratedOrientationNED.value[2])
|
||||
self.last_position = Coordinate(location.positionGeodetic.value[0], location.positionGeodetic.value[1])
|
||||
|
||||
if self.last_position is None:
|
||||
return
|
||||
|
||||
params = {
|
||||
"latitude": self.last_position.latitude,
|
||||
"longitude": self.last_position.longitude,
|
||||
}
|
||||
|
||||
if self.last_bearing is not None:
|
||||
params['bearing'] = self.last_bearing
|
||||
|
||||
# mapd reads its position from the memory params as JSON, so write it for the mapd binary.
|
||||
# LastGPSPosition is registered as BYTES (ubloxd owns the persistent copy for pigeond),
|
||||
# so the JSON payload has to be encoded here.
|
||||
self.mem_params.put("LastGPSPosition", json.dumps(params).encode(), block=True)
|
||||
|
||||
def get_current_speed_limit(self) -> float:
|
||||
return float(self.mem_params.get("MapSpeedLimit") or 0.0)
|
||||
|
||||
@@ -121,10 +121,6 @@ def update_osm_db() -> None:
|
||||
if not mem_params.get("OSMDownloadBounds"):
|
||||
mem_params.put("OSMDownloadBounds", "", block=True)
|
||||
|
||||
# mapd reads LastGPSPosition from the memory params as JSON, and it is registered as BYTES upstream
|
||||
if not mem_params.get("LastGPSPosition"):
|
||||
mem_params.put("LastGPSPosition", b"{}", block=True)
|
||||
|
||||
|
||||
def main_thread():
|
||||
update_installed_version(VERSION, params)
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
"""
|
||||
Copyright (c) 2021-, Haibin Wen, sunnypilot, and a number of other contributors.
|
||||
|
||||
This file is part of sunnypilot and is licensed under the MIT License.
|
||||
See the LICENSE.md file in the root directory for more details.
|
||||
"""
|
||||
import json
|
||||
import math
|
||||
import platform
|
||||
|
||||
import openpilot.cereal.messaging as messaging
|
||||
from openpilot.cereal import log
|
||||
from openpilot.common.params import Params
|
||||
from openpilot.common.test import OpenpilotTestCase
|
||||
from openpilot.sunnypilot.mapd.live_map_data.osm_map_data import OsmMapData
|
||||
|
||||
|
||||
class TestOsmMapData(OpenpilotTestCase):
|
||||
"""The mapd binary reads its position from the memory params as JSON, so mapd_manager has to feed it."""
|
||||
|
||||
LATITUDE = 32.875134
|
||||
LONGITUDE = -117.209777
|
||||
ALTITUDE = 42.0
|
||||
BEARING = 90.0
|
||||
|
||||
def setup_method(self):
|
||||
self.mem_params = Params("/dev/shm/params") if platform.system() != "Darwin" else Params()
|
||||
self.mem_params.remove("LastGPSPosition")
|
||||
self.map_data = OsmMapData()
|
||||
self.pm = messaging.PubMaster(['liveLocationKalman'])
|
||||
|
||||
def location_message(self, status: log.LiveLocationKalman.Status, position_valid: bool):
|
||||
msg = messaging.new_message('liveLocationKalman', valid=True)
|
||||
location = msg.liveLocationKalman
|
||||
location.status = status
|
||||
location.positionGeodetic = {'value': [self.LATITUDE, self.LONGITUDE, self.ALTITUDE], 'valid': position_valid}
|
||||
location.calibratedOrientationNED = {'value': [0.0, 0.0, math.radians(self.BEARING)], 'valid': True}
|
||||
return msg
|
||||
|
||||
def send_location(self, status: log.LiveLocationKalman.Status, position_valid: bool) -> None:
|
||||
# the first exchange synchronizes the PUB/SUB connection, the second one is actually received
|
||||
self.pm.send('liveLocationKalman', self.location_message(status, position_valid))
|
||||
self.map_data.sm.update(1000)
|
||||
self.pm.send('liveLocationKalman', self.location_message(status, position_valid))
|
||||
self.map_data.sm.update(1000)
|
||||
|
||||
def read_position(self) -> dict:
|
||||
value = self.mem_params.get("LastGPSPosition")
|
||||
self.assertIsNotNone(value, "LastGPSPosition was not written for mapd")
|
||||
return json.loads(value)
|
||||
|
||||
def test_writes_position_for_mapd(self):
|
||||
self.send_location(log.LiveLocationKalman.Status.valid, True)
|
||||
self.map_data.tick()
|
||||
|
||||
position = self.read_position()
|
||||
self.assertAlmostEqual(position['latitude'], self.LATITUDE, delta=1e-6)
|
||||
self.assertAlmostEqual(position['longitude'], self.LONGITUDE, delta=1e-6)
|
||||
self.assertAlmostEqual(position['bearing'], self.BEARING, delta=1e-6)
|
||||
|
||||
def test_invalid_localizer_keeps_last_known_position(self):
|
||||
self.send_location(log.LiveLocationKalman.Status.valid, True)
|
||||
self.map_data.tick()
|
||||
|
||||
self.send_location(log.LiveLocationKalman.Status.uninitialized, False)
|
||||
self.map_data.tick()
|
||||
|
||||
position = self.read_position()
|
||||
self.assertAlmostEqual(position['latitude'], self.LATITUDE, delta=1e-6)
|
||||
self.assertAlmostEqual(position['longitude'], self.LONGITUDE, delta=1e-6)
|
||||
@@ -9,6 +9,7 @@ from openpilot.common.params import Params
|
||||
from openpilot.common.realtime import DT_MDL
|
||||
from openpilot.selfdrive.car.cruise import V_CRUISE_UNSET
|
||||
from openpilot.sunnypilot import PARAMS_UPDATE_PERIOD
|
||||
from openpilot.sunnypilot.mapd import MAPD_AVAILABLE
|
||||
from openpilot.sunnypilot.navd.helpers import Coordinate
|
||||
from openpilot.sunnypilot.selfdrive.controls.lib.smart_cruise_control import MIN_V
|
||||
|
||||
@@ -75,7 +76,7 @@ class SmartCruiseControlMap:
|
||||
def __init__(self):
|
||||
self.params = Params()
|
||||
self.mem_params = Params("/dev/shm/params") if platform.system() != "Darwin" else self.params
|
||||
self.enabled = self.params.get_bool("SmartCruiseControlMap")
|
||||
self.enabled = MAPD_AVAILABLE and self.params.get_bool("SmartCruiseControlMap")
|
||||
self.long_enabled = False
|
||||
self.long_override = False
|
||||
self.is_enabled = False
|
||||
@@ -101,7 +102,7 @@ class SmartCruiseControlMap:
|
||||
|
||||
def update_params(self):
|
||||
if self.frame % int(PARAMS_UPDATE_PERIOD / DT_MDL) == 0:
|
||||
self.enabled = self.params.get_bool("SmartCruiseControlMap")
|
||||
self.enabled = MAPD_AVAILABLE and self.params.get_bool("SmartCruiseControlMap")
|
||||
|
||||
def update_calculations(self, sm: messaging.SubMaster) -> None:
|
||||
gps = sm[self.gps_location_service]
|
||||
|
||||
+14
-1
@@ -8,7 +8,7 @@ import json
|
||||
import math
|
||||
import platform
|
||||
from types import SimpleNamespace
|
||||
from unittest.mock import MagicMock
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
from openpilot.cereal import custom
|
||||
from openpilot.common.params import Params
|
||||
@@ -23,6 +23,8 @@ MapState = VisionState = custom.LongitudinalPlanSP.SmartCruiseControl.MapState
|
||||
class TestSmartCruiseControlMap(OpenpilotTestCase):
|
||||
|
||||
def setup_method(self):
|
||||
self.mapd_patch = patch("openpilot.sunnypilot.selfdrive.controls.lib.smart_cruise_control.map_controller.MAPD_AVAILABLE", True)
|
||||
self.mapd_patch.start()
|
||||
self.params = Params()
|
||||
self.mem_params = Params("/dev/shm/params") if platform.system() != "Darwin" else self.params
|
||||
self.reset_params()
|
||||
@@ -30,6 +32,9 @@ class TestSmartCruiseControlMap(OpenpilotTestCase):
|
||||
self.sm = MagicMock()
|
||||
self.sm.__getitem__.return_value = SimpleNamespace(latitude=0.0, longitude=0.0)
|
||||
|
||||
def teardown_method(self):
|
||||
self.mapd_patch.stop()
|
||||
|
||||
def reset_params(self):
|
||||
self.params.put_bool("SmartCruiseControlMap", True, block=True)
|
||||
|
||||
@@ -50,6 +55,14 @@ class TestSmartCruiseControlMap(OpenpilotTestCase):
|
||||
assert self.scc_m.state == VisionState.disabled
|
||||
assert not self.scc_m.is_active
|
||||
|
||||
def test_mapd_unavailable(self):
|
||||
self.mapd_patch.stop()
|
||||
self.scc_m = SmartCruiseControlMap()
|
||||
for _ in range(int(10. / DT_MDL)):
|
||||
self.scc_m.update(self.sm, True, False, 0., 0., 0.)
|
||||
assert self.scc_m.state == VisionState.disabled
|
||||
self.mapd_patch.start()
|
||||
|
||||
def test_disabled(self):
|
||||
for _ in range(int(10. / DT_MDL)):
|
||||
self.scc_m.update(self.sm, False, False, 0., 0., 0.)
|
||||
|
||||
@@ -13,6 +13,7 @@ from openpilot.common.gps import get_gps_location_service
|
||||
from openpilot.common.params import Params
|
||||
from openpilot.common.realtime import DT_MDL
|
||||
from openpilot.sunnypilot import PARAMS_UPDATE_PERIOD, get_sanitize_int_param
|
||||
from openpilot.sunnypilot.mapd import MAPD_AVAILABLE
|
||||
from openpilot.sunnypilot.selfdrive.controls.lib.speed_limit import LIMIT_MAX_MAP_DATA_AGE, LIMIT_ADAPT_ACC
|
||||
from openpilot.sunnypilot.selfdrive.controls.lib.speed_limit.common import Policy, OffsetType
|
||||
|
||||
@@ -48,6 +49,8 @@ class SpeedLimitResolver:
|
||||
Policy.max().value,
|
||||
self.params
|
||||
)
|
||||
if not MAPD_AVAILABLE:
|
||||
self.policy = Policy.car_state_only
|
||||
self._policy_to_sources_map = {
|
||||
Policy.car_state_only: [SpeedLimitSource.car],
|
||||
Policy.map_data_only: [SpeedLimitSource.map],
|
||||
@@ -91,7 +94,7 @@ class SpeedLimitResolver:
|
||||
|
||||
def update_params(self):
|
||||
if self.frame % int(PARAMS_UPDATE_PERIOD / DT_MDL) == 0:
|
||||
self.policy = self.params.get("SpeedLimitPolicy", return_default=True)
|
||||
self.policy = self.params.get("SpeedLimitPolicy", return_default=True) if MAPD_AVAILABLE else Policy.car_state_only
|
||||
self.is_metric = self.params.get_bool("IsMetric")
|
||||
self.offset_type = self.params.get("SpeedLimitOffsetType", return_default=True)
|
||||
self.offset_value = self.params.get("SpeedLimitValueOffset", return_default=True)
|
||||
|
||||
Binary file not shown.
Regular → Executable
+1702
-1702
File diff suppressed because it is too large
Load Diff
Regular → Executable
+24
-24
@@ -10,29 +10,29 @@ void live_update_32(double *in_x, double *in_P, double *in_z, double *in_R, doub
|
||||
void live_update_13(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea);
|
||||
void live_update_14(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea);
|
||||
void live_update_33(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea);
|
||||
void live_H(double *in_vec, double *out_2772122295686760629);
|
||||
void live_err_fun(double *nom_x, double *delta_x, double *out_6423955222691101398);
|
||||
void live_inv_err_fun(double *nom_x, double *true_x, double *out_719794691562319521);
|
||||
void live_H_mod_fun(double *state, double *out_126498273849915804);
|
||||
void live_f_fun(double *state, double dt, double *out_309423444720901128);
|
||||
void live_F_fun(double *state, double dt, double *out_1032010961160371620);
|
||||
void live_h_4(double *state, double *unused, double *out_390901647692918293);
|
||||
void live_H_4(double *state, double *unused, double *out_5503350273553476542);
|
||||
void live_h_9(double *state, double *unused, double *out_7608991673321319985);
|
||||
void live_H_9(double *state, double *unused, double *out_5262160626923885897);
|
||||
void live_h_10(double *state, double *unused, double *out_1303176786126841938);
|
||||
void live_H_10(double *state, double *unused, double *out_163299894457592615);
|
||||
void live_h_12(double *state, double *unused, double *out_9079169607037095226);
|
||||
void live_H_12(double *state, double *unused, double *out_483893865521514747);
|
||||
void live_h_35(double *state, double *unused, double *out_2930488141765413477);
|
||||
void live_H_35(double *state, double *unused, double *out_2261669166803498962);
|
||||
void live_h_32(double *state, double *unused, double *out_2212806671509093227);
|
||||
void live_H_32(double *state, double *unused, double *out_2079335608929607926);
|
||||
void live_h_13(double *state, double *unused, double *out_1599053777318742698);
|
||||
void live_H_13(double *state, double *unused, double *out_4211853044970865788);
|
||||
void live_h_14(double *state, double *unused, double *out_7608991673321319985);
|
||||
void live_H_14(double *state, double *unused, double *out_5262160626923885897);
|
||||
void live_h_33(double *state, double *unused, double *out_4867598165434144742);
|
||||
void live_H_33(double *state, double *unused, double *out_5412226171442356566);
|
||||
void live_H(double *in_vec, double *out_8536236811475430067);
|
||||
void live_err_fun(double *nom_x, double *delta_x, double *out_4614868058485758139);
|
||||
void live_inv_err_fun(double *nom_x, double *true_x, double *out_8573554928028298681);
|
||||
void live_H_mod_fun(double *state, double *out_6128852447133223565);
|
||||
void live_f_fun(double *state, double dt, double *out_7195534889995166041);
|
||||
void live_F_fun(double *state, double dt, double *out_9012508306389018670);
|
||||
void live_h_4(double *state, double *unused, double *out_2657657745771735915);
|
||||
void live_H_4(double *state, double *unused, double *out_1457735078816209632);
|
||||
void live_h_9(double *state, double *unused, double *out_181525824636861445);
|
||||
void live_H_9(double *state, double *unused, double *out_8744954014080657102);
|
||||
void live_h_10(double *state, double *unused, double *out_2940864223365932608);
|
||||
void live_H_10(double *state, double *unused, double *out_6591157835936482265);
|
||||
void live_h_12(double *state, double *unused, double *out_830811219903448800);
|
||||
void live_H_12(double *state, double *unused, double *out_4923523298226523364);
|
||||
void live_h_35(double *state, double *unused, double *out_1177115113523305926);
|
||||
void live_H_35(double *state, double *unused, double *out_2177960265901509655);
|
||||
void live_h_32(double *state, double *unused, double *out_8970203849717307468);
|
||||
void live_H_32(double *state, double *unused, double *out_5493453269239321848);
|
||||
void live_h_13(double *state, double *unused, double *out_1337448462981849436);
|
||||
void live_H_13(double *state, double *unused, double *out_2400089242629978824);
|
||||
void live_h_14(double *state, double *unused, double *out_181525824636861445);
|
||||
void live_H_14(double *state, double *unused, double *out_8744954014080657102);
|
||||
void live_h_33(double *state, double *unused, double *out_3078698583527751553);
|
||||
void live_H_33(double *state, double *unused, double *out_972596738737347949);
|
||||
void live_predict(double *in_x, double *in_P, double *in_Q, double dt);
|
||||
}
|
||||
Regular → Executable
@@ -15,6 +15,7 @@ from opendbc.sunnypilot.car.tesla.values import TeslaFlagsSP
|
||||
from openpilot.common.params import Params
|
||||
from openpilot.common.swaglog import cloudlog
|
||||
from openpilot.common.hardware import HARDWARE
|
||||
from openpilot.sunnypilot.mapd import MAPD_AVAILABLE
|
||||
|
||||
|
||||
# Wire-protocol version for the capabilities payload. Bump on breaking changes
|
||||
@@ -43,6 +44,7 @@ CAPABILITY_FIELDS = (
|
||||
"device_type",
|
||||
"subaru_has_sng",
|
||||
"hyundai_alpha_long_available",
|
||||
"mapd_available",
|
||||
)
|
||||
|
||||
CAPABILITY_LABELS: dict[str, str] = {
|
||||
@@ -65,6 +67,7 @@ CAPABILITY_LABELS: dict[str, str] = {
|
||||
"device_type": "Device type",
|
||||
"subaru_has_sng": "Subaru Stop-and-Go available",
|
||||
"hyundai_alpha_long_available": "Hyundai Alpha Longitudinal available",
|
||||
"mapd_available": "Map data available",
|
||||
}
|
||||
|
||||
# Explicit defaults for non-boolean capability fields
|
||||
@@ -132,6 +135,7 @@ def generate_capabilities(params: Params | None = None) -> dict:
|
||||
caps["is_sp_release"] = params.get_bool("IsReleaseSpBranch")
|
||||
caps["is_development"] = params.get_bool("IsDevelopmentBranch")
|
||||
caps["stock_longitudinal"] = params.get_bool("ToyotaEnforceStockLongitudinal")
|
||||
caps["mapd_available"] = MAPD_AVAILABLE
|
||||
|
||||
bundle = params.get("CarPlatformBundle")
|
||||
bundle_brand = _bundle_field(bundle, "brand")
|
||||
|
||||
@@ -156,7 +156,7 @@ The tables below describe the **compiled** `settings_ui.json` schema — what th
|
||||
|
||||
**Enablement rules**: Grayed out (disabled) when rules fail. Frontend shows a contextual badge explaining why.
|
||||
|
||||
**Capability fields** (referenced in rules): `has_longitudinal_control`, `has_icbm`, `icbm_available`, `torque_allowed`, `brand`, `pcm_cruise`, `alpha_long_available`, `steer_control_type`, `has_bsm`, `is_release`, `is_sp_release`, `is_development`, `tesla_has_vehicle_bus`, `has_stop_and_go`, `stock_longitudinal`
|
||||
**Capability fields** (referenced in rules): `has_longitudinal_control`, `has_icbm`, `icbm_available`, `torque_allowed`, `brand`, `pcm_cruise`, `alpha_long_available`, `steer_control_type`, `has_bsm`, `is_release`, `is_sp_release`, `is_development`, `tesla_has_vehicle_bus`, `has_stop_and_go`, `stock_longitudinal`, `mapd_available`
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -857,19 +857,47 @@
|
||||
},
|
||||
{
|
||||
"value": 1,
|
||||
"label": "Map Data Only"
|
||||
"label": "Map Data Only",
|
||||
"enablement": [
|
||||
{
|
||||
"type": "capability",
|
||||
"field": "mapd_available",
|
||||
"equals": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"value": 2,
|
||||
"label": "Car State Priority"
|
||||
"label": "Car State Priority",
|
||||
"enablement": [
|
||||
{
|
||||
"type": "capability",
|
||||
"field": "mapd_available",
|
||||
"equals": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"value": 3,
|
||||
"label": "Map Data Priority"
|
||||
"label": "Map Data Priority",
|
||||
"enablement": [
|
||||
{
|
||||
"type": "capability",
|
||||
"field": "mapd_available",
|
||||
"equals": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"value": 4,
|
||||
"label": "Combined"
|
||||
"label": "Combined",
|
||||
"enablement": [
|
||||
{
|
||||
"type": "capability",
|
||||
"field": "mapd_available",
|
||||
"equals": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -1001,6 +1029,11 @@
|
||||
}
|
||||
],
|
||||
"enablement": [
|
||||
{
|
||||
"type": "capability",
|
||||
"field": "mapd_available",
|
||||
"equals": true
|
||||
},
|
||||
{
|
||||
"type": "any",
|
||||
"conditions": [
|
||||
|
||||
@@ -167,12 +167,28 @@ sections:
|
||||
label: Car State Only
|
||||
- value: 1
|
||||
label: Map Data Only
|
||||
enablement:
|
||||
- type: capability
|
||||
field: mapd_available
|
||||
equals: true
|
||||
- value: 2
|
||||
label: Car State Priority
|
||||
enablement:
|
||||
- type: capability
|
||||
field: mapd_available
|
||||
equals: true
|
||||
- value: 3
|
||||
label: Map Data Priority
|
||||
enablement:
|
||||
- type: capability
|
||||
field: mapd_available
|
||||
equals: true
|
||||
- value: 4
|
||||
label: Combined
|
||||
enablement:
|
||||
- type: capability
|
||||
field: mapd_available
|
||||
equals: true
|
||||
- key: SpeedLimitOffsetType
|
||||
widget: multiple_button
|
||||
title: Speed Limit Offset Type
|
||||
@@ -246,6 +262,9 @@ sections:
|
||||
field: has_icbm
|
||||
equals: true
|
||||
enablement:
|
||||
- type: capability
|
||||
field: mapd_available
|
||||
equals: true
|
||||
- type: any
|
||||
conditions:
|
||||
- type: capability
|
||||
|
||||
Reference in New Issue
Block a user