Project: bml_lib License: BSD Dependencies: Used by: |
bml_lib/src/edu/wpi/hri/bml/behavior/BehaviorEnums.javaGo 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 package edu.wpi.hri.bml.behavior; 00035 00036 import ros.pkg.bml_msgs.msg.Flag; 00037 import ros.pkg.bml_srvs.srv.BMLFace; 00038 import ros.pkg.bml_srvs.srv.BMLGaze; 00039 import ros.pkg.bml_srvs.srv.BMLGesture; 00040 import ros.pkg.bml_srvs.srv.BMLHead; 00041 00048 public class BehaviorEnums { 00049 00055 public static enum BehaviorType { 00057 CONSTRAINT, 00059 EMIT, 00061 FACE, 00063 GAZE, 00065 GESTURE, 00067 HEAD, 00069 LIPS, 00071 LOCOMOTION, 00073 SPEECH, 00075 WAIT; 00076 00078 public final String elementName; 00079 00080 private BehaviorType() { 00081 this.elementName = this.toString().toLowerCase(); 00082 } 00083 } 00084 00091 public static enum Direction { 00093 RIGHT(ros.pkg.bml_msgs.msg.Direction.RIGHT), 00095 LEFT(ros.pkg.bml_msgs.msg.Direction.LEFT), 00097 UP(ros.pkg.bml_msgs.msg.Direction.UP), 00099 DOWN(ros.pkg.bml_msgs.msg.Direction.DOWN), 00101 UPRIGHT(ros.pkg.bml_msgs.msg.Direction.UP_RIGHT), 00103 UPLEFT(ros.pkg.bml_msgs.msg.Direction.UP_LEFT), 00105 DOWNLEFT(ros.pkg.bml_msgs.msg.Direction.DOWN_LEFT), 00107 DOWNRIGHT(ros.pkg.bml_msgs.msg.Direction.DOWN_RIGHT), 00109 POLAR(ros.pkg.bml_msgs.msg.Direction.POLAR); 00110 00112 public final short rosValue; 00113 00114 private Direction(short val) { 00115 this.rosValue = val; 00116 } 00117 } 00118 00125 public static enum Side { 00127 LEFT(Flag.LEFT), 00129 RIGHT(Flag.RIGHT), 00131 BOTH(Flag.EITHER); 00132 00134 public final byte rosValue; 00135 00136 private Side(byte val) { 00137 this.rosValue = val; 00138 } 00139 } 00140 00147 public static enum FaceMovementType { 00149 FACS(BMLFace.Request.FACS), 00151 EYEBROWS(BMLFace.Request.EYEBROWS), 00153 EYELIDS(BMLFace.Request.EYELIDS), 00155 MOUTH(BMLFace.Request.MOUTH); 00156 00158 public final short rosValue; 00159 00160 private FaceMovementType(short val) { 00161 this.rosValue = val; 00162 } 00163 } 00164 00170 public static enum EyebrowShape { 00172 FLAT(BMLFace.Request.FLAT), 00174 POINTDOWN(BMLFace.Request.POINT_DOWN), 00176 POINTUP(BMLFace.Request.POINT_UP); 00177 00179 public final short rosValue; 00180 00181 private EyebrowShape(short val) { 00182 this.rosValue = val; 00183 } 00184 } 00185 00191 public static enum Eyelid { 00193 BOTH(BMLFace.Request.BOTH), 00195 UPPER(BMLFace.Request.UPPER), 00197 LOWER(BMLFace.Request.LOWER); 00199 public final short rosValue; 00200 00201 private Eyelid(short val) { 00202 this.rosValue = val; 00203 } 00204 } 00205 00211 public static enum MouthShape { 00213 FLAT(BMLFace.Request.FLAT), 00215 SMILE(BMLFace.Request.SMILE), 00217 LAUGH(BMLFace.Request.LAUGH), 00219 PUCKER(BMLFace.Request.PUCKER), 00221 FROWN(BMLFace.Request.FROWN); 00223 public final short rosValue; 00224 00225 private MouthShape(short val) { 00226 this.rosValue = val; 00227 } 00228 } 00229 00236 public static enum Modality { 00238 EYES(BMLGaze.Request.EYES), 00240 HEAD(BMLGaze.Request.HEAD), 00242 NECK(BMLGaze.Request.NECK), 00244 TORSO(BMLGaze.Request.TORSO), 00246 LEGS(BMLGaze.Request.LEGS); 00248 public final short rosValue; 00249 00250 private Modality(short val) { 00251 this.rosValue = val; 00252 } 00253 } 00254 00261 public static enum GestureType { 00263 POINT(BMLGesture.Request.POINT), 00265 BEAT(BMLGesture.Request.BEAT), 00267 CONDUIT(BMLGesture.Request.CONDUIT), 00269 GENERIC(BMLGesture.Request.GENERIC), 00271 LEXICALIZED(BMLGesture.Request.LEXICALIZED); 00273 public final short rosValue; 00274 00275 private GestureType(short val) { 00276 this.rosValue = val; 00277 } 00278 } 00279 00287 public static enum HandShape { 00289 INDEXFINGER(BMLGesture.Request.INDEX_FINGER), 00291 THUMB(BMLGesture.Request.THUMB), 00293 OPENHAND(BMLGesture.Request.OPEN_HAND), 00295 FIST(BMLGesture.Request.FIST), 00297 FINGER_RING(BMLGesture.Request.FINGER_RING), 00299 CUP(BMLGesture.Request.CUP), 00301 PURSE(BMLGesture.Request.PURSE); 00303 public final short rosValue; 00304 00305 private HandShape(short val) { 00306 this.rosValue = val; 00307 } 00308 00316 public static HandShape fromString(String str) { 00317 if (str.equals("FINGER-RING")) 00318 return FINGER_RING; 00319 else 00320 return HandShape.valueOf(str); 00321 } 00322 00323 @Override 00324 public String toString() { 00325 if (this == FINGER_RING) 00326 return "FINGER-RING"; 00327 else 00328 return super.toString(); 00329 } 00330 } 00331 00338 public static enum Trajectory { 00340 STRAIGHT(BMLGesture.Request.STRAIGHT), 00342 CURVED(BMLGesture.Request.CURVED), 00344 CIRCULAR(BMLGesture.Request.CIRCULAR), 00346 RECTANGULAR(BMLGesture.Request.RECTANGULAR), 00348 TRIANGULAR(BMLGesture.Request.TRIANGULAR), 00350 WAVE_LIKE(BMLGesture.Request.WAVE_LIKE), 00352 ZIGZAG(BMLGesture.Request.ZIGZAG); 00354 public final short rosValue; 00355 00356 private Trajectory(short val) { 00357 this.rosValue = val; 00358 } 00359 00367 public static Trajectory fromString(String str) { 00368 if (str.equals("WAVE-RING")) 00369 return WAVE_LIKE; 00370 else 00371 return Trajectory.valueOf(str); 00372 } 00373 00374 @Override 00375 public String toString() { 00376 if (this == WAVE_LIKE) 00377 return "WAVE-LIKE"; 00378 else 00379 return super.toString(); 00380 } 00381 } 00382 00388 public static enum TwoHanded { 00390 MIRROR(BMLGesture.Request.MIRROR), 00392 ALTERNATE(BMLGesture.Request.ALTERNATE), 00394 PARALLEL(BMLGesture.Request.PARALLEL); 00396 public final short rosValue; 00397 00398 private TwoHanded(short val) { 00399 this.rosValue = val; 00400 } 00401 } 00402 00409 public static enum VerticalLocation { 00411 LOW(BMLGesture.Request.LOW), 00413 CENTER(BMLGesture.Request.CENTER), 00415 HIGH(BMLGesture.Request.HIGH); 00417 public final short rosValue; 00418 00419 private VerticalLocation(short val) { 00420 this.rosValue = val; 00421 } 00422 } 00423 00429 public static enum HorizontalLocation { 00431 LEFT(BMLGesture.Request.LEFT), 00433 CENTER(BMLGesture.Request.CENTER), 00435 RIGHT(BMLGesture.Request.RIGHT), 00437 INWARD(BMLGesture.Request.INWARD), 00439 OUTWARD(BMLGesture.Request.OUTWARD); 00441 public final short rosValue; 00442 00443 private HorizontalLocation(short val) { 00444 this.rosValue = val; 00445 } 00446 } 00447 00454 public static enum Distance { 00456 CONTACT(BMLGesture.Request.CONTACT), 00458 NEAR(BMLGesture.Request.NEAR), 00460 MEDIUM(BMLGesture.Request.MEDIUM), 00462 FAR(BMLGesture.Request.FAR); 00464 public final short rosValue; 00465 00466 private Distance(short val) { 00467 this.rosValue = val; 00468 } 00469 } 00470 00477 public static enum Amplitude { 00479 SMALL(BMLGesture.Request.SMALL), 00481 MEDIUM(BMLGesture.Request.MEDIUM), 00483 LARGE(BMLGesture.Request.LARGE), 00485 EXTRA_LARGE(BMLGesture.Request.EXTRA_LARGE); 00487 public final short rosValue; 00488 00489 private Amplitude(short val) { 00490 this.rosValue = val; 00491 } 00492 00500 public static Amplitude fromString(String str) { 00501 if (str.equals("EXTRA-LARGE")) 00502 return EXTRA_LARGE; 00503 else 00504 return Amplitude.valueOf(str); 00505 } 00506 00507 @Override 00508 public String toString() { 00509 if (this == EXTRA_LARGE) 00510 return "EXTRA-LARGE"; 00511 else 00512 return super.toString(); 00513 } 00514 } 00515 00522 public static enum Power { 00524 WEAK(BMLGesture.Request.WEAK), 00526 NORMAL(BMLGesture.Request.NORMAL), 00528 FORCEFUL(BMLGesture.Request.FORCEFUL); 00530 public final short rosValue; 00531 00532 private Power(short val) { 00533 this.rosValue = val; 00534 } 00535 } 00536 00542 public static enum HeadMovementType { 00544 NOD(BMLHead.Request.NOD), 00546 SHAKE(BMLHead.Request.SHAKE); 00548 public final short rosValue; 00549 00550 private HeadMovementType(short val) { 00551 this.rosValue = val; 00552 } 00553 } 00554 00561 public static enum LocomotionType { 00563 VECTOR, 00565 TARGET; 00567 public final String rosValue; 00568 00569 private LocomotionType() { 00570 this.rosValue = this.toString().toLowerCase(); 00571 } 00572 } 00573 00581 public static enum LocomotionManner { 00583 RUNNING, 00585 SWIMMING, 00587 FLYING, 00589 WALKING, 00591 CRAWLING, 00593 CREEPING; 00595 public final String rosValue; 00596 00597 private LocomotionManner() { 00598 this.rosValue = this.toString().toLowerCase(); 00599 } 00600 } 00601 } |