import sys from multiprocessing import Lock import rospy import message_filters as mf from tools.enum import enum from hand_eye_calibration.msg import Command as CommandMsg from hand_eye_calibration.msg import Reply as ReplyMsg COMMAND = enum(PING=CommandMsg.PING, ENABLE=CommandMsg.ENABLE, DISABLE=CommandMsg.DISABLE, START=CommandMsg.START, STOP=CommandMsg.STOP, RESET=CommandMsg.RESET, CUSTOM=CommandMsg.CUSTOM) REPLY = enum(PONG=ReplyMsg.PONG, ACK=ReplyMsg.ACK, SUCCESS=ReplyMsg.SUCCESS, ERROR=ReplyMsg.ERROR, CUSTOM=ReplyMsg.CUSTOM) ALL = [] def synchronized(func): def f(self, *args, **kwargs):
from tools.enum import enum # Identificadores de estado reservados # Ide = 0 (Estado Inicial) # Ide = 1 (Estado Final) # Ide = 2 (Estado Agente) # Ide = 3 (Neutro) # Ide = 4 (Excelente) # Ide = 5 (Bueno) # Ide = 6 (Malo) # Ide = 7 (Pared) TIPOESTADO = enum(INICIAL=0, FINAL=1, AGENTE=2, NEUTRO=3, EXCELENTE=4, BUENO=5, MALO=6, PARED=7) class TipoEstado(object): """Clase TipoEstado""" def __init__(self, ide, recompensa, nombre, letra="", color="#FFFFFF", icono=None): """ :param ide: Identificador del estado :param recompensa: Recompensa devuelta :param nombre: Texto indicando el tipo de estado :param letra: Letra a mostrar en el GridWorld :param color: Color a mostrar en el GridWorld :param icono: Icono a mostrar en el GridWorld
if(vObj.name == objectName): return vObj.description # if it doesn't find one return "There is no " + objectName + " in here..." def Pickup(self, itemName): for itm in self.item: if(itm.name == itemName): self.item.remove(itm) return itm # if it doesn't find one return None # Movement Direction Enum from tools.enum import enum Direc = enum('N', 'S', 'E', 'W') class Level: def __init__(self, idx): self.num = idx room = [] item = [] vObject = [] startRoom = None # character superclass class Character(BaseObject): health = 3 class NPC(Character):
# /usr/bin/env python from tools.plugin_loader import PluginLoader from solver.SolverInterface import SolverInterface from tools.enum import enum TYPE = enum(ALL=None, AXXB="AXXB", AXYB="AXYB") METHOD = enum(ALL=None, R="rotation", T="translation", RT="rototranslation") REPRESENTATION = enum(ALL=None, AXIS="axisangle", QUAT="quaternion", KRON="kronecker") class SolverPlugins(PluginLoader): @classmethod def __match(self, plugin, name=None, type=None, method=None, representation=None): clazz = self.split(plugin) if name is not None and not re.match(name, clazz[-1]): return False if type is not None and type != clazz[1]: return False if method is not None and method != clazz[2]: return False if representation is not None and representation != clazz[3]: return False return True