Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust Global Frame in odometry pipeline #331

Merged
merged 4 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cpp/kiss_icp/pipeline/KissICP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,13 @@ KissICP::Vector3dVectorTuple KissICP::Voxelize(const std::vector<Eigen::Vector3d
const auto source = kiss_icp::VoxelDownsample(frame_downsample, voxel_size * 1.5);
return {source, frame_downsample};
}
void KissICP::adjustGlobalFrame(const Sophus::SE3d &global_frame_correction) {
last_pose_ = global_frame_correction * last_pose_;
KissICP::Vector3dVector map_points = local_map_.Pointcloud();
local_map_.Clear();
std::transform(map_points.cbegin(), map_points.cend(), map_points.begin(),
[&](const auto &p) { return global_frame_correction * p; });
local_map_.AddPoints(map_points);
}

benemer marked this conversation as resolved.
Show resolved Hide resolved
} // namespace kiss_icp::pipeline
2 changes: 2 additions & 0 deletions cpp/kiss_icp/pipeline/KissICP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ class KissICP {
Sophus::SE3d pose() const { return last_pose_; }
Sophus::SE3d delta() const { return last_delta_; }

void adjustGlobalFrame(const Sophus::SE3d &global_frame_correction);

private:
Sophus::SE3d last_pose_;
Sophus::SE3d last_delta_;
Expand Down
Loading