|
|
|
@ -87,7 +87,6 @@ void run_model(ModelState &model, VisionIpcClient &vipc_client) { |
|
|
|
|
|
|
|
|
|
transform_lock.lock(); |
|
|
|
|
mat3 model_transform = cur_transform; |
|
|
|
|
const bool run_model_this_iter = live_calib_seen; |
|
|
|
|
transform_lock.unlock(); |
|
|
|
|
|
|
|
|
|
// TODO: path planner timeout?
|
|
|
|
@ -95,9 +94,6 @@ void run_model(ModelState &model, VisionIpcClient &vipc_client) { |
|
|
|
|
int desire = ((int)sm["lateralPlan"].getLateralPlan().getDesire()); |
|
|
|
|
frame_id = sm["roadCameraState"].getRoadCameraState().getFrameId(); |
|
|
|
|
|
|
|
|
|
if (run_model_this_iter) { |
|
|
|
|
run_count++; |
|
|
|
|
|
|
|
|
|
float vec_desire[DESIRE_LEN] = {0}; |
|
|
|
|
if (desire >= 0 && desire < DESIRE_LEN) { |
|
|
|
|
vec_desire[desire] = 1.0; |
|
|
|
@ -116,18 +112,18 @@ void run_model(ModelState &model, VisionIpcClient &vipc_client) { |
|
|
|
|
frame_dropped_filter.reset(0); |
|
|
|
|
frames_dropped = 0.; |
|
|
|
|
} |
|
|
|
|
run_count++; |
|
|
|
|
|
|
|
|
|
float frame_drop_ratio = frames_dropped / (1 + frames_dropped); |
|
|
|
|
|
|
|
|
|
model_publish(pm, extra.frame_id, frame_id, frame_drop_ratio, *model_output, extra.timestamp_eof, model_execution_time, |
|
|
|
|
kj::ArrayPtr<const float>(model.output.data(), model.output.size())); |
|
|
|
|
posenet_publish(pm, extra.frame_id, vipc_dropped_frames, *model_output, extra.timestamp_eof); |
|
|
|
|
kj::ArrayPtr<const float>(model.output.data(), model.output.size()), live_calib_seen); |
|
|
|
|
posenet_publish(pm, extra.frame_id, vipc_dropped_frames, *model_output, extra.timestamp_eof, live_calib_seen); |
|
|
|
|
|
|
|
|
|
//printf("model process: %.2fms, from last %.2fms, vipc_frame_id %u, frame_id, %u, frame_drop %.3f\n", mt2 - mt1, mt1 - last, extra.frame_id, frame_id, frame_drop_ratio);
|
|
|
|
|
last = mt1; |
|
|
|
|
last_vipc_frame_id = extra.frame_id; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int main(int argc, char **argv) { |
|
|
|
|