This commit is contained in:
trung09122002
2026-09-19 18:35:09 +07:00
parent 3896886349
commit 62b611a3eb
9 changed files with 238 additions and 30 deletions

View File

@@ -27,8 +27,11 @@
namespace vslam {
struct RobotGeometry {
double wheel_radius = 0.075;
double wheel_separation = 0.36;
// Do tren robot that: banh Ø173 mm. Phai TRUNG voi BaseConfig trong
// driver_config.h -- hai default khac nhau cho cung mot dai luong vat ly la
// dung cai bay ma file nay ton tai de tranh.
double wheel_radius = 0.0865;
double wheel_separation = 0.400;
double robot_radius = 0.24;
double body_half_width = 0.17;

View File

@@ -32,11 +32,16 @@
// - block cuoi cua goi phai lay azimuth tu goi SAU, nen driver luon giu lai
// mot goi va giai ma tre mot nhip. Do la ly do co `pending_`.
//
// ================== HAI QUY UOC PHAI DOI ==================
// Manual §8.1: LakiBeam tra ve X = R*sin(a), Y = R*cos(a)
// REP-103: he nay dung x = R*cos(t), y = R*sin(t)
// => t = 90do - a. Trong config la angle_offset_deg = 90 VA inverted = true.
// Thieu mot trong hai thi ban do lat guong.
// ================== QUY UOC GOC + TU THE GAN ==================
// Manual §8.1: LakiBeam tra ve X_dev = R*sin(a), Y_dev = R*cos(a)
// REP-103: he nay dung x = R*cos(t), y = R*sin(t)
//
// LiDAR tren robot nay GAN UP NGUOC, tuc xoay 180do quanh truc X (Y doi dau):
// gan xuoi -> t = 90do - a (offset +90, inverted = true)
// gan up nguoc -> t = a - 90do (offset -90, inverted = FALSE)
//
// Hai phep dao dau -- cua quy uoc va cua tu the gan -- triet tieu nhau. Chi
// tiet va canh bao "dung bu lan thu hai trong TF" nam o driver_config.h.
//
// Don vi range la MILIMET (scan_conversion.cpp:36 chia 1000), KHONG phai 2 mm
// nhu Velodyne -- suy tu layout goi se ra sai dung gap doi.
@@ -107,7 +112,7 @@ struct Point {
class LakiBeamDriver : public LidarInterface {
public:
LakiBeamDriver(const LidarConfig& cfg, ClockPtr clock)
: cfg_(cfg), clock_(std::move(clock)), sanitizer_(cfg.sanitizer) {}
: cfg_(cfg), clock_(std::move(clock)) {}
~LakiBeamDriver() override { Close(); }
@@ -363,8 +368,18 @@ class LakiBeamDriver : public LidarInterface {
}
scan->header.stamp = stamp;
sanitizer_.Apply(scan.get());
// ⚠️ KHONG goi ScanSanitizer o day, du LidarConfig co mang mot
// ScanSanitizerConfig. Driver tra ve scan THO.
//
// Hai ly do, ca hai deu tu kien truc co san:
// 1. Node da ve sinh roi (wiring.cc goi sanitizer_->Apply), va no dung
// DUNG MOT doi tuong ScanSanitizer cho moi nguon. Ve sinh hai lan
// la lam thua, va lam lech thong ke cua chinh sanitizer do.
// 2. Ban ghi .vsr luu du lieu THO co y -- replay_source.h noi ro "de doi
// nguong roi test lai duoc". Neu driver ve sinh truoc khi ghi thi
// nguong bi dong cung vao file va khong bao gio chinh lai duoc.
//
// cfg_.sanitizer o day CHI dung de dien range_min/range_max cua header.
{
std::lock_guard<std::mutex> lk(stats_mu_);
++stats_.frames;
@@ -406,7 +421,6 @@ class LakiBeamDriver : public LidarInterface {
LidarConfig cfg_;
ClockPtr clock_;
ScanSanitizer sanitizer_;
ScanCallback cb_;
int fd_ = -1;