Skip to content
Snippets Groups Projects
Commit 2bff8c9f authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Allow for missing registration file, use identity by default

parent bb91cdf1
No related branches found
No related tags found
No related merge requests found
Pipeline #10737 passed
...@@ -135,6 +135,14 @@ public: ...@@ -135,6 +135,14 @@ public:
std::map<string, Eigen::Matrix4f> loadRegistration() { std::map<string, Eigen::Matrix4f> loadRegistration() {
std::map<string, Eigen::Matrix4f> registration; std::map<string, Eigen::Matrix4f> registration;
std::ifstream file(string(FTL_LOCAL_CONFIG_ROOT) + "/registration.json"); std::ifstream file(string(FTL_LOCAL_CONFIG_ROOT) + "/registration.json");
// Use identity transform if no registration
if (!file.is_open()) {
Eigen::Matrix4f T;
registration["default"] = T.setIdentity();
return registration;
}
nlohmann::json load; nlohmann::json load;
file >> load; file >> load;
...@@ -327,7 +335,10 @@ static void run() { ...@@ -327,7 +335,10 @@ static void run() {
registration = loadRegistration(); registration = loadRegistration();
} }
vector<Eigen::Matrix4f> T; vector<Eigen::Matrix4f> T;
for (auto &input : inputs) { T.push_back(registration[input.getURI()]); } for (auto &input : inputs) {
Eigen::Matrix4f RT = (registration.count(input.getURI()) > 0) ? registration[input.getURI()] : registration["default"];
T.push_back(RT);
}
// //
vector<PointCloud<PointXYZRGB>::Ptr> clouds(inputs.size()); vector<PointCloud<PointXYZRGB>::Ptr> clouds(inputs.size());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment