mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-02-25 15:03:53 +08:00
* 0.7 * magic * faster magic * more simple * up * empty * more mid bits * naive * flatten * dz * that can stay * this is fine * what the * what the * giRevert "what the" This reverts commit 1619ba68e6098dc581fe9b82e7ecb74562b619cc. * Revert "what the" This reverts commit 0037dd368290497a6d0009ca34adb2184b584d2e. * 1x fine * that was fine * combined * independent cum * 0 is fine * use metrics * up cereal * process and publish from modeld * cleanup * use s.output * bg * a greener approach * dns * serial * update ref commit * rebase * ref * cereal master --------- Co-authored-by: Comma Device <device@comma.ai>
39 lines
1.4 KiB
C++
39 lines
1.4 KiB
C++
#pragma once
|
|
|
|
#include <array>
|
|
#include "common/mat.h"
|
|
#include "system/hardware/hw.h"
|
|
|
|
const int TRAJECTORY_SIZE = 33;
|
|
const int LAT_MPC_N = 16;
|
|
const int LON_MPC_N = 32;
|
|
const float MIN_DRAW_DISTANCE = 10.0;
|
|
const float MAX_DRAW_DISTANCE = 100.0;
|
|
|
|
const float RYG_GREEN = 0.01165;
|
|
const float RYG_YELLOW = 0.06157;
|
|
|
|
template <typename T, size_t size>
|
|
constexpr std::array<T, size> build_idxs(float max_val) {
|
|
std::array<T, size> result{};
|
|
for (int i = 0; i < size; ++i) {
|
|
result[i] = max_val * ((i / (double)(size - 1)) * (i / (double)(size - 1)));
|
|
}
|
|
return result;
|
|
}
|
|
|
|
constexpr auto T_IDXS = build_idxs<double, TRAJECTORY_SIZE>(10.0);
|
|
constexpr auto T_IDXS_FLOAT = build_idxs<float, TRAJECTORY_SIZE>(10.0);
|
|
constexpr auto X_IDXS = build_idxs<double, TRAJECTORY_SIZE>(192.0);
|
|
constexpr auto X_IDXS_FLOAT = build_idxs<float, TRAJECTORY_SIZE>(192.0);
|
|
|
|
const mat3 fcam_intrinsic_matrix = (mat3){{2648.0, 0.0, 1928.0 / 2,
|
|
0.0, 2648.0, 1208.0 / 2,
|
|
0.0, 0.0, 1.0}};
|
|
|
|
// tici ecam focal probably wrong? magnification is not consistent across frame
|
|
// Need to retrain model before this can be changed
|
|
const mat3 ecam_intrinsic_matrix = (mat3){{567.0, 0.0, 1928.0 / 2,
|
|
0.0, 567.0, 1208.0 / 2,
|
|
0.0, 0.0, 1.0}};
|