PutOnTrayActionUnit.java
Go to the documentation of this file.
00001 /****************************************************************
00002  *
00003  * Copyright (c) 2011, 2012
00004  *
00005  * School of Engineering, Cardiff University, UK
00006  *
00007  * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00008  *
00009  * Project name: srs EU FP7 (www.srs-project.eu)
00010  * ROS stack name: srs
00011  * ROS package name: srs_knowledge
00012  * Description: 
00013  *                                                              
00014  * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00015  *
00016  * @author Ze Ji, email: jiz1@cf.ac.uk
00017  *
00018  * Date of creation: Oct 2011:
00019  * ToDo: 
00020  *
00021  * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00022  *
00023  * Redistribution and use in source and binary forms, with or without
00024  * modification, are permitted provided that the following conditions are met:
00025  *
00026  *       * Redistributions of source code must retain the above copyright
00027  *         notice, this list of conditions and the following disclaimer.
00028  *       * Redistributions in binary form must reproduce the above copyright
00029  *         notice, this list of conditions and the following disclaimer in the
00030  *         documentation and/or other materials provided with the distribution.
00031  *       * Neither the name of the school of Engineering, Cardiff University nor 
00032  *         the names of its contributors may be used to endorse or promote products 
00033  *         derived from this software without specific prior written permission.
00034  *
00035  * This program is free software: you can redistribute it and/or modify
00036  * it under the terms of the GNU Lesser General Public License LGPL as 
00037  * published by the Free Software Foundation, either version 3 of the 
00038  * License, or (at your option) any later version.
00039  * 
00040  * This program is distributed in the hope that it will be useful,
00041  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00042  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00043  * GNU Lesser General Public License LGPL for more details.
00044  * 
00045  * You should have received a copy of the GNU Lesser General Public 
00046  * License LGPL along with this program. 
00047  * If not, see <http://www.gnu.org/licenses/>.
00048  *
00049  ****************************************************************/
00050 
00051 package org.srs.srs_knowledge.task;
00052 
00053 import java.io.*;
00054 import java.util.StringTokenizer;
00055 import java.util.ArrayList;
00056 
00057 import ros.pkg.srs_knowledge.msg.*;
00058 import ros.pkg.geometry_msgs.msg.Pose2D;
00059 import ros.pkg.geometry_msgs.msg.Pose;
00060 import org.srs.srs_knowledge.task.Task;
00061 import org.srs.srs_knowledge.knowledge_engine.*;
00062 
00068 public class PutOnTrayActionUnit extends HighLevelActionUnit {
00069     
00073     public PutOnTrayActionUnit(String moveConfig) {
00074         GenericAction ga = new GenericAction();
00075         //ga.actionInfo.add("put_on_tray");
00076         //ga.actionInfo.add(moveConfig);   // top, side
00077         ga.jsonActionInfo = SRSJSONParser.encodePutOnTrayAction("put_on_tray", moveConfig);
00078         actionUnits.add(ga);
00079         
00080         ifParametersSet = true;
00081         
00082         int size = actionUnits.size(); 
00083         nextActionMapIfFail = new int[size];
00084         nextActionMapIfSuccess = new int[size];
00085         
00086         for(int i = 0; i < size; i++) {
00087             nextActionMapIfFail[i] =  COMPLETED_FAIL;
00088             nextActionMapIfSuccess[i] = COMPLETED_SUCCESS;  
00089         }
00090     }
00091     
00092     public String getActionType() {
00093         actionType = "PutOnTray";
00094         return actionType;
00095     }
00096 
00097 
00101     public boolean setParameters(ArrayList<String> para) {
00102         return true;
00103     }
00104 
00105     public boolean ifParametersSet() {
00106         return true;
00107     }
00108 
00109 }


srs_knowledge
Author(s): Ze Ji
autogenerated on Mon Oct 6 2014 08:27:32