diff --git a/selfdrive/modeld/models/driving.h b/selfdrive/modeld/models/driving.h index 5734c68cb998a0..2b0902d5cf769e 100644 --- a/selfdrive/modeld/models/driving.h +++ b/selfdrive/modeld/models/driving.h @@ -1,10 +1,5 @@ #pragma once -// gate this here -#define TEMPORAL -#define DESIRE -#define TRAFFIC_CONVENTION - #include #include @@ -17,6 +12,12 @@ #include "selfdrive/modeld/models/nav.h" #include "selfdrive/modeld/runners/run.h" +// gate this here +#define TEMPORAL +#define DESIRE +#define TRAFFIC_CONVENTION +#define NAV + constexpr int FEATURE_LEN = 128; constexpr int HISTORY_BUFFER_LEN = 99; constexpr int DESIRE_LEN = 8; diff --git a/selfdrive/modeld/models/supercombo.onnx b/selfdrive/modeld/models/supercombo.onnx index 915883ad0cc55e..278b2ad162ab4b 100644 Binary files a/selfdrive/modeld/models/supercombo.onnx and b/selfdrive/modeld/models/supercombo.onnx differ diff --git a/selfdrive/modeld/runners/thneedmodel.cc b/selfdrive/modeld/runners/thneedmodel.cc index 4fdd7ca466f086..2ac3d6449550a0 100644 --- a/selfdrive/modeld/runners/thneedmodel.cc +++ b/selfdrive/modeld/runners/thneedmodel.cc @@ -41,13 +41,13 @@ void ThneedModel::addExtra(float *extra_input_buf, int buf_size) { } void* ThneedModel::getInputBuf() { - if (use_extra && thneed->input_clmem.size() > 4) return &(thneed->input_clmem[4]); - else if (!use_extra && thneed->input_clmem.size() > 3) return &(thneed->input_clmem[3]); + if (use_extra && thneed->input_clmem.size() > 5) return &(thneed->input_clmem[5]); + else if (!use_extra && thneed->input_clmem.size() > 4) return &(thneed->input_clmem[4]); else return nullptr; } void* ThneedModel::getExtraBuf() { - if (thneed->input_clmem.size() > 3) return &(thneed->input_clmem[3]); + if (thneed->input_clmem.size() > 4) return &(thneed->input_clmem[4]); else return nullptr; } @@ -55,10 +55,10 @@ void ThneedModel::execute() { if (!recorded) { thneed->record = true; if (use_extra) { - float *inputs[5] = {recurrent, trafficConvention, desire, extra, input}; + float *inputs[6] = {recurrent, navFeatures, trafficConvention, desire, extra, input}; thneed->copy_inputs(inputs); } else { - float *inputs[4] = {recurrent, trafficConvention, desire, input}; + float *inputs[5] = {recurrent, navFeatures, trafficConvention, desire, input}; thneed->copy_inputs(inputs); } thneed->clexec(); @@ -68,12 +68,11 @@ void ThneedModel::execute() { recorded = true; } else { if (use_extra) { - float *inputs[5] = {recurrent, trafficConvention, desire, extra, input}; + float *inputs[6] = {recurrent, navFeatures, trafficConvention, desire, extra, input}; thneed->execute(inputs, output); } else { - float *inputs[4] = {recurrent, trafficConvention, desire, input}; + float *inputs[5] = {recurrent, navFeatures, trafficConvention, desire, input}; thneed->execute(inputs, output); } } } -