logic ready
This commit is contained in:
@@ -11,6 +11,16 @@ int main() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Chờ cảm biến sẵn sàng: đã nhận được ít nhất một scan hoàn chỉnh
|
||||
// và thiết bị không báo lỗi (motor/điện áp/nhiệt độ...)
|
||||
if (!drv.wait_ready(5000)) {
|
||||
fprintf(stderr, "Cảm biến chưa sẵn sàng: %s (diag: %s)\n",
|
||||
lidarlib::to_string(drv.last_error()),
|
||||
lidarlib::to_string(drv.get_diagnostics()).c_str());
|
||||
drv.close();
|
||||
return 1;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 10; ++i) {
|
||||
lidarlib::ScanResult result;
|
||||
if (!drv.recv_scan(result, 2000)) {
|
||||
|
||||
Reference in New Issue
Block a user