update
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <atomic>
|
||||
#include <thread>
|
||||
#include <chrono>
|
||||
@@ -112,7 +113,9 @@ public:
|
||||
// phan van toc thi lo mot mau telemetry la mat vinh vien mot doan quang
|
||||
// duong ma khong phat hien duoc. Xem thirdparty/PROVENANCE.md.
|
||||
bool getPositionCounts(int32_t& out_left, int32_t& out_right,
|
||||
double* out_skew_sec = nullptr);
|
||||
double* out_skew_sec = nullptr,
|
||||
uint64_t* out_seq = nullptr,
|
||||
double* out_age_sec = nullptr);
|
||||
|
||||
bool isReady() const { return hardware_ready_.load(); }
|
||||
bool hasConnectionLost() const { return connection_lost_.load(); }
|
||||
@@ -157,6 +160,16 @@ private:
|
||||
std::atomic<bool> cached_pos_valid_{false};
|
||||
// [vslam] Banh phai lay mau muon hon banh trai bay nhieu giay.
|
||||
std::atomic<double> cached_pos_skew_sec_{0.0};
|
||||
// [vslam] Dem so lan cache vi tri duoc CAP NHAT, va thoi diem cap nhat.
|
||||
//
|
||||
// telemetryLoop chay 50 Hz, ma ben goi cung poll 50 Hz -- hai vong doc lap
|
||||
// cung tan so thi bi nhieu pha: co luc hai lan poll thay CUNG mot gia tri
|
||||
// (van toc ra 0), co luc mot lan poll nuot HAI lan cap nhat (van toc gap
|
||||
// doi). Ben goi dung `seq` de bo qua mau khong doi, va `age` de dong dau
|
||||
// theo luc LAY MAU chu khong phai luc doc cache.
|
||||
std::atomic<uint64_t> cached_pos_seq_{0};
|
||||
std::chrono::steady_clock::time_point cached_pos_time_{};
|
||||
std::mutex cached_pos_time_mu_;
|
||||
void telemetryLoop();
|
||||
|
||||
// Target caching
|
||||
|
||||
Reference in New Issue
Block a user