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
00031
00032 #ifndef __GEOMETRY_H__
00033 #define __GEOMETRY_H__
00034
00035 #include <ros/ros.h>
00036
00037 #include <tf/transform_listener.h>
00038
00039 class Geometry
00040 {
00041 private:
00042
00043 static tf::TransformListener *listener_;
00044
00045 static Geometry *instance;
00046
00047 Geometry();
00048
00049 ~Geometry();
00050
00051 public:
00052
00053 static Geometry* getInstance()
00054 {
00055 if (!instance)instance = new Geometry();
00056 return instance;
00057 }
00058
00059 static void init();
00060
00061
00062 static tf::Stamped<tf::Pose> scaleStampedPose(const tf::Stamped<tf::Pose> &in, double scale);
00063 static tf::Stamped<tf::Pose> scaleStampedTransform(const tf::Stamped<tf::Pose> &in, double scale);
00064
00065 static tf::Stamped<tf::Pose> getPoseIn(const char target_frame[], tf::Stamped<tf::Pose> src);
00066
00067 static void printPose(const tf::Stamped<tf::Pose> &toolTargetPose);
00068
00069 static tf::Stamped<tf::Pose> getPose(const char target_frame[],const char lookup_frame[]);
00070
00071 static tf::Stamped<tf::Pose> getRelativeTransform(const char source_frameid[], const char target_frameid[]);
00072
00073 static tf::Stamped<tf::Pose> getTransform(const char baseframe[], const char toolframe[]);
00074
00075 static tf::Stamped<tf::Pose> rotateAroundBaseAxis(tf::Stamped<tf::Pose> toolPose, double r_x,double r_y,double r_z);
00076 static tf::Stamped<tf::Pose> rotateAroundToolframeAxis(tf::Stamped<tf::Pose> toolPose, double r_x,double r_y,double r_z);
00077 static tf::Stamped<tf::Pose> rotateAroundPose(tf::Stamped<tf::Pose> toolPose, tf::Stamped<tf::Pose> pivot, double r_x, double r_y, double r_z);
00078 static tf::Stamped<tf::Pose> rotateAroundPose(tf::Stamped<tf::Pose> toolPose, tf::Stamped<tf::Pose> pivot, btQuaternion qa);
00079
00080 static tf::Stamped<tf::Pose> approach(tf::Stamped<tf::Pose> toolPose, double dist = 0.1);
00081
00082 static tf::Stamped<tf::Pose> make_pose(double x, double y, double z, double ox, double oy, double oz, double ow, const char target_frame[]);
00083
00084 static tf::Stamped<tf::Pose> make_pose(const btTransform &trans, const char target_frame[]);
00085
00086
00087 static tf::Stamped<tf::Pose> getRel(const tf::Stamped<tf::Pose> &root_frame, const tf::Stamped<tf::Pose> &relative_pose);
00088
00089 static tf::Stamped<tf::Pose> getRelInBase(const tf::Stamped<tf::Pose> &root_frame, const btVector3 &dist);
00090
00091 static void printPose(const char title[], tf::Stamped<tf::Pose> pose);
00092
00093
00094 };
00095
00096
00097 #endif