From 2878e00d8b5db4f1350c955d277d14f440c4ac34 Mon Sep 17 00:00:00 2001 From: trung09122002 Date: Thu, 3 Sep 2026 10:57:35 +0700 Subject: [PATCH] feat(sim): them camera IR phai (infra2) de chay duoc stereo_odometry Sim truoc gio chi phat infra1 + depth, du URDF da khai camera_infra2_optical_frame. Thieu infra2 thi stereo_odometry khong test duoc - ma do lai la duong DUY NHAT co the dung tren phan cung that: voi emitter Bat, mau cham co dinh theo camera lam ORB bam vao cham thay vi bam vao canh; chi khi emitter=Off hai camera IR moi thanh cap stereo thu dong. Nghiem thu (check_stereo.py, world house): TRAI /camera/infra1 30.1 Hz P[3] = -0.0000 PHAI /camera/infra2 19.0 Hz P[3] = -25.6158 baseline suy nguoc 0.0550 m, lech 0.0000 189/301 khung trai co doi tac trong 2 ms infra2 ROT KHUNG chu khong lech pha: trung vi lech 0.0 ms, phan con lai lech dung 33 ms = mot chu ky 30Hz. Cac cap CO thi chinh xac tuyet doi. => stereo_odometry PHAI dat approx_sync=false. De true thi no ghep khung trai voi khung phai cach 33 ms va sinh loi disparity that. Hai cach lam da thu va bo: 1. Hai plugin cung camera -> "Tried to advertise a service that is already advertised [/camera/set_camera_info]". Sua bang cameraName=camera/infra2: dich vu tach ra ma topic van dung, vi plugin ghep /. 2. - dung ra la cach dung cho stereo vi no render ca hai trong MOT lan cap nhat. Gazebo 11 KHONG HO TRO khi model duoc dua vao tu URDF: [Wrn] [msgs.cc:1844] Conversion of sensor type[multicamera] not supported Cam bien bi bo im lang - khong topic nao, va log o terminal SACH TRON; canh bao chi nam trong ~/.gazebo/server-*/default.log. hackBaseline khong phai meo vat ma la cach dat P[3] cua camera_info. Thieu no thi he coi hai camera trung nhau, do sau ra vo cuc, ma stereo_odometry van chay khong bao loi. Do la ly do check_stereo.py ton tai. --- src/robot_sim/urdf/gazebo_sensors.xacro | 98 +++++++++++ src/slam_eval/CMakeLists.txt | 1 + src/slam_eval/scripts/check_stereo.py | 213 ++++++++++++++++++++++++ 3 files changed, 312 insertions(+) create mode 100755 src/slam_eval/scripts/check_stereo.py diff --git a/src/robot_sim/urdf/gazebo_sensors.xacro b/src/robot_sim/urdf/gazebo_sensors.xacro index d25a7f4..b4d9d12 100644 --- a/src/robot_sim/urdf/gazebo_sensors.xacro +++ b/src/robot_sim/urdf/gazebo_sensors.xacro @@ -270,6 +270,104 @@ + + + + true + 30.0 + + 0 -0.055 0 0 0 0 + + 1.204 + + 640 + 480 + L8 + + + 0.22 + 10.0 + + + gaussian + 0.0 + 0.007 + + + + true + 30.0 + + camera/infra2 + image_rect_raw + camera_info + camera_infra1_optical_frame + + 0.055 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + + + +