agrobot_base/AgroBase/livox_visual_debugger/metrics.hpp

35 lines
1004 B
C++

#pragma once
#include <cstdint>
#include "core.hpp"
struct MetricsParams {
float x_min = 0.10f, x_max = 6.00f;
float y_min = -2.00f, y_max = 2.00f;
float z_min = -0.50f, z_max = 2.00f;
float voxel_leaf = 0.05f;
float cluster_tol = 0.18f;
int min_cluster = 60;
int max_cluster = 50000;
float alpha_complementar = 0.98f;
};
namespace Metrics {
void init(const MetricsParams& p);
void set_params(const MetricsParams& p);
MetricsParams get_params();
// IMU continua síncrono (barato)
void update_from_imu(float ax, float ay, float az, float gx, float gy, float gz, uint64_t t_ms);
// >>> NOVO: worker assíncrono para nuvens <<<
void start_worker();
void stop_worker();
// Enfileira a nuvem acumulada para a thread processar
void enqueue_cloud(const CloudRGB& merged, uint64_t now_ms);
// (se quiser chamar síncrono em testes)
// void update_from_cloud(const CloudRGB& merged, uint64_t now_ms);
} // namespace Metrics