diff --git a/doc/jsk_perception/nodes/rect_array_in_panorama_to_bounding_box_array.md b/doc/jsk_perception/nodes/rect_array_in_panorama_to_bounding_box_array.md index e32930dfac..adfa13e358 100644 --- a/doc/jsk_perception/nodes/rect_array_in_panorama_to_bounding_box_array.md +++ b/doc/jsk_perception/nodes/rect_array_in_panorama_to_bounding_box_array.md @@ -7,10 +7,6 @@ Sample is `sample_rect_array_in_panorama_to_bounding_box_array.launch` ## Subscribing Topics -* `~panorama_image` (`sensor_msgs/Image`) - -Panorama image topic. - * `~panorama_info` (`jsk_recognition_msgs/PanoramaInfo`) Panorama info topic. diff --git a/jsk_perception/node_scripts/rect_array_in_panorama_to_bounding_box_array.py b/jsk_perception/node_scripts/rect_array_in_panorama_to_bounding_box_array.py index 3147d7cfe6..1bf0d8007a 100755 --- a/jsk_perception/node_scripts/rect_array_in_panorama_to_bounding_box_array.py +++ b/jsk_perception/node_scripts/rect_array_in_panorama_to_bounding_box_array.py @@ -50,22 +50,22 @@ def __init__(self): self._dimensions_labels = rospy.get_param( '~dimensions_labels', {} ) self._duration_timeout = rospy.get_param( '~duration_timeout', 0.05 ) - try: - msg_panorama_image = rospy.wait_for_message( - '~panorama_image', Image, 10) - msg_panorama_info = rospy.wait_for_message( - '~panorama_info', PanoramaInfo, 10) - except (rospy.ROSException, rospy.ROSInterruptException) as e: - rospy.logerr('{}'.format(e)) - sys.exit(1) + msg_panorama_info = None + while (not rospy.is_shutdown() and msg_panorama_info is None): + try: + msg_panorama_info = rospy.wait_for_message( + '~panorama_info', PanoramaInfo, 10) + except (rospy.ROSException, rospy.ROSInterruptException) as e: + rospy.logerr('~panorama_info is not subscribed...') + rospy.logerr('waiting ~panorama_info for more 10 seconds') self._frame_panorama = msg_panorama_info.header.frame_id self._theta_min = msg_panorama_info.theta_min self._theta_max = msg_panorama_info.theta_max self._phi_min = msg_panorama_info.phi_min self._phi_max = msg_panorama_info.phi_max - self._image_height = msg_panorama_image.height - self._image_width = msg_panorama_image.width + self._image_height = msg_panorama_info.image_height + self._image_width = msg_panorama_info.image_width self._tf_buffer = tf2_ros.Buffer() self._tf_listener = tf2_ros.TransformListener(self._tf_buffer) diff --git a/jsk_perception/sample/sample_rect_array_in_panorama_to_bounding_box_array.launch b/jsk_perception/sample/sample_rect_array_in_panorama_to_bounding_box_array.launch index e3982cec2b..9d0a9a5a0e 100644 --- a/jsk_perception/sample/sample_rect_array_in_panorama_to_bounding_box_array.launch +++ b/jsk_perception/sample/sample_rect_array_in_panorama_to_bounding_box_array.launch @@ -47,7 +47,6 @@ type="rect_array_in_panorama_to_bounding_box_array.py" name="rect_array_in_panorama_to_bounding_box_array" > - diff --git a/jsk_perception/src/dual_fisheye_to_panorama.cpp b/jsk_perception/src/dual_fisheye_to_panorama.cpp index d749cec51b..a10726d6ee 100644 --- a/jsk_perception/src/dual_fisheye_to_panorama.cpp +++ b/jsk_perception/src/dual_fisheye_to_panorama.cpp @@ -92,6 +92,8 @@ namespace jsk_perception msg_panorama_info_.theta_max = M_PI; msg_panorama_info_.phi_min = -M_PI; msg_panorama_info_.phi_max = M_PI; + msg_panorama_info_.image_height = output_image_height_; + msg_panorama_info_.image_width = output_image_width_; onInitPostProcess(); } diff --git a/jsk_recognition_msgs/msg/PanoramaInfo.msg b/jsk_recognition_msgs/msg/PanoramaInfo.msg index 6dd1be12b1..602d7791bd 100644 --- a/jsk_recognition_msgs/msg/PanoramaInfo.msg +++ b/jsk_recognition_msgs/msg/PanoramaInfo.msg @@ -11,7 +11,13 @@ std_msgs/Header header string projection_model ####################################################################### -# Field of View Parameters # +# Image shape info # +####################################################################### +uint32 image_height +uint32 image_width + +####################################################################### +# Field of View Parameters # ####################################################################### float64 theta_min float64 theta_max