コード例 #1
0
ファイル: test_blender_api.py プロジェクト: yenat/HEAD
 def test_emotion_state(self):
     available_emotions = parse_msg(run_shell_cmd("rostopic echo -n1 /blender_api/available_emotion_states", True))
     available_emotions = available_emotions[:1]
     pub, msg_class = rostopic.create_publisher(
         "/blender_api/set_emotion_state", "blender_api_msgs/EmotionState", True
     )
     timeout = 2
     videos = []
     for emotion in available_emotions:
         video = "%s/emotion-%s.avi" % (self.output_dir, emotion)
         with capture_screen(video, timeout):
             pub.publish(msg_class(emotion, 1, Duration(1, 0)))
         add_text_to_video(video)
         videos.append(video)
     ofile = "%s/emotions.avi" % self.output_dir
     concatenate_videos(videos, ofile, True)
     pub.unregister()
コード例 #2
0
ファイル: test_blender_api.py プロジェクト: yenat/HEAD
 def test_viseme(self):
     available_visemes = parse_msg(run_shell_cmd("rostopic echo -n1 /blender_api/available_visemes", True))
     available_visemes = available_visemes[:1]
     pub, msg_class = rostopic.create_publisher("/blender_api/queue_viseme", "blender_api_msgs/Viseme", True)
     timeout = 2
     videos = []
     for viseme in available_visemes:
         if "old" in viseme:
             continue
         video = "%s/viseme-%s.avi" % (self.output_dir, viseme)
         with capture_screen(video, timeout):
             pub.publish(msg_class(viseme, Duration(0, 0), Duration(0, 5 * 1e8), 0.1, 0.8, 1))
         add_text_to_video(video)
         videos.append(video)
     ofile = "%s/viseme.avi" % self.output_dir
     concatenate_videos(videos, ofile, True)
     pub.unregister()
コード例 #3
0
ファイル: test_blender_api.py プロジェクト: yenat/HEAD
 def test_gesture(self):
     available_gestures = parse_msg(run_shell_cmd("rostopic echo -n1 /blender_api/available_gestures", True))
     available_gestures = available_gestures[:2]
     pub, msg_class = rostopic.create_publisher("/blender_api/set_gesture", "blender_api_msgs/SetGesture", True)
     timeout = 2
     videos = []
     for gesture in available_gestures:
         if gesture == "all":
             continue
         video = "%s/gesture-%s.avi" % (self.output_dir, gesture)
         with capture_screen(video, timeout):
             pub.publish(msg_class(gesture, 1, 1, 1))
         add_text_to_video(video)
         videos.append(video)
     ofile = "%s/gestures.avi" % self.output_dir
     concatenate_videos(videos, ofile, True)
     pub.unregister()
コード例 #4
0
 def test_gesture(self):
     available_gestures = parse_msg(
         run_shell_cmd('rostopic echo -n1 /blender_api/available_gestures',
                       True))
     pub, msg_class = rostopic.create_publisher(
         '/blender_api/set_gesture', 'blender_api_msgs/SetGesture', True)
     timeout = 2
     videos = []
     for gesture in available_gestures:
         if gesture == 'all': continue
         video = '%s/gesture-%s.avi' % (self.output_dir, gesture)
         with capture_screen(video, timeout):
             pub.publish(msg_class(gesture, 1, 1, 1))
         add_text_to_video(video)
         videos.append(video)
     ofile = '%s/gestures.avi' % self.output_dir
     concatenate_videos(videos, ofile, True)
     pub.unregister()
コード例 #5
0
 def test_emotion_state(self):
     available_emotions = parse_msg(
         run_shell_cmd(
             'rostopic echo -n1 /blender_api/available_emotion_states',
             True))
     pub, msg_class = rostopic.create_publisher(
         '/blender_api/set_emotion_state', 'blender_api_msgs/EmotionState',
         True)
     timeout = 2
     videos = []
     for emotion in available_emotions:
         video = '%s/emotion-%s.avi' % (self.output_dir, emotion)
         with capture_screen(video, timeout):
             pub.publish(msg_class(emotion, 1, Duration(1, 0)))
         add_text_to_video(video)
         videos.append(video)
     ofile = '%s/emotions.avi' % self.output_dir
     concatenate_videos(videos, ofile, True)
     pub.unregister()
コード例 #6
0
 def test_viseme(self):
     available_visemes = parse_msg(
         run_shell_cmd('rostopic echo -n1 /blender_api/available_visemes',
                       True))
     pub, msg_class = rostopic.create_publisher('/blender_api/queue_viseme',
                                                'blender_api_msgs/Viseme',
                                                True)
     timeout = 2
     videos = []
     for viseme in available_visemes:
         if 'old' in viseme: continue
         video = '%s/viseme-%s.avi' % (self.output_dir, viseme)
         with capture_screen(video, timeout):
             pub.publish(
                 msg_class(viseme, Duration(0, 0), Duration(0, 5 * 1e8),
                           0.1, 0.8, 1))
         add_text_to_video(video)
         videos.append(video)
     ofile = '%s/viseme.avi' % self.output_dir
     concatenate_videos(videos, ofile, True)
     pub.unregister()