Project: engagement_recognition License: BSD Dependencies:
Used by:
None |
engagement_recognition/src/recognition/actors/robot.hGo to the documentation of this file.00001 /* 00002 * Software License Agreement (BSD License) 00003 * 00004 * Copyright (c) 2010, Worcester Polytechnic Institute 00005 * All rights reserved. 00006 * 00007 * Redistribution and use in source and binary forms, with or without 00008 * modification, are permitted provided that the following conditions 00009 * are met: 00010 * 00011 * * Redistributions of source code must retain the above copyright 00012 * notice, this list of conditions and the following disclaimer. 00013 * * Redistributions in binary form must reproduce the above 00014 * copyright notice, this list of conditions and the following 00015 * disclaimer in the documentation and/or other materials provided 00016 * with the distribution. 00017 * * Neither the name of Worcester Polytechnic Institute. nor the names 00018 * of its contributors may be used to endorse or promote products 00019 * derived from this software without specific prior written permission. 00020 * 00021 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00022 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00023 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 00024 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 00025 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 00026 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 00027 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00028 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00029 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00030 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 00031 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00032 * POSSIBILITY OF SUCH DAMAGE. 00033 */ 00034 #ifndef _ROBOT_H 00035 #define _ROBOT_H 00036 00037 #include <vector> 00038 #include <string> 00039 #include "../logger/loggable.h" 00040 #include "../semaphores/semaphore.h" 00041 00043 #define NO_FACIAL_GAZE "NONE" 00044 00052 class Robot : public Loggable 00053 { 00054 private: 00056 ConsoleLogger *logger_; 00057 00059 Semaphore *semaphore_; 00060 00062 bool speaking_; 00063 00065 std::string facial_gaze_; 00066 00068 std::vector<std::string> looking_; 00069 00071 std::vector<std::string> pointing_; 00072 00074 bool waiting_; 00075 00077 static Robot *instance_; 00078 00082 Robot(); 00083 00089 static Robot* getRobot(); 00090 00094 void createSemaphores(); 00095 public: 00099 static void destroy(); 00100 00106 static bool isSpeaking(); 00107 00115 static bool isFacialGaze(std::string actor); 00116 00122 static std::vector<std::string> getLooking(); 00123 00129 static std::vector<std::string> getPointing(); 00130 00140 static bool isLooking(std::vector<std::string> objects); 00141 00151 static bool isPointing(std::vector<std::string> objects); 00152 00158 static void setSpeaking(bool start); 00159 00166 static void setFacialGaze(bool start, std::string actor); 00167 00174 static void setLookAt(bool start, std::vector<std::string> objects); 00175 00182 static void setPointAt(bool start, std::vector<std::string> objects); 00183 00187 static void donePoint(); 00188 00195 static bool isWaiting(); 00196 00203 static void setWaiting(bool state); 00204 }; 00205 00206 #endif // _ROBOT_H |