mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-08-05 00:05:59 +08:00
@@ -219,7 +219,7 @@ int main(int argc, char **argv) {
|
||||
|
||||
ModelDataRaw model_buf =
|
||||
model_eval_frame(&model, q, yuv_cl, buf_info.width, buf_info.height,
|
||||
model_transform, NULL, vec_desire, NULL);
|
||||
model_transform, NULL, vec_desire);
|
||||
mt2 = millis_since_boot();
|
||||
|
||||
model_publish(model_sock, extra.frame_id, model_buf, extra.timestamp_eof);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include "common/timing.h"
|
||||
#include "common/params.h"
|
||||
#include "driving.h"
|
||||
|
||||
|
||||
@@ -53,6 +54,18 @@ void model_init(ModelState* s, cl_device_id device_id, cl_context context, int t
|
||||
s->traffic_convention = (float*)malloc(TRAFFIC_CONVENTION_LEN * sizeof(float));
|
||||
for (int i = 0; i < TRAFFIC_CONVENTION_LEN; i++) s->traffic_convention[i] = 0.0;
|
||||
s->m->addTrafficConvention(s->traffic_convention, TRAFFIC_CONVENTION_LEN);
|
||||
|
||||
char *string;
|
||||
const int result = read_db_value(NULL, "IsRHD", &string, NULL);
|
||||
if (result == 0) {
|
||||
bool is_rhd = string[0] == '1';
|
||||
free(string);
|
||||
if (is_rhd) {
|
||||
s->traffic_convention[1] = 1.0;
|
||||
} else {
|
||||
s->traffic_convention[0] = 1.0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Build Vandermonde matrix
|
||||
@@ -68,7 +81,7 @@ void model_init(ModelState* s, cl_device_id device_id, cl_context context, int t
|
||||
ModelDataRaw model_eval_frame(ModelState* s, cl_command_queue q,
|
||||
cl_mem yuv_cl, int width, int height,
|
||||
mat3 transform, void* sock,
|
||||
float *desire_in, float *traffic_convention_in) {
|
||||
float *desire_in) {
|
||||
#ifdef DESIRE
|
||||
if (desire_in != NULL) {
|
||||
for (int i = 0; i < DESIRE_LEN; i++) {
|
||||
@@ -84,13 +97,6 @@ ModelDataRaw model_eval_frame(ModelState* s, cl_command_queue q,
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef TRAFFIC_CONVENTION
|
||||
if (traffic_convention_in != NULL) {
|
||||
for (int i = 0; i < TRAFFIC_CONVENTION_LEN; i++) {
|
||||
s->traffic_convention[i] = traffic_convention_in[i];
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
//for (int i = 0; i < OUTPUT_SIZE + TEMPORAL_SIZE; i++) { printf("%f ", s->output[i]); } printf("\n");
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ void model_init(ModelState* s, cl_device_id device_id,
|
||||
cl_context context, int temporal);
|
||||
ModelDataRaw model_eval_frame(ModelState* s, cl_command_queue q,
|
||||
cl_mem yuv_cl, int width, int height,
|
||||
mat3 transform, void* sock, float *desire_in, float *traffic_convention_in);
|
||||
mat3 transform, void* sock, float *desire_in);
|
||||
void model_free(ModelState* s);
|
||||
void poly_fit(float *in_pts, float *in_stds, float *out);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user