cartesian_controller_utils.h
Go to the documentation of this file.
00001 /*
00002  * Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *   http://www.apache.org/licenses/LICENSE-2.0
00009 
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
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


cob_cartesian_controller
Author(s): Christoph Mark
autogenerated on Thu Jun 6 2019 21:19:40