Add USBCANFD transport and visualize 0x391 door feedback
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "inference_session.hpp"
|
||||
#include "camera_pipeline.hpp"
|
||||
#include "serialization.hpp"
|
||||
#include <chrono>
|
||||
#include <cmath>
|
||||
#include <iostream>
|
||||
@@ -24,6 +25,8 @@ int main(int argc,char** argv)try {
|
||||
im->pixels.resize(9600);
|
||||
for(int y=0;y<48;++y)for(int x=0;x<192;++x)im->pixels[y*200+x]=32+x/3+y%4;
|
||||
FrameResult r;r.image=im;r.frame_index=3;r.capture.frame_index=3;r.capture.driver_sequence=42;
|
||||
r.can.status="OPEN";r.can.received=7;r.can.channels[0].positions={0,25,100,255};
|
||||
r.can.channels[0].valid=true;r.can.channels[0].received=7;r.can.channels[0].age_ms=12.5;
|
||||
r.capture.capture_monotonic_ns=123;r.capture.received_monotonic_ns=124;
|
||||
{
|
||||
SessionWriter writer(c);writer.write(r,{{"raw_keypoints",{1,2,3}}});
|
||||
@@ -37,6 +40,8 @@ int main(int argc,char** argv)try {
|
||||
PipelineConfig replay;replay.replay_session=c.record_session;
|
||||
SessionReader reader(replay);check(replay.camera.width==64&&replay.detector_confidence==.42,"Settings not restored");
|
||||
auto first=reader.read();check(first&&first->metadata.frame_index==3,"First index mismatch");
|
||||
auto can=deserializeCan(first->replay_record->at("result").at("can"));
|
||||
check(can.channels[0].positions==r.can.channels[0].positions&&can.channels[0].valid&&can.channels[0].age_ms==12.5,"Recorded CAN snapshot changed");
|
||||
check(first->metadata.driver_sequence==42&&first->metadata.capture_monotonic_ns!=123,"Capture metadata mismatch");
|
||||
check(first->replay_record->at("capture").at("capture_monotonic_ns")==123,"Original clock lost");
|
||||
for(int y=0;y<48;++y)for(int x=0;x<192;++x)check(std::abs(int(first->image->pixels[y*192+x])-(32+x/3+y%4))<12,"Decoded first frame mismatch");
|
||||
|
||||
Reference in New Issue
Block a user