- Trajectory (Liste der Sensorposen mit verbundenen Submaps)
- Globale Pose (Submap-Pose).
- Lokale Pose.
- Slice-Pose.
Code: Select all
void CairoPaintSubmapSlices(
const double scale,
const std::map& submaps,
cairo_t* cr, std::function draw_callback) {
cairo_scale(cr, scale, scale);
for (auto& pair : submaps) {
const auto& submap_slice = pair.second;
if (submap_slice.surface == nullptr) {
return;
}
const Eigen::Matrix4d homo =
ToEigen(submap_slice.pose * submap_slice.slice_pose).matrix();
cairo_save(cr);
cairo_matrix_t matrix;
cairo_matrix_init(&matrix, homo(1, 0), homo(0, 0), -homo(1, 1), -homo(0, 1),
homo(0, 3), -homo(1, 3));
cairo_transform(cr, &matrix);
const double submap_resolution = submap_slice.resolution;
cairo_scale(cr, submap_resolution, submap_resolution);
// Invokes caller's callback to utilize slice data in global cooridnate
// frame. e.g. finds bounding box, paints slices.
draw_callback(submap_slice);
cairo_restore(cr);
}
}
Code: Select all
Eigen::Affine3d ToEigen(const ::cartographer::transform::Rigid3d& rigid3) {
return Eigen::Translation3d(rigid3.translation()) * rigid3.rotation();
}
Ich frage mich, ob es eine Möglichkeit gibt, diese Koordinatentransformationen zu reproduzieren und eine von Cartographer erstellte Karte neu zu erstellen, aber mit OpenCV anstelle von Cairo. Könnte mir jemand dabei helfen?
Mobile version