00001
00029 #ifndef COB_ARTICULATION_H
00030 #define COB_ARTICULATION_H
00031
00032 #include <ros/ros.h>
00033 #include <tf/transform_broadcaster.h>
00034 #include <tf/transform_listener.h>
00035 #include <tinyxml.h>
00036 #include <std_msgs/Float64.h>
00037 #include <visualization_msgs/Marker.h>
00038 #include <vector>
00039
00040
00041 class CobArticulation
00042 {
00043 public:
00044 bool initialize();
00045 void load();
00046
00047
00048 void pose_path_broadcaster(std::vector <geometry_msgs::Pose> *);
00049 void linear_interpolation(std::vector <geometry_msgs::Pose> *poseVector,geometry_msgs::Pose, geometry_msgs::Pose,double,double,std::string,bool);
00050 void circular_interpolation(std::vector<geometry_msgs::Pose>*,double,double,double,double,double,double,double,double,double,double,double,std::string);
00051 void move_ptp(geometry_msgs::Pose targetPose, double epsilon);
00052 void hold_position(geometry_msgs::Pose);
00053
00054
00055 bool epsilon_area(double,double,double,double,double,double,double);
00056 geometry_msgs::Pose getEndeffectorPose();
00057 void showMarker(tf::StampedTransform,int,double,double,double,std::string);
00058 void showDot(double,double,double,int,double,double,double,std::string);
00059 void showLevel(tf::Transform,int,double,double,double,std::string);
00060 void timerCallback(const ros::TimerEvent&);
00061 void calculateProfile(std::vector<double>*,double,double,double,std::string);
00062 void calculateProfileForAngularMovements(std::vector<double> *pathMatrix,double,double,double,double,double,double,double,double,double,std::string,bool);
00063 void generatePath(std::vector<double>*,double,double,double,double,int,std::string);
00064 void generatePathWithTe(std::vector<double> *pathArray,double T_IPO, double te, double AcclMax,double Se_max, int steps_max,double start_angle,std::string profile);
00065 void start_tracking();
00066 void stop_tracking();
00067 void PoseToRPY(geometry_msgs::Pose pose,double &roll, double &pitch, double &yaw);
00068
00069
00070 private:
00071 ros::NodeHandle nh_;
00072
00073
00074 ros::Publisher vis_pub_;
00075 ros::Publisher path_pub_;
00076 ros::Publisher speed_pub_;
00077 ros::Publisher accl_pub_;
00078 ros::Publisher jerk_pub_;
00079 ros::ServiceClient startTracking_;
00080 ros::ServiceClient stopTracking_;
00081
00082
00083 tf::TransformBroadcaster br_;
00084 tf::Transform transform_;
00085 tf::Quaternion q_;
00086 tf::TransformListener listener_;
00087 tf::StampedTransform currentEndeffectorStampedTransform_;
00088
00089
00090 bool reached_pos_,hold_;
00091
00092
00093
00094 double update_rate_;
00095 std::string stringPath_,fileName_,referenceFrame_,targetFrame_,endeffectorFrame_;
00096 const char* charPath_;
00097
00098
00099 int marker1_,marker2_;
00100 };
00101
00102 #endif
00103