plane.h
Go to the documentation of this file.
00001 // -*- mode: c++ -*-
00002 /*********************************************************************
00003  * Software License Agreement (BSD License)
00004  *
00005  *  Copyright (c) 2015, JSK Lab
00006  *  All rights reserved.
00007  *
00008  *  Redistribution and use in source and binary forms, with or without
00009  *  modification, are permitted provided that the following conditions
00010  *  are met:
00011  *
00012  *   * Redistributions of source code must retain the above copyright
00013  *     notice, this list of conditions and the following disclaimer.
00014  *   * Redistributions in binary form must reproduce the above
00015  *     copyright notice, this list of conditions and the following
00016  *     disclaimer in the documentation and/o2r other materials provided
00017  *     with the distribution.
00018  *   * Neither the name of the JSK Lab nor the names of its
00019  *     contributors may be used to endorse or promote products derived
00020  *     from this software without specific prior written permission.
00021  *
00022  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00023  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00024  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00025  *  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
00026  *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00027  *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00028  *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00029  *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00030  *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00031  *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
00032  *  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00033  *  POSSIBILITY OF SUCH DAMAGE.
00034  *********************************************************************/
00035 
00036 #ifndef JSK_RECOGNITION_UTILS_GEO_PLANE_H_
00037 #define JSK_RECOGNITION_UTILS_GEO_PLANE_H_
00038 
00039 #include <Eigen/Geometry>
00040 #include <boost/shared_ptr.hpp>
00041 #include <boost/array.hpp>
00042 #include <vector>
00043 #include "jsk_recognition_utils/types.h"
00044 
00045 namespace jsk_recognition_utils
00046 {
00047   class Plane
00048   {
00049   public:
00050     typedef boost::shared_ptr<Plane> Ptr;
00051     Plane(const std::vector<float>& coefficients);
00052     Plane(const boost::array<float, 4>& coefficients);
00053     Plane(Eigen::Vector3f normal, double d);
00054     Plane(Eigen::Vector3f normal, Eigen::Vector3f p);
00055     virtual ~Plane();
00056     virtual Plane flip();
00057     virtual Plane::Ptr faceToOrigin();
00058     virtual bool isSameDirection(const Plane& another);
00059     virtual bool isSameDirection(const Eigen::Vector3f& another_normal);
00060     virtual double signedDistanceToPoint(const Eigen::Vector4f p);
00061     virtual double distanceToPoint(const Eigen::Vector4f p);
00062     virtual double signedDistanceToPoint(const Eigen::Vector3f p);
00063     virtual double distanceToPoint(const Eigen::Vector3f p);
00064     virtual double distance(const Plane& another);
00065     virtual double angle(const Plane& another);
00066     virtual double angle(const Eigen::Vector3f& vector);
00067     virtual void project(const Eigen::Vector3f& p, Eigen::Vector3f& output);
00068     virtual void project(const Eigen::Vector3d& p, Eigen::Vector3d& output);
00069     virtual void project(const Eigen::Vector3d& p, Eigen::Vector3f& output);
00070     virtual void project(const Eigen::Vector3f& p, Eigen::Vector3d& output);
00071     virtual void project(const Eigen::Affine3d& pose, Eigen::Affine3d& output);
00072     virtual void project(const Eigen::Affine3f& pose, Eigen::Affine3f& output);
00073     virtual Eigen::Vector3f getNormal();
00074     virtual Eigen::Vector3f getPointOnPlane();
00075     virtual Plane transform(const Eigen::Affine3d& transform);
00076     virtual Plane transform(const Eigen::Affine3f& transform);
00077     virtual void toCoefficients(std::vector<float>& output);
00078     virtual std::vector<float> toCoefficients();
00079     virtual double getD();
00080     virtual Eigen::Affine3f coordinates();
00081   protected:
00082     virtual void initializeCoordinates();
00083     Eigen::Vector3f normal_;
00084     double d_;
00085     Eigen::Affine3f plane_coordinates_;
00086   private:
00087   };
00088 
00089 }
00090 
00091 #endif
00092 
00093 


jsk_recognition_utils
Author(s):
autogenerated on Tue Jul 2 2019 19:40:37