Skip to content

Commit f387d23

Browse files
SeaOtocinclusfacebook-github-bot
authored andcommitted
{Feature} Core - Expose mAria CAD calibration (#129)
Summary: Pull Request resolved: #129 Add CAD calibration value for Camera and IMU Reviewed By: hxtang, chpeng-fb, PiotrBrzyski Differential Revision: D60181693 fbshipit-source-id: fb9d74c352c347242095806172a408841e37c64b
1 parent 22b2451 commit f387d23

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

core/calibration/DeviceCadExtrinsics.cpp

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,26 @@ std::unordered_map<std::string, Sophus::SE3d> constructCadForDvtLarge() {
147147

148148
return cadMapT_Device_Sensor;
149149
}
150+
151+
// A helper function for constructing CAD extrinsics for DVT-MARIA
152+
std::unordered_map<std::string, Sophus::SE3d> constructCadForDvtmAria() {
153+
std::unordered_map<std::string, Sophus::SE3d> cadMapT_Device_Sensor;
154+
155+
const std::vector<std::string> cadCsvLines = {
156+
"camera-slam-left, 0.034514, 0.018218, 0.031484, 0.706941, -0.000074, -0.707273, 0.579394, 0.573576, 0.579062",
157+
"camera-slam-right, -0.034514, 0.018218, 0.031484, 0.706941, 0.000074, 0.707273, -0.579394, 0.573576, 0.579062",
158+
"camera-rgb, 0.0000, 0.021863, 0.033201, 1.000000, 0.000000, 0.000000, 0.000000, 0.573576, 0.819152",
159+
"imu-left, 0.021263 ,0.014650, 0.033979, 0, -1, 0, 0, 0, 1",
160+
"imu-right, -0.023299, 0.016315, 0.034099, 1, 0, 0, 0, 0, 1"};
161+
for (const auto& line : cadCsvLines) {
162+
const auto maybeLabelAndPose = readSingleCsvLine(line);
163+
XR_CHECK(maybeLabelAndPose.has_value(), "Reading csv line has failed: {}", line);
164+
cadMapT_Device_Sensor.emplace(
165+
maybeLabelAndPose.value().first, maybeLabelAndPose.value().second);
166+
}
167+
168+
return cadMapT_Device_Sensor;
169+
}
150170
} // namespace
151171

152172
DeviceCadExtrinsics::DeviceCadExtrinsics(
@@ -157,8 +177,7 @@ DeviceCadExtrinsics::DeviceCadExtrinsics(
157177
} else if (deviceSubType == "DVT-L") {
158178
labelToT_Cpf_Sensor_ = constructCadForDvtLarge();
159179
} else if (deviceSubType == "DVT-MARIA") {
160-
XR_LOGW("No CAD available for mAria device");
161-
return;
180+
labelToT_Cpf_Sensor_ = constructCadForDvtmAria();
162181
} else if (deviceSubType == "SimulatedDevice") {
163182
XR_LOGW("No CAD available for simulated device");
164183
return;
@@ -177,7 +196,7 @@ std::optional<Sophus::SE3d> DeviceCadExtrinsics::getT_Device_Sensor(
177196
if (maybePose != labelToT_Cpf_Sensor_.end()) {
178197
return T_Device_Cpf_ * maybePose->second;
179198
} else {
180-
return std::nullopt;
199+
return {};
181200
}
182201
}
183202

0 commit comments

Comments
 (0)