From ab42eea52f705a20fc51f90c2197e12f3fbcc8ad Mon Sep 17 00:00:00 2001 From: Chris Padwick Date: Wed, 7 May 2025 19:19:39 -0700 Subject: [PATCH 1/3] final set of local changes from the orin --- Installer/AprilTags/AprilTagsManager.sh | 2 + .../calibration/calibrationmatrix_UC762W.json | 276 +++++++++--------- src/DoubleArraySender.cpp | 4 +- src/DoubleValueSender.cpp | 8 +- 4 files changed, 146 insertions(+), 144 deletions(-) diff --git a/Installer/AprilTags/AprilTagsManager.sh b/Installer/AprilTags/AprilTagsManager.sh index d5a2410..03a1800 100755 --- a/Installer/AprilTags/AprilTagsManager.sh +++ b/Installer/AprilTags/AprilTagsManager.sh @@ -22,6 +22,8 @@ function killIfRunning() { # set clocks to max frequency (jetson only) jetson_clocks || true 1>&2 >> /dev/null +sudo systemctl restart ntp + #open source for args source /opt/AprilTags/args diff --git a/data/calibration/calibrationmatrix_UC762W.json b/data/calibration/calibrationmatrix_UC762W.json index 67fd432..cc816c2 100755 --- a/data/calibration/calibrationmatrix_UC762W.json +++ b/data/calibration/calibrationmatrix_UC762W.json @@ -1,472 +1,466 @@ { "matrix": [ - [ - 900.2468957462735, - 0.0, - 590.7305567932211 - ], - [ - 0.0, - 899.7327545226501, - 401.06333391850166 - ], - [ - 0.0, - 0.0, - 1.0 - ] + [890.7824983840783, + 0.0, + 577.9523674663413], + [0.0, + 895.0995227885126, + 414.28775476084877], + [0.0, + 0.0, + 1.0] ], "disto": [ [ - 0.05361043325027495, - -0.07934581640509732, - -0.0006496561287903331, - -0.00011068320873551903, - 0.031419432460720605 + 0.05747010017756256, + -0.13344325370804797, + 0.002889844255116942, + -0.007303558937589076, + 0.07035055892695184 ] ], "rotvec": [ [ [ - 0.12573620059390622 + 0.13094295836437714 ], [ - 0.048402887805730085 + 0.022586439418668378 ], [ - 0.10970842401217987 + 0.0593809098893573 ] ], [ [ - 0.0736199497492176 + -0.2781999431889881 ], [ - 0.05247366108828319 + -0.03583577302850341 ], [ - 0.13242422848357682 + 0.0642248933777566 ] ], [ [ - 0.1885348628503481 + 0.856605064984982 ], [ - 0.11708476825564065 + -0.040070626879586575 ], [ - 0.14253818514143857 + 0.1513222730804355 ] ], [ [ - 0.0671124530229739 + 0.5071530302237259 ], [ - 0.07975807222063411 + 0.020285527609627832 ], [ - 0.18104700929951195 + 0.12380807517198325 ] ], [ [ - 0.10514319584082567 + 0.44225260035031677 ], [ - 0.1328020327481282 + 0.08622585712951472 ], [ - 0.22492650479397408 + 0.24007451697678664 ] ], [ [ - 0.19043869141242106 + 0.15749971416256484 ], [ - 0.1322815995338617 + 0.03373055044107321 ], [ - 0.18017797290355658 + 0.12640861137204132 ] ], [ [ - 0.17610339473367928 + 0.08123985127444723 ], [ - 0.16476639992637684 + 0.0375068800996855 ], [ - 0.1659910457266232 + 0.10936137307519786 ] ], [ [ - 0.25721013142515675 + -0.049734951750124774 ], [ - 0.07490875098872446 + -0.09440423224403181 ], [ - 0.04418862626245342 + 1.573196122857831 ] ], [ [ - 0.2302493983164956 + -0.08768170211802481 ], [ - -0.03074953244605702 + -0.2060075133205408 ], [ - 0.06654369088793145 + -0.04366843819167845 ] ], [ [ - 0.21443380011321592 + -0.1992534704891681 ], [ - -0.05780229902606189 + -0.09324487493732513 ], [ - 0.09496375856540369 + 1.5278023531049396 ] ], [ [ - 0.16572566760437 + -0.5479283863511881 ], [ - -0.0921694667633039 + -0.1510095281026404 ], [ - 0.08521037477801857 + -0.0891260617964366 ] ], [ [ - 0.28844666834897553 + 0.6001114535097982 ], [ - -0.05800433944971366 + -0.17332322133157618 ], [ - 0.04691460983755658 + 0.0625303602126354 ] ], [ [ - -0.11177866016711133 + 0.5669028721827565 ], [ - 0.05829279822452803 + 0.014932549251552194 ], [ - 0.11256924345038986 + 0.12262135261642884 ] ], [ [ - 0.18167451608804802 + -0.6251224938791666 ], [ - 0.7675270223382905 + -0.14010696760204655 ], [ - 0.2146757893488948 + -0.04340762626476061 ] ], [ [ - 0.2932014193049436 + 0.6816969173872202 ], [ - -0.6716646845917369 + 0.44480974309700944 ], [ - -0.043998528971881654 + 1.551768023555769 ] ], [ [ - -0.3132806947537425 + 0.11269126791998955 ], [ - -0.17260911733193926 + -1.1058874057161556 ], [ - 0.09606450674141626 + -0.15433798846311073 ] ], [ [ - 0.08171607874982871 + 0.13430499450082378 ], [ - 1.003965765361274 + -1.0236034710417008 ], [ - 0.31722079495239286 + -0.11095389888766591 ] ], [ [ - 0.8044497212284639 + -0.5603175595502305 ], [ - 0.2655342815115243 + -0.5204116133643352 ], [ - 0.13201882899852174 + -0.300022753061465 ] ], [ [ - -0.2129257482980303 + 0.7118989343264327 ], [ - -0.36620632668793646 + -0.18232821478724526 ], [ - -0.13138538617891765 + 1.2918906854109076 ] ], [ [ - -0.44098723960818825 + -0.5730427944060451 ], [ - -0.8546050928097505 + 0.10844581193147478 ], [ - 1.1716533193859011 + 0.055837833781132 ] ] ], "travec": [ [ [ - -0.799368721104568 + -6.145823774710786 ], [ - -5.142192104489603 + -4.19026279431551 ], [ - 18.36592460592022 + 20.99018479844666 ] ], [ [ - -1.063519694761603 + -8.547038446382437 ], [ - -4.239568654127384 + -5.861061223926107 ], [ - 16.00033777878805 + 21.05021852082482 ] ], [ [ - 2.5425133288485386 + -6.2194800333804965 ], [ - -3.7069471187758594 + -4.105820916323276 ], [ - 16.025051600738667 + 16.780841722898245 ] ], [ [ - 1.2197690035808242 + 1.7935963171666347 ], [ - -6.285640840141464 + -6.1521572933448825 ], [ - 15.964134338281646 + 19.873255481736145 ] ], [ [ - 4.508858578778146 + 6.546253766010113 ], [ - -5.5314743872719045 + -7.357157118187969 ], [ - 16.055669442688515 + 20.273506238456793 ] ], [ [ - 2.705462280543688 + 5.182494327717244 ], [ - -0.8828113648429836 + -2.675581566698193 ], [ - 16.318237779726083 + 20.62894613100907 ] ], [ [ - 4.963197040987915 + 4.128058058388096 ], [ - -0.29699526448592095 + 1.0104877143913538 ], [ - 16.75295632904306 + 20.658460353149714 ] ], [ [ - -6.172085417197536 + 2.2451651736979836 ], [ - -1.3247227564049542 + 1.3681805424205713 ], [ - 17.64620166479602 + 18.885831195281085 ] ], [ [ - -9.023820285479745 + -9.649314401294902 ], [ - -3.403339761521992 + 0.04771062894766406 ], [ - 18.385320102885967 + 16.23772450974645 ] ], [ [ - -8.954822051645282 + -4.596884776100098 ], [ - -6.26283725902194 + -0.10770275325539388 ], [ - 18.762415501887563 + 17.100919458984414 ] ], [ [ - -5.073104213780314 + -10.225601176687467 ], [ - -5.692656691680267 + -4.956773117275806 ], [ - 18.364476975518986 + 18.25176019828731 ] ], [ [ - -6.787070091266128 + -8.39094654114074 ], [ - -0.5818182864833037 + -3.9287715277794284 ], [ - 16.12476643229488 + 15.779447645312949 ] ], [ [ - -5.270310884155361 + -2.530104408195494 ], [ - -3.403785413195344 + -5.207552713310666 ], [ - 19.96746005464734 + 16.92057406297029 ] ], [ [ - -0.2884886758479117 + -6.402993258250816 ], [ - -4.274287883296751 + -3.298612010439361 ], [ - 21.437946713408934 + 18.36939533174749 ] ], [ [ - -5.0349979167876295 + -0.884788461158153 ], [ - -3.46126703515655 + -3.7387251217257123 ], [ - 15.725230041295795 + 16.24142651717116 ] ], [ [ - -4.333775240064581 + -5.326573514428229 ], [ - -6.375767367414258 + -3.891332107585857 ], [ - 21.187154578566588 + 15.387898034492872 ] ], [ [ - 2.8048177805654104 + 1.3040088804141214 ], [ - -5.857316624559735 + -4.6993818471568085 ], [ - 21.703152881748814 + 14.982657965111093 ] ], [ [ - -3.919302095351571 + -2.5438038725974974 ], [ - -2.0507266483097406 + -4.591065235522608 ], [ - 17.92107891988764 + 17.764126550614325 ] ], [ [ - -9.168863184831267 + 2.839516051431885 ], [ - -4.255093094645281 + -5.129526812163347 ], [ - 19.631430687611047 + 15.707898603821054 ] ], [ [ - 0.5765729853356188 + -5.472113439986676 ], [ - -5.525337046151899 + -0.6902940751804577 ], [ - 20.40177511170431 + 21.247030876601706 ] ] ] -} +} \ No newline at end of file diff --git a/src/DoubleArraySender.cpp b/src/DoubleArraySender.cpp index 7b2ae25..c11d730 100644 --- a/src/DoubleArraySender.cpp +++ b/src/DoubleArraySender.cpp @@ -18,9 +18,11 @@ DoubleArraySender::DoubleArraySender(std::string key) { } void DoubleArraySender::sendValue(std::vector value) { publisher_.Set(value); + inst_.Flush(); } void DoubleArraySender::setDefaultValue(std::vector value) { publisher_.SetDefault(value); + inst_.Flush(); } // Class use example @@ -33,4 +35,4 @@ void DoubleArraySender::setDefaultValue(std::vector value) { // std::cout << "Sent value" << std::endl; // } // return 0; -// } \ No newline at end of file +// } diff --git a/src/DoubleValueSender.cpp b/src/DoubleValueSender.cpp index 993af8e..342c2a7 100644 --- a/src/DoubleValueSender.cpp +++ b/src/DoubleValueSender.cpp @@ -17,10 +17,14 @@ DoubleValueSender::DoubleValueSender(std::string key) { publisher_ = topic.Publish(); } -void DoubleValueSender::sendValue(double value) { publisher_.Set(value); } +void DoubleValueSender::sendValue(double value) { + publisher_.Set(value); + inst_.Flush(); +} void DoubleValueSender::setDefaultValue(double value) { publisher_.SetDefault(value); + inst_.Flush(); } // Class use example @@ -32,4 +36,4 @@ void DoubleValueSender::setDefaultValue(double value) { // std::cout << "Sent value" << std::endl; // } // return 0; -// } \ No newline at end of file +// } From 398009e6a5e8d13df34a884be1e9473e089b796a Mon Sep 17 00:00:00 2001 From: Chris Padwick Date: Sun, 6 Jul 2025 19:41:46 -0700 Subject: [PATCH 2/3] add config for single camera 2910 based robot --- data/camlocations | 10 ++++---- .../robot2910-center_front-offset.json | 25 +++++++++++++++++++ data/robot.txt | 2 +- src/ws_server.cu | 2 +- 4 files changed, 32 insertions(+), 7 deletions(-) create mode 100755 data/camlocs/robot2910-center_front-offset.json diff --git a/data/camlocations b/data/camlocations index da0fced..506edf5 100755 --- a/data/camlocations +++ b/data/camlocations @@ -1,12 +1,12 @@ id loc -cam13 left_front -cam14 right_front +cam13 NOT-INSTALLED +cam14 NOT-INSTALLED 1690 NOT-INSTALLED 199 NOT-INSTALLED -766 NOT-INSTALLED Module_YL20230518V0 NOT-INSTALLED UC762 NOT-INSTALLED UC7626 NOT-INSTALLED UC762W NOT-INSTALLED -cam11 right_back -cam12 left_back +cam11 NOT-INSTALLED +cam12 NOT-INSTALLED +766 center_front diff --git a/data/camlocs/robot2910-center_front-offset.json b/data/camlocs/robot2910-center_front-offset.json new file mode 100755 index 0000000..10e0de8 --- /dev/null +++ b/data/camlocs/robot2910-center_front-offset.json @@ -0,0 +1,25 @@ +{ + "rotation": [ + [ + 0.0, + 0.0, + 1.0 + ], + [ + -1.0, + 0.0, + 0.0 + ], + [ + 0.0, + -1.0, + 0.0 + ] + ], + "offset": [ + 0.0, + 0.0, + 0.0 + ] +} + diff --git a/data/robot.txt b/data/robot.txt index 481e027..1db9773 100644 --- a/data/robot.txt +++ b/data/robot.txt @@ -1 +1 @@ -revb +robot2910 diff --git a/src/ws_server.cu b/src/ws_server.cu index 9298e4d..b127bad 100644 --- a/src/ws_server.cu +++ b/src/ws_server.cu @@ -397,7 +397,7 @@ class AprilTagHandler : public seasocks::WebSocket::Handler { draw_detection_outlines(bgr_img, const_cast(detections)); // Broadcast the image to websocket clients. - if (frame_counter % 50 == 0) { + if (frame_counter % 10 == 0) { // Encode the image to JPEG std::vector buffer; cv::imencode(".jpg", bgr_img, buffer); From 93f2b398ce9f1b6da0cd42d3af1160e7294a2fef Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 7 Jul 2025 02:44:02 +0000 Subject: [PATCH 3/3] Auto-format C++ code using clang-format --- src/DoubleValueSender.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DoubleValueSender.cpp b/src/DoubleValueSender.cpp index 342c2a7..1992a5c 100644 --- a/src/DoubleValueSender.cpp +++ b/src/DoubleValueSender.cpp @@ -17,7 +17,7 @@ DoubleValueSender::DoubleValueSender(std::string key) { publisher_ = topic.Publish(); } -void DoubleValueSender::sendValue(double value) { +void DoubleValueSender::sendValue(double value) { publisher_.Set(value); inst_.Flush(); }