icp_2d.h
Go to the documentation of this file.
1 /*
2  * Copyright 2015 Fetch Robotics Inc.
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef FETCH_AUTO_DOCK_ICP_2D_H
19 #define FETCH_AUTO_DOCK_ICP_2D_H
20 
21 #include <geometry_msgs/Point.h>
22 #include <geometry_msgs/Transform.h>
23 
24 #include <vector>
25 
26 namespace icp_2d
27 {
28 
36 double thetaFromQuaternion(const geometry_msgs::Quaternion& q);
37 
46 std::vector<geometry_msgs::Point>
47 transform(const std::vector<geometry_msgs::Point>& points,
48  double x,
49  double y,
50  double theta);
51 
56 geometry_msgs::Point
57 getCentroid(const std::vector<geometry_msgs::Point> points);
58 
67 bool alignPCA(const std::vector<geometry_msgs::Point> source,
68  const std::vector<geometry_msgs::Point> target,
69  geometry_msgs::Transform & transform);
70 
79 bool alignSVD(const std::vector<geometry_msgs::Point> source,
80  const std::vector<geometry_msgs::Point> target,
81  geometry_msgs::Transform & transform);
82 
91 double alignICP(const std::vector<geometry_msgs::Point> source,
92  const std::vector<geometry_msgs::Point> target,
93  geometry_msgs::Transform & transform,
94  size_t max_iterations = 10,
95  double min_delta_rmsd = 0.000001);
96 
97 } // namespace icp_2d
98 
99 #endif // FETCH_AUTO_DOCK_ICP_2D_H
std::vector< geometry_msgs::Point > transform(const std::vector< geometry_msgs::Point > &points, double x, double y, double theta)
Transform a vector of points in 2d.
Definition: icp_2d.cpp:41
TFSIMD_FORCE_INLINE const tfScalar & y() const
double alignICP(const std::vector< geometry_msgs::Point > source, const std::vector< geometry_msgs::Point > target, geometry_msgs::Transform &transform, size_t max_iterations=10, double min_delta_rmsd=0.000001)
Perform Iterative Closest Point (ICP) algorithm to align two point clouds in a two dimensional plane...
Definition: icp_2d.cpp:289
double thetaFromQuaternion(const geometry_msgs::Quaternion &q)
Get the 2d rotation from a quaternion.
Definition: icp_2d.cpp:28
Definition: icp_2d.h:26
TFSIMD_FORCE_INLINE const tfScalar & x() const
geometry_msgs::Point getCentroid(const std::vector< geometry_msgs::Point > points)
Get the centroid of a set of points.
Definition: icp_2d.cpp:66
bool alignSVD(const std::vector< geometry_msgs::Point > source, const std::vector< geometry_msgs::Point > target, geometry_msgs::Transform &transform)
Perform SVD optimization to align two point clouds in a two dimensional plane.
Definition: icp_2d.cpp:197
bool alignPCA(const std::vector< geometry_msgs::Point > source, const std::vector< geometry_msgs::Point > target, geometry_msgs::Transform &transform)
Perform PCA algorithm to align two point clouds in a two dimensional plane.
Definition: icp_2d.cpp:119


caster_app
Author(s): Ye Tian
autogenerated on Wed Dec 18 2019 03:34:44