iterative closest points
CEV ICP algorithm library
Loading...
Searching...
No Matches
geo.h
Go to the documentation of this file.
1/*
2 * @author Ethan Uppal
3 * @copyright Copyright (C) 2024 Ethan Uppal. All rights reserved.
4 */
5
6#pragma once
7
8#include <vector>
9#include <cmath>
10#include <sstream>
11#include <Eigen/Core>
12#include <iostream>
13
14namespace icp {
15 using Vector = Eigen::Vector2d;
16 using Matrix = Eigen::Matrix2d;
17
19 struct RBTransform final {
22
23 public:
25 translation = Vector::Zero();
26 rotation = Matrix::Identity();
27 }
30
32 return rotation * v + translation;
33 }
34
35 std::string to_string() const {
36 std::stringstream stream;
37 stream << "RBTransform {\n";
38 stream << " translation:\n" << translation << '\n';
39 stream << " rotation:\n" << rotation << '\n';
40 stream << "}";
41 return stream.str();
42 }
43 };
44
45 Vector get_centroid(const std::vector<Vector>& points);
46}
Definition geo.cpp:9
Eigen::Vector2d Vector
Definition geo.h:15
Vector get_centroid(const std::vector< Vector > &points)
Definition geo.cpp:10
Eigen::Matrix2d Matrix
Definition geo.h:16
Rigid-body transformation.
Definition geo.h:19
Matrix rotation
Definition geo.h:21
Vector apply_to(Vector v) const
Definition geo.h:31
Vector translation
Definition geo.h:20
std::string to_string() const
Definition geo.h:35
RBTransform(Vector translation, Matrix rotation)
Definition geo.h:28