Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #ifndef TRANSFORMER_H_
00009 #define TRANSFORMER_H_
00010
00011 #include <ros/ros.h>
00012
00013 #include <geometry_msgs/Point.h>
00014 #include <geometry_msgs/Quaternion.h>
00015 #include <geometry_msgs/Pose.h>
00016 #include <geometry_msgs/PointStamped.h>
00017 #include <geometry_msgs/QuaternionStamped.h>
00018 #include <geometry_msgs/PoseStamped.h>
00019 #include <arm_navigation_msgs/Constraints.h>
00020
00021 #include <planning_environment/models/model_utils.h>
00022
00023 class Transformer
00024 {
00025 public:
00026 Transformer();
00027 virtual ~Transformer();
00028
00029 static bool transform(const std::string& new_frame,
00030 const std::string& old_frame,
00031 const arm_navigation_msgs::RobotState& robotState,
00032 geometry_msgs::Point& point);
00033 static bool transform(const std::string& new_frame,
00034 const std::string& old_frame,
00035 const arm_navigation_msgs::RobotState& robotState,
00036 geometry_msgs::Quaternion& quaternion);
00037 static bool transform(const std::string& new_frame,
00038 const std::string& old_frame,
00039 const arm_navigation_msgs::RobotState& robotState,
00040 geometry_msgs::Pose& pose);
00041
00042 static bool transform(const std::string& new_frame,
00043 const std::string& old_frame,
00044 const arm_navigation_msgs::RobotState& robotState,
00045 geometry_msgs::PointStamped& point);
00046 static bool transform(const std::string& new_frame,
00047 const std::string& old_frame,
00048 const arm_navigation_msgs::RobotState& robotState,
00049 geometry_msgs::QuaternionStamped& quaternion);
00050 static bool transform(const std::string& new_frame,
00051 const std::string& old_frame,
00052 const arm_navigation_msgs::RobotState& robotState,
00053 geometry_msgs::PoseStamped& pose);
00054
00055 static bool transform(const std::string& new_frame,
00056 const arm_navigation_msgs::RobotState& robotState,
00057 arm_navigation_msgs::Constraints& constraint);
00058
00059 private:
00060 static Transformer* instance;
00061 bool getTransform(const std::string& to_frame,
00062 const std::string& from_frame,
00063 const arm_navigation_msgs::RobotState& robotState,
00064 tf::Transform& transform);
00065 bool getWorldTransform(const std::string& frame_id,
00066 const planning_models::KinematicState &state,
00067 tf::Transform &transform);
00068 std::string relative_frame(const std::string& frame_id) const;
00069 planning_environment::RobotModels robot_model;
00070 };
00071
00072 #endif