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 #ifndef COB_CARTESIAN_CONTROLLER_CARTESIAN_CONTROLLER_UTILS_H
00019 #define COB_CARTESIAN_CONTROLLER_CARTESIAN_CONTROLLER_UTILS_H
00020
00021 #include <string>
00022 #include <vector>
00023
00024 #include <ros/ros.h>
00025 #include <tf/transform_listener.h>
00026 #include <tf/transform_datatypes.h>
00027
00028 #include <geometry_msgs/PoseArray.h>
00029 #include <visualization_msgs/MarkerArray.h>
00030 #include <cob_cartesian_controller/cartesian_controller_data_types.h>
00031
00032 class CartesianControllerUtils
00033 {
00034 public:
00035 CartesianControllerUtils()
00036 {
00037 marker_pub_ = nh_.advertise<visualization_msgs::MarkerArray>("cartesian_controller/preview_path", 1);
00038 }
00039
00040 void transformPose(const std::string source_frame, const std::string target_frame, const geometry_msgs::Pose pose_in, geometry_msgs::Pose& pose_out);
00041 tf::StampedTransform getStampedTransform(const std::string& target_frame, const std::string& source_frame);
00042 geometry_msgs::Pose getPose(const std::string& target_frame, const std::string& source_frame);
00043
00044 bool inEpsilonArea(const tf::StampedTransform& stamped_transform, const double epsilon);
00045 void poseToRPY(const geometry_msgs::Pose& pose, double& roll, double& pitch, double& yaw);
00046
00047 void previewPath(const geometry_msgs::PoseArray pose_array);
00048
00049 void adjustArrayLength(std::vector<cob_cartesian_controller::PathArray>& m);
00050 void copyMatrix(std::vector<double>* path_array, std::vector<cob_cartesian_controller::PathArray>& m);
00051 double roundUpToMultiplier(const double numberToRound, const double multiplier);
00052
00053 private:
00054 ros::NodeHandle nh_;
00055 tf::TransformListener tf_listener_;
00056 visualization_msgs::MarkerArray marker_array_;
00057
00058 ros::Publisher marker_pub_;
00059 };
00060
00061 #endif // COB_CARTESIAN_CONTROLLER_CARTESIAN_CONTROLLER_UTILS_H