Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef PLANE_TRANSFORM
00034 #define PLANE_TRANSFORM
00035
00036 #include <sensor_msgs/CameraInfo.h>
00037 #include <sensor_msgs/PointCloud.h>
00038
00039
00040 #include "fast_plane_detection/Plane.h"
00041
00042 #include <tf/transform_listener.h>
00043
00044 namespace fast_plane_detection {
00045
00046 typedef geometry_msgs::Point32 Point;
00047
00048 class PlaneTransform {
00049
00050 public:
00051 PlaneTransform(const sensor_msgs::CameraInfo &camera_info,
00052 float baseline, float up_direction);
00053
00054 PlaneTransform(float fx, float fy,
00055 float cx, float cy,
00056 float baseline, float up_direction);
00057 ~PlaneTransform();
00058
00059 void setParameters( float alpha,
00060 float beta,
00061 float d,
00062 int min_x, int max_x,
00063 int min_y, int max_y,
00064 std_msgs::Header header);
00065
00066 bool getPlane( fast_plane_detection::Plane &plane );
00067
00068 private:
00069
00070 std::vector<double> convertTo3DPlane(float alpha,
00071 float beta,
00072 float d );
00073
00074 tf::Transform getPlaneTransform (const std::vector<double> &coeffs,
00075
00076 double up_direction);
00077
00078 bool transformPlanePoints ( const tf::Transform& plane_trans,
00079 sensor_msgs::PointCloud &plane_limits );
00080
00081 fast_plane_detection::Plane
00082 constructPlaneMsg(const sensor_msgs::PointCloud &plane_limits,
00083 const std::vector<double> &coeffs,
00084 const tf::Transform &plane_trans);
00085
00086 void get3DTableLimits(sensor_msgs::PointCloud &plane_limits);
00087
00088 void get3DPlanePoint( int u, int v, Point &p);
00089
00090
00091
00092 float fx_, fy_;
00093 float cx_, cy_;
00094
00095 float baseline_;
00096 float up_direction_;
00097
00098 float alpha_, beta_, d_;
00099
00100 int min_x_, max_x_;
00101 int min_y_, max_y_;
00102
00103 std_msgs::Header header_;
00104
00105 tf::TransformListener listener;
00106
00107 };
00108
00109 }
00110
00111 #endif