update ErrorCode, status, lifecycle
This commit is contained in:
@@ -15,9 +15,11 @@ void on_signal(int) { g_running = false; }
|
||||
|
||||
void run_lidar(lidarlib::LidarConfig cfg) {
|
||||
std::unique_ptr<lidarlib::Lidar> lidar = lidarlib::make_lidar(cfg);
|
||||
if (!lidar->open()) {
|
||||
fprintf(stderr, "[%s] khong mo duoc %s %s:%u\n",
|
||||
cfg.name.c_str(), cfg.brand.c_str(), cfg.ip.c_str(), cfg.port);
|
||||
lidarlib::ErrorCode err = lidar->open();
|
||||
if (err != lidarlib::ErrorCode::Ok) {
|
||||
fprintf(stderr, "[%s] khong mo duoc %s %s:%u (%s)\n",
|
||||
cfg.name.c_str(), cfg.brand.c_str(), cfg.ip.c_str(), cfg.port,
|
||||
lidarlib::to_string(err));
|
||||
return;
|
||||
}
|
||||
printf("[%s] da mo %s %s:%u (model=%s, inverted=%d)\n",
|
||||
|
||||
Reference in New Issue
Block a user