def send_robot_anim_transition_cmd(tran): msg = JiboAction() # add header msg.header = Header() msg.header.stamp = rospy.Time.now() msg.do_anim_transition = True msg.anim_transition = tran robot_commander.publish(msg) rospy.loginfo(msg)
def send_robot_anim_transition_cmd(self, tran): msg = JiboAction() # add header msg.header = Header() msg.header.stamp = rospy.Time.now() msg.do_anim_transition = True msg.anim_transition = tran self.robot_commander.publish(msg) rospy.loginfo(msg) # def main(): # new_rule = "TopRule = $* (love candy){%slotAction='world'%} | (love choco){%slotAction='mars'%} $*;" # mySender = RobotSender() # mySender.start_robot_publisher() # mySender.send_robot_motion_cmd('reset.keys') # # Animation transition mode testing # mySender.send_robot_anim_transition_cmd(JiboAction.ANIMTRANS_KEEP_LASTFRAME) # mySender.send_robot_motion_cmd("spider.keys") # mySender.send_robot_motion_cmd("snail.keys") # mySender.send_robot_motion_cmd("snail.keys") # mySender.send_robot_motion_cmd("snail.keys") # time.sleep(5) # mySender.send_robot_anim_transition_cmd(JiboAction.ANIMTRANS_RESET) # # Send TTS # time.sleep(5) # mySender.send_robot_tts_cmd('Tell me something') # # Start listening # mySender.send_robot_asr_cmd(JiboAsrCommand.START, False, True, new_rule) # time.sleep(10) # # Play audio # mySender.send_robot_audio_cmd(JiboAction.RING_IN_SOUND) # time.sleep(20) # # Stop listening # mySender.send_robot_asr_cmd(JiboAsrCommand.STOP) # # Motion and Audio command # mySender.send_robot_audio_motion_cmd("instruments/Blocks.mp3", "heart-beat.keys") # # LED color # mySender.send_robot_led_cmd(0,1,0) # rospy.spin() # if __name__ == '__main__': # main()