geometry.h
Go to the documentation of this file.
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2011-2014, Willow Garage, Inc.
5  * Copyright (c) 2014-2016, Open Source Robotics Foundation
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  *
12  * * Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  * * Redistributions in binary form must reproduce the above
15  * copyright notice, this list of conditions and the following
16  * disclaimer in the documentation and/or other materials provided
17  * with the distribution.
18  * * Neither the name of Open Source Robotics Foundation nor the names of its
19  * contributors may be used to endorse or promote products derived
20  * from this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33  * POSSIBILITY OF SUCH DAMAGE.
34  */
35 
38 #ifndef FCL_MATH_GEOMETRY_H
39 #define FCL_MATH_GEOMETRY_H
40 
41 #include <cmath>
42 #include <iostream>
43 #include <vector>
44 
45 #include "fcl/config.h"
46 #include "fcl/common/types.h"
47 #include "fcl/math/triangle.h"
48 
49 namespace fcl {
50 
51 template <typename S>
52 FCL_EXPORT
53 void normalize(Vector3<S>& v, bool* signal);
54 
55 template <typename Derived>
56 FCL_EXPORT
57 typename Derived::RealScalar triple(const Eigen::MatrixBase<Derived>& x,
58  const Eigen::MatrixBase<Derived>& y,
59  const Eigen::MatrixBase<Derived>& z);
60 
61 template <typename S, int M, int N>
62 FCL_EXPORT
63 VectorN<S, M+N> combine(
64  const VectorN<S, M>& v1, const VectorN<S, N>& v2);
65 
66 template <typename S>
67 FCL_EXPORT
68 void hat(Matrix3<S>& mat, const Vector3<S>& vec);
69 
72 template <typename S>
73 FCL_EXPORT
74 void eigen(const Matrix3<S>& m, Vector3<S>& dout, Matrix3<S>& vout);
75 
78 template<typename S>
79 FCL_EXPORT
80 void eigen_old(const Matrix3<S>& m, Vector3<S>& dout, Matrix3<S>& vout);
81 
82 template <typename S>
83 FCL_EXPORT
84 void axisFromEigen(const Matrix3<S>& eigenV,
85  const Vector3<S>& eigenS,
86  Matrix3<S>& axis);
87 
88 template <typename S>
89 FCL_EXPORT
90 void axisFromEigen(const Matrix3<S>& eigenV,
91  const Vector3<S>& eigenS,
92  Transform3<S>& tf);
93 
104 template <typename S>
105 FCL_EXPORT
106 Matrix3<S> generateCoordinateSystem(const Vector3<S>& x_axis);
107 
108 template <typename DerivedA, typename DerivedB, typename DerivedC, typename DerivedD>
109 FCL_EXPORT
110 void relativeTransform(
111  const Eigen::MatrixBase<DerivedA>& R1, const Eigen::MatrixBase<DerivedB>& t1,
112  const Eigen::MatrixBase<DerivedA>& R2, const Eigen::MatrixBase<DerivedB>& t2,
113  Eigen::MatrixBase<DerivedC>& R, Eigen::MatrixBase<DerivedD>& t);
114 
115 template <typename S, typename DerivedA, typename DerivedB>
116 FCL_EXPORT
117 void relativeTransform(
118  const Eigen::Transform<S, 3, Eigen::Isometry>& T1,
119  const Eigen::Transform<S, 3, Eigen::Isometry>& T2,
120  Eigen::MatrixBase<DerivedA>& R, Eigen::MatrixBase<DerivedB>& t);
121 
124 template <typename S>
125 FCL_EXPORT
127  const Vector3<S>* const ps,
128  const Vector3<S>* const ps2,
129  Triangle* ts,
130  unsigned int* indices,
131  int n,
132  const Matrix3<S>& axis,
133  Vector3<S>& origin,
134  S l[2],
135  S& r);
136 
139 template <typename S>
140 FCL_EXPORT
142  const Vector3<S>* const ps,
143  const Vector3<S>* const ps2,
144  Triangle* ts,
145  unsigned int* indices,
146  int n,
147  Transform3<S>& tf,
148  S l[2],
149  S& r);
150 
152 template <typename S>
153 FCL_EXPORT
155  const Vector3<S>& a,
156  const Vector3<S>& b,
157  const Vector3<S>& c,
158  Vector3<S>& center,
159  S& radius);
160 
162 template <typename S>
163 FCL_EXPORT
165  const Vector3<S>* const ps,
166  const Vector3<S>* const ps2,
167  Triangle* ts,
168  unsigned int* indices,
169  int n,
170  const Vector3<S>& query);
171 
174 template <typename S>
175 FCL_EXPORT
176 void getExtentAndCenter(
177  const Vector3<S>* const ps,
178  const Vector3<S>* const ps2,
179  Triangle* ts,
180  unsigned int* indices,
181  int n,
182  const Matrix3<S>& axis,
183  Vector3<S>& center,
184  Vector3<S>& extent);
185 
188 template <typename S>
189 FCL_EXPORT
190 void getExtentAndCenter(
191  const Vector3<S>* const ps,
192  const Vector3<S>* const ps2,
193  Triangle* ts,
194  unsigned int* indices,
195  int n,
196  Transform3<S>& tf,
197  Vector3<S>& extent);
198 
202 template <typename S>
203 FCL_EXPORT
204 void getCovariance(
205  const Vector3<S>* const ps,
206  const Vector3<S>* const ps2,
207  Triangle* ts,
208  unsigned int* indices,
209  int n,
210  Matrix3<S>& M);
211 
212 } // namespace fcl
213 
214 #include "fcl/math/geometry-inl.h"
215 
216 #endif
fcl::circumCircleComputation
template void circumCircleComputation(const Vector3d &a, const Vector3d &b, const Vector3d &c, Vector3d &center, double &radius)
fcl::axisFromEigen
template void axisFromEigen(const Matrix3d &eigenV, const Vector3d &eigenS, Matrix3d &axis)
types.h
triangle.h
fcl::combine
FCL_EXPORT VectorN< S, M+N > combine(const VectorN< S, M > &v1, const VectorN< S, N > &v2)
Definition: geometry-inl.h:441
fcl::normalize
template void normalize(Vector3d &v, bool *signal)
fcl::getCovariance
template void getCovariance(const Vector3d *const ps, const Vector3d *const ps2, Triangle *ts, unsigned int *indices, int n, Matrix3d &M)
fcl::maximumDistance
template double maximumDistance(const Vector3d *const ps, const Vector3d *const ps2, Triangle *ts, unsigned int *indices, int n, const Vector3d &query)
r
S r
Definition: test_sphere_box.cpp:171
fcl::eigen_old
template void eigen_old(const Matrix3d &m, Vector3d &dout, Matrix3d &vout)
fcl::generateCoordinateSystem
template Matrix3d generateCoordinateSystem(const Vector3d &x_axis)
fcl::getExtentAndCenter
template void getExtentAndCenter(const Vector3d *const ps, const Vector3d *const ps2, Triangle *ts, unsigned int *indices, int n, const Matrix3d &axis, Vector3d &center, Vector3d &extent)
fcl::getRadiusAndOriginAndRectangleSize
template void getRadiusAndOriginAndRectangleSize(const Vector3d *const ps, const Vector3d *const ps2, Triangle *ts, unsigned int *indices, int n, const Matrix3d &axis, Vector3d &origin, double l[2], double &r)
fcl::hat
template void hat(Matrix3d &mat, const Vector3d &vec)
fcl::eigen
template void eigen(const Matrix3d &m, Vector3d &dout, Matrix3d &vout)
geometry-inl.h
fcl::triple
FCL_EXPORT Derived::RealScalar triple(const Eigen::MatrixBase< Derived > &x, const Eigen::MatrixBase< Derived > &y, const Eigen::MatrixBase< Derived > &z)
Definition: geometry-inl.h:431
fcl::relativeTransform
FCL_EXPORT void relativeTransform(const Eigen::MatrixBase< DerivedA > &R1, const Eigen::MatrixBase< DerivedB > &t1, const Eigen::MatrixBase< DerivedA > &R2, const Eigen::MatrixBase< DerivedB > &t2, Eigen::MatrixBase< DerivedC > &R, Eigen::MatrixBase< DerivedD > &t)
Definition: geometry-inl.h:659
fcl
Main namespace.
Definition: broadphase_bruteforce-inl.h:45


fcl
Author(s):
autogenerated on Tue Dec 5 2023 03:40:48