Go to the documentation of this file.00001
00024 #ifndef CCNY_RGBD_RGBD_UTIL_H
00025 #define CCNY_RGBD_RGBD_UTIL_H
00026
00027 #include <ros/ros.h>
00028 #include <pcl/point_types.h>
00029 #include <pcl/point_cloud.h>
00030 #include <tf/transform_datatypes.h>
00031 #include <pcl/filters/voxel_grid.h>
00032 #include <opencv2/opencv.hpp>
00033 #include <cv_bridge/cv_bridge.h>
00034
00035 #include <rgbdtools/rgbdtools.h>
00036
00037 #include "ccny_rgbd/types.h"
00038
00039 namespace ccny_rgbd {
00040
00048 void getTfDifference(const tf::Transform& motion, double& dist, double& angle);
00049
00059 void getTfDifference(
00060 const tf::Transform& a,
00061 const tf::Transform b,
00062 double& dist, double& angle);
00063
00071 bool tfGreaterThan(const tf::Transform& a, double dist, double angle);
00072
00077 tf::Transform tfFromEigen(Eigen::Matrix4f trans);
00078
00083 Eigen::Matrix4f eigenFromTf(const tf::Transform& tf);
00084 int getmaxheight(PathMsg path_msg);
00085 int getminheight(PathMsg path_msg);
00086
00087 tf::Transform tfFromEigenAffine(const AffineTransform& trans);
00088 AffineTransform eigenAffineFromTf(const tf::Transform& tf);
00089
00097 void tfToEigenRt(
00098 const tf::Transform& tf,
00099 Matrix3f& R,
00100 Vector3f& t);
00101
00109 void tfToOpenCVRt(
00110 const tf::Transform& transform,
00111 cv::Mat& R,
00112 cv::Mat& t);
00113
00121 void openCVRtToTf(
00122 const cv::Mat& R,
00123 const cv::Mat& t,
00124 tf::Transform& transform);
00125
00136 void tfToXYZRPY(
00137 const tf::Transform& t,
00138 double& x, double& y, double& z,
00139 double& roll, double& pitch, double& yaw);
00140
00147 void convertCameraInfoToMats(
00148 const CameraInfoMsg::ConstPtr camera_info_msg,
00149 cv::Mat& intr,
00150 cv::Mat& dist);
00151
00158 void convertMatToCameraInfo(
00159 const cv::Mat& intr,
00160 CameraInfoMsg& camera_info_msg);
00161
00167 double getMsDuration(const ros::WallTime& start);
00168
00169 void createRGBDFrameFromROSMessages(
00170 const ImageMsg::ConstPtr& rgb_msg,
00171 const ImageMsg::ConstPtr& depth_msg,
00172 const CameraInfoMsg::ConstPtr& info_msg,
00173 rgbdtools::RGBDFrame& frame);
00174
00179 void pathEigenAffineToROS(
00180 const AffineTransformVector& path,
00181 PathMsg& path_msg);
00182
00186 void pathROSToEigenAffine(
00187 const PathMsg& path_msg,
00188 AffineTransformVector& path);
00189
00190 }
00191
00192 #endif // CCNY_RGBD_RGBD_UTIL_H