00001 /* 00002 * Copyright (C) 2011 The Board of Trustees of The Leland Stanford Junior University. All rights reserved. 00003 * 00004 * Author: Roland Philippsen 00005 * http://cs.stanford.edu/group/manips/ 00006 * 00007 * This program is free software: you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public License 00009 * as published by the Free Software Foundation, either version 3 of 00010 * the License, or (at your option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, but 00013 * WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Lesser General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public 00018 * License along with this program. If not, see 00019 * <http://www.gnu.org/licenses/> 00020 */ 00021 00022 #ifndef OPSPACE_SKILL_LIBRARY_HPP 00023 #define OPSPACE_SKILL_LIBRARY_HPP 00024 00025 #include <opspace/Skill.hpp> 00026 #include <opspace/task_library.hpp> 00027 00028 namespace opspace { 00029 00030 00031 class GenericSkill 00032 : public Skill 00033 { 00034 public: 00035 GenericSkill(std::string const & name); 00036 00037 virtual Status init(Model const & model); 00038 virtual Status update(Model const & model); 00039 virtual task_table_t const * getTaskTable(); 00040 00041 void appendTask(boost::shared_ptr<Task> task); 00042 00043 protected: 00044 task_table_t task_table_; 00045 boost::shared_ptr<TaskSlotAPI> slot_; 00046 }; 00047 00048 00049 class TaskPostureSkill 00050 : public Skill 00051 { 00052 public: 00053 TaskPostureSkill(std::string const & name); 00054 00055 virtual Status init(Model const & model); 00056 virtual Status update(Model const & model); 00057 virtual task_table_t const * getTaskTable(); 00058 virtual Status checkJStarSV(Task const * task, Vector const & sv); 00059 00060 protected: 00061 CartPosTask * eepos_; 00062 JPosTask * posture_; 00063 task_table_t task_table_; 00064 }; 00065 00066 00067 class TaskPostureTrjSkill 00068 : public Skill 00069 { 00070 public: 00071 TaskPostureTrjSkill(std::string const & name); 00072 00073 virtual Status init(Model const & model); 00074 virtual Status update(Model const & model); 00075 virtual task_table_t const * getTaskTable(); 00076 virtual Status checkJStarSV(Task const * task, Vector const & sv); 00077 00078 protected: 00079 CartPosTrjTask * eepos_; 00080 JPosTrjTask * posture_; 00081 task_table_t task_table_; 00082 }; 00083 00084 } 00085 00086 #endif // OPSPACE_SKILL_LIBRARY_HPP