Commits

iorodeo  committed 5941b40 Draft

Fixed issues with frame drop tester.

  • Participants
  • Parent commits cf4ffac

Comments (0)

Files changed (3)

File mct_computer_admin/src/mct_computer_admin/cluster_control_fab.py

         'homography_calibration': 'start the homography calibration application',
         'transform_2d_calibration': 'start the 2d transform calibration application',
         'tracking_2d': 'start the 2d tracking application',
-        'frame_drop_test':  '2d tracking application w/ frame dropped frame logger',
+        'frame_drop_test':  'run IR LED frame drop tester',
         'frames_dropped': 'print a report of the frames dropped by the system',
+        'frames_dropped_no_seq': 'print a report of the frames dropped (no seq lists',
         'help': 'Command line interface to MCT (Multi-Camera Tracker)',
         'list_all': 'list all available commands',
         }
     print()
     print('  Testing')
     print('  -------')
-    print('    frame_drop_test - 2D tracking application w/ dropped frame logger')
-    print('    frames_dropped  - prints a report listing the frames dropped by each camera')
+    print('    frame_drop_test        - runs the IR LED frame drop tester')
+    print('    frames_dropped         - prints a report of the frames dropped')
+    print('    frames_dropped_no_seq  - prints a report of the frames dropped (no seq lists)')
     print()
     print('  Help')
     print('  ----')
     """
     Starts the frame drop test application
     """
-    roslaunch('frame_drop_test.launch')
+    try:
+        c0 = int(sys.argv[2])
+        c1 = int(sys.argv[3])
+    except:
+        print('Error: unable to read camera numbers')
+        return
+
+    cmd = [
+            'roslaunch', 
+            'mct_frame_drop_test', 
+            'frame_drop_tester.launch', 
+            'camera0:={0}'.format(c0),  
+            'camera1:={0}'.format(c1),
+            ]
+    try:
+        subprocess.call(cmd)
+    except KeyboardInterrupt:
+        return
 
 def roslaunch(launch_file):
     """
     print('  ', 'total frames dropped: ', total)
     print()
 
+def frames_dropped_no_seq():
+    """
+    Prints a simple report of the frames dropped by the system. 
+    """
+    info_dict = frame_drop_corrector.info_all()
+    max_name_len = max([len(name) for name in info_dict])
+    print('  ', 'camera', ' '*(max_name_len - len('camera')), '#')
+    print('  ', '-'*25)
+    for name, seq_list in sorted(info_dict.items(),cmp=info_item_cmp):
+        pad = ' '*(max_name_len - len(name))
+        print('  ', name, pad, len(seq_list))
+    print()
+    total = sum([len(x) for x in info_dict.values()])
+    print('  ', 'total frames dropped: ', total)
+    print()
+
 def info_item_cmp(x,y):
     """
     Comparison function for items (k,v) in the dictionary returned

File mct_frame_drop_test/nodes/frame_drop_tester.py

             except OSError, e:
                 rospy.logwarn('Error removing frame skipper launch file: {0}'.format(str(e)))
         if self.terminal_popen is not None:
-            self.terminal_popen.send_signal(subprocess.signal.SIGINT)
+            self.terminal_popen.send_signal(subprocess.signal.SIGKILL)
             try:
                 os.remove(self.terminal_file)
             except OSError, e:

File mct_launch/launch/frame_drop_test.launch

-<launch>
-    <include file="$(find mct_launch)/launch/tracking_2d.launch" />
-    <include file="$(find mct_watchdog)/launch/frame_drop_logger.launch" />
-</launch>