open_house_demo.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:maki_demo 作者: jgreczek 项目源码 文件源码
def __init__(self,target_topic):
    #styleMap = ['none','astronaut','clown','wizard','dinosaur','animal','doctor','surgeon','teacher']
        self.current_msg = None
    self.last_msg = None
    self.buff_msg = None
    self.key = False
    self.task = []
        self.dm = RobotManager()
    self.lastColor = 1
    self.currentColor = 1
    self.positive_flag = False

        self.styleDict = {}
    self.styleSet = {}
        self.styleMap = ['none','astronaut','clown','wizard','dinosaur','animal','doctor','surgeon','teacher']#newly added 'animal','doctor','surgeon','teacher'
        self.colorTask = 1
    #temporary solution # 0 hat, 1 eyes, 2 glasses, 3 clothing, 4 shoes, 5 acc
    self.styleSet['none'] = ['no hat', 'no face accessory','no costume','regular shoes','no accessory']
        self.styleSet['astronaut'] = ["astrounaut helmet","astronaut face accessory","astronaut costume","astronaut shoes","a flag"]
        self.styleSet['clown'] = ["clown hat","clown face","clown costume","clown shoes","a horn"]
        self.styleSet['wizard'] = ["wizard hat","wizard eye","wizard costume","wizard shoes","a wand"]
    self.styleSet['dinosaur'] = ['dinosaur hat', 'dino sunglasses','dinosaur costume','dinosaur shoes','a mini dinosaur']
    self.styleSet['animal'] = ['animal hat','animal face','animal costume','animal shoes','a piece of meat']
    self.styleSet['doctor'] = ['doctor hat','doctor face accessory','doctor costume','doctor shoes','a document']
    self.styleSet['surgeon'] = ['surgeon hat','surgeon face accessory','surgeon costume','surgeon shoes','a surgeon document']
    self.styleSet['teacher'] = ['teacher hat','teacher sunglasses','teacher costume','teacher shoes','an apple']

    self.game_listener = rospy.Subscriber(target_topic, String, callback = self.callback)
    #self.speech_state_listener = rospy.Subscriber("speech_state", String, callback = self.callback2)
    self.mouth_pub = rospy.Publisher('mouth_color', Int8, queue_size=10)


    self.breath_count = 0
    #formal solution
    #styleSet['none'] = ['none','none','none','none','none']
    ###########################################################
#style dictionary
#formal solution
        for elem in self.styleMap:
            for clothes in self.styleSet[elem]:     
             self.styleDict[clothes] = elem 

        self.styleDict['no face accessory'] = 'none'


#    Xray Game
#    mapX = ["MAKI's eye","MAKI's ear","MAKI's nose"]
#    for part in mapX:
#   if part not in dialog:
#       dialog[part] = "This part is " + part

    #print dialog.keys()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号