00001 /* 00002 * Copyright 2013 Southwest Research Institute 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 #ifndef MTCONNECT_TASK_H 00018 #define MTCONNECT_TASK_H 00019 00020 #include <string> 00021 #include <map> 00022 #include <vector> 00023 #include <boost/shared_ptr.hpp> 00024 00025 namespace mtconnect 00026 { 00027 00028 class MotionGroup 00029 { 00030 public: 00031 00032 MotionGroup() 00033 { 00034 this->clear(); 00035 } 00036 ; 00037 std::string name_; 00038 std::vector<std::string> joint_names_; 00039 void clear() 00040 { 00041 name_.clear(); 00042 joint_names_.clear(); 00043 } 00044 ; 00045 }; 00046 00047 class JointPoint 00048 { 00049 public: 00050 JointPoint() 00051 { 00052 this->clear(); 00053 } 00054 ; 00055 std::string name_; 00056 boost::shared_ptr<MotionGroup> group_; 00057 std::vector<double> values_; 00058 double percent_velocity_; 00059 void clear() 00060 { 00061 name_.clear(); 00062 group_.reset(); 00063 values_.clear(); 00064 percent_velocity_ = 100.0; 00065 } 00066 ; 00067 00068 }; 00069 00070 class JointMove 00071 { 00072 public: 00073 JointMove() 00074 { 00075 this->clear(); 00076 } 00077 ; 00078 std::string name_; 00079 boost::shared_ptr<JointPoint> point_; 00080 void clear() 00081 { 00082 name_.clear(); 00083 point_.reset(); 00084 } 00085 ; 00086 }; 00087 00088 class Path 00089 { 00090 public: 00091 Path() 00092 { 00093 this->clear(); 00094 } 00095 ; 00096 std::string name_; 00097 //Default motion group may be used in the future for move/points that don't define one 00098 //boost::shared_ptr<MotionGroup> default_group_; 00099 //Joint moves should probably be pointers? 00100 std::vector<JointMove> moves_; 00101 void clear() 00102 { 00103 name_.clear(); 00104 //default_group_.reset(); 00105 moves_.clear(); 00106 } 00107 }; 00108 00109 class Task 00110 { 00111 public: 00112 Task() 00113 { 00114 this->clear(); 00115 } 00116 std::map<std::string, boost::shared_ptr<JointPoint> >points_; 00117 std::map<std::string, boost::shared_ptr<MotionGroup> >motion_groups_; 00118 std::map<std::string, boost::shared_ptr<Path> >paths_; 00119 void clear() 00120 { 00121 motion_groups_.clear(); 00122 paths_.clear(); 00123 } 00124 }; 00125 00126 } 00127 00128 #endif //TASK_H