iterative closest points
CEV ICP algorithm library
Loading...
Searching...
No Matches
src
icp
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
14
namespace
icp
{
15
using
Vector
= Eigen::Vector2d;
16
using
Matrix
= Eigen::Matrix2d;
17
19
struct
RBTransform
final {
20
Vector
translation
;
21
Matrix
rotation
;
22
23
public
:
24
RBTransform
() {
25
translation
= Vector::Zero();
26
rotation
= Matrix::Identity();
27
}
28
RBTransform
(
Vector
translation
,
Matrix
rotation
)
29
:
translation
(
translation
),
rotation
(
rotation
) {}
30
31
Vector
apply_to
(
Vector
v)
const
{
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
}
icp
Definition
geo.cpp:9
icp::Vector
Eigen::Vector2d Vector
Definition
geo.h:15
icp::get_centroid
Vector get_centroid(const std::vector< Vector > &points)
Definition
geo.cpp:10
icp::Matrix
Eigen::Matrix2d Matrix
Definition
geo.h:16
icp::RBTransform
Rigid-body transformation.
Definition
geo.h:19
icp::RBTransform::rotation
Matrix rotation
Definition
geo.h:21
icp::RBTransform::apply_to
Vector apply_to(Vector v) const
Definition
geo.h:31
icp::RBTransform::RBTransform
RBTransform()
Definition
geo.h:24
icp::RBTransform::translation
Vector translation
Definition
geo.h:20
icp::RBTransform::to_string
std::string to_string() const
Definition
geo.h:35
icp::RBTransform::RBTransform
RBTransform(Vector translation, Matrix rotation)
Definition
geo.h:28
Generated by
1.10.0