oh_my_loam/oh_my_loam/mapper/mapper.cc

47 lines
1.1 KiB
C++
Raw Normal View History

2020-11-03 19:33:15 +08:00
#include "mapper.h"
2021-01-27 00:48:27 +08:00
#include <mutex>
2020-11-03 19:33:15 +08:00
namespace oh_my_loam {
2021-01-05 14:33:42 +08:00
namespace {
using namespace common;
} // namespace
bool Mapper::Init() {
2021-01-22 16:33:55 +08:00
const auto &config = YAMLConfig::Instance()->config();
2021-01-05 14:33:42 +08:00
config_ = config["mapper_config"];
is_vis_ = config["vis"].as<bool>() && config_["vis"].as<bool>();
verbose_ = config_["vis"].as<bool>();
2020-11-03 19:33:15 +08:00
AINFO << "Mapping visualizer: " << (is_vis_ ? "ON" : "OFF");
return true;
}
2021-01-26 21:00:31 +08:00
void Mapper::Reset() {}
void Mapper::Process(double timestamp, const TPointCloudConstPtr &cloud_corn,
const TPointCloudConstPtr &cloud_surf,
common::Pose3d *const pose_out) {
2021-01-27 00:48:27 +08:00
if (GetState() == UN_INIT) {
2021-01-26 21:00:31 +08:00
cloud_corn_map_ = cloud_corn;
cloud_surf_map_ = cloud_surf;
pose_out->SetIdentity();
2021-01-27 00:48:27 +08:00
SetState(DONE);
2021-01-26 21:00:31 +08:00
return;
}
2021-01-27 00:48:27 +08:00
if (GetState() == DONE) {
Update();
} else { // RUNNING
}
}
void Mapper::Run(double timestamp, const TPointCloudConstPtr &cloud_corn,
const TPointCloudConstPtr &cloud_surf) {
TimePose pose;
pose.timestamp = timestamp;
std::lock_guard<std::mutex> lock(mutex_);
2021-01-26 21:00:31 +08:00
}
2020-11-03 19:33:15 +08:00
void Mapper::Visualize() {}
} // namespace oh_my_loam