plane.h
Go to the documentation of this file.
1 // -*- mode: c++ -*-
2 /*********************************************************************
3  * Software License Agreement (BSD License)
4  *
5  * Copyright (c) 2015, JSK Lab
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/o2r other materials provided
17  * with the distribution.
18  * * Neither the name of the JSK Lab 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 
36 #ifndef JSK_RECOGNITION_UTILS_GEO_PLANE_H_
37 #define JSK_RECOGNITION_UTILS_GEO_PLANE_H_
38 
39 #include <Eigen/Geometry>
40 #include <boost/shared_ptr.hpp>
41 #include <boost/array.hpp>
42 #include <vector>
44 
45 namespace jsk_recognition_utils
46 {
47  class Plane
48  {
49  public:
51  Plane(const std::vector<float>& coefficients);
52  Plane(const boost::array<float, 4>& coefficients);
53  Plane(Eigen::Vector3f normal, double d);
54  Plane(Eigen::Vector3f normal, Eigen::Vector3f p);
55  virtual ~Plane();
56  virtual Plane flip();
57  virtual Plane::Ptr faceToOrigin();
58  virtual bool isSameDirection(const Plane& another);
59  virtual bool isSameDirection(const Eigen::Vector3f& another_normal);
60  virtual double signedDistanceToPoint(const Eigen::Vector4f p);
61  virtual double distanceToPoint(const Eigen::Vector4f p);
62  virtual double signedDistanceToPoint(const Eigen::Vector3f p);
63  virtual double distanceToPoint(const Eigen::Vector3f p);
64  virtual double distance(const Plane& another);
65  virtual double angle(const Plane& another);
66  virtual double angle(const Eigen::Vector3f& vector);
67  virtual void project(const Eigen::Vector3f& p, Eigen::Vector3f& output);
68  virtual void project(const Eigen::Vector3d& p, Eigen::Vector3d& output);
69  virtual void project(const Eigen::Vector3d& p, Eigen::Vector3f& output);
70  virtual void project(const Eigen::Vector3f& p, Eigen::Vector3d& output);
71  virtual void project(const Eigen::Affine3d& pose, Eigen::Affine3d& output);
72  virtual void project(const Eigen::Affine3f& pose, Eigen::Affine3f& output);
73  virtual Eigen::Vector3f getNormal();
74  virtual Eigen::Vector3f getPointOnPlane();
75  virtual Plane transform(const Eigen::Affine3d& transform);
76  virtual Plane transform(const Eigen::Affine3f& transform);
77  virtual void toCoefficients(std::vector<float>& output);
78  virtual std::vector<float> toCoefficients();
79  virtual double getD();
80  virtual Eigen::Affine3f coordinates();
81  protected:
82  virtual void initializeCoordinates();
83  Eigen::Vector3f normal_;
84  double d_;
85  Eigen::Affine3f plane_coordinates_;
86  private:
87  };
88 
89 }
90 
91 #endif
92 
93 
d
Definition: setup.py:9
Eigen::Affine3f plane_coordinates_
Definition: plane.h:85
virtual Eigen::Vector3f getPointOnPlane()
Definition: plane.cpp:78
virtual bool isSameDirection(const Plane &another)
Definition: plane.cpp:102
virtual Plane::Ptr faceToOrigin()
Definition: plane.cpp:89
virtual double angle(const Plane &another)
Definition: plane.cpp:154
virtual Plane transform(const Eigen::Affine3d &transform)
Definition: plane.cpp:225
virtual Eigen::Affine3f coordinates()
Definition: plane.cpp:282
virtual void initializeCoordinates()
Definition: plane.cpp:264
Plane(const std::vector< float > &coefficients)
Definition: plane.cpp:44
virtual double getD()
Definition: plane.cpp:259
virtual std::vector< float > toCoefficients()
Definition: plane.cpp:239
boost::shared_ptr< Plane > Ptr
Definition: plane.h:50
virtual Plane flip()
Definition: plane.cpp:84
virtual void project(const Eigen::Vector3f &p, Eigen::Vector3f &output)
Definition: plane.cpp:171
virtual double signedDistanceToPoint(const Eigen::Vector4f p)
Definition: plane.cpp:117
virtual double distance(const Plane &another)
Definition: plane.cpp:132
Eigen::Vector3f normal_
Definition: plane.h:83
virtual Eigen::Vector3f getNormal()
Definition: plane.cpp:254
virtual double distanceToPoint(const Eigen::Vector4f p)
Definition: plane.cpp:122


jsk_recognition_utils
Author(s):
autogenerated on Mon May 3 2021 03:03:03