#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
import rospy
from jsk_2014_picking_challenge.msg import ObjectRecognition

left_result = None
right_result = None

def _cb_left(msg):
    global left_result
    left_result = dict(zip(msg.candidates, msg.probabilities))

def _cb_right(msg):
    global right_result
    right_result = dict(zip(msg.candidates, msg.probabilities))

rospy.init_node('test_object_recognition')
rospy.Subscriber('/left_process/bof_object_matcher/output', ObjectRecognition, _cb_left)
rospy.Subscriber('/right_process/bof_object_matcher/output', ObjectRecognition, _cb_right)

@@ -41,16 +41,27 @@
 8 -*-%0A#%0A
+import sys%0A
 import r
@@ -605,8 +605,390 @@
 _right)%0A
+%0Aleft_or_right = sys.argv%5B1%5D%0Aimport pprint%0Awhile not rospy.is_shutdown():%0A    result = left_result if left_or_right == 'left' else right_result%0A    if result is None:%0A        continue%0A    print('---------------------------------')%0A    pprint.pprint(sorted(right_result.items(),%0A                         key=lambda x:x%5B1%5D,%0A                         reverse=True))%0A%0A    rospy.sleep(1)%0A

update test function