Skip to content

Commit c71ebaf

Browse files
authored
Merge pull request #2753 from knorth55/panorama-info-image-shape
2 parents a8a920f + ee9051a commit c71ebaf

File tree

5 files changed

+19
-16
lines changed

5 files changed

+19
-16
lines changed

doc/jsk_perception/nodes/rect_array_in_panorama_to_bounding_box_array.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ Sample is `sample_rect_array_in_panorama_to_bounding_box_array.launch`
77

88
## Subscribing Topics
99

10-
* `~panorama_image` (`sensor_msgs/Image`)
11-
12-
Panorama image topic.
13-
1410
* `~panorama_info` (`jsk_recognition_msgs/PanoramaInfo`)
1511

1612
Panorama info topic.

jsk_perception/node_scripts/rect_array_in_panorama_to_bounding_box_array.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,22 +50,22 @@ def __init__(self):
5050
self._dimensions_labels = rospy.get_param( '~dimensions_labels', {} )
5151
self._duration_timeout = rospy.get_param( '~duration_timeout', 0.05 )
5252

53-
try:
54-
msg_panorama_image = rospy.wait_for_message(
55-
'~panorama_image', Image, 10)
56-
msg_panorama_info = rospy.wait_for_message(
57-
'~panorama_info', PanoramaInfo, 10)
58-
except (rospy.ROSException, rospy.ROSInterruptException) as e:
59-
rospy.logerr('{}'.format(e))
60-
sys.exit(1)
53+
msg_panorama_info = None
54+
while (not rospy.is_shutdown() and msg_panorama_info is None):
55+
try:
56+
msg_panorama_info = rospy.wait_for_message(
57+
'~panorama_info', PanoramaInfo, 10)
58+
except (rospy.ROSException, rospy.ROSInterruptException) as e:
59+
rospy.logerr('~panorama_info is not subscribed...')
60+
rospy.logerr('waiting ~panorama_info for more 10 seconds')
6161

6262
self._frame_panorama = msg_panorama_info.header.frame_id
6363
self._theta_min = msg_panorama_info.theta_min
6464
self._theta_max = msg_panorama_info.theta_max
6565
self._phi_min = msg_panorama_info.phi_min
6666
self._phi_max = msg_panorama_info.phi_max
67-
self._image_height = msg_panorama_image.height
68-
self._image_width = msg_panorama_image.width
67+
self._image_height = msg_panorama_info.image_height
68+
self._image_width = msg_panorama_info.image_width
6969

7070
self._tf_buffer = tf2_ros.Buffer()
7171
self._tf_listener = tf2_ros.TransformListener(self._tf_buffer)

jsk_perception/sample/sample_rect_array_in_panorama_to_bounding_box_array.launch

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
type="rect_array_in_panorama_to_bounding_box_array.py"
4848
name="rect_array_in_panorama_to_bounding_box_array"
4949
>
50-
<remap from="~panorama_image" to="$(arg INPUT_PANORAMA_IMAGE)" />
5150
<remap from="~panorama_info" to="$(arg INPUT_PANORAMA_INFO)" />
5251
<remap from="~input_class" to="$(arg INPUT_CLASS)" />
5352
<remap from="~input_rects" to="$(arg INPUT_RECTS)" />

jsk_perception/src/dual_fisheye_to_panorama.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ namespace jsk_perception
9292
msg_panorama_info_.theta_max = M_PI;
9393
msg_panorama_info_.phi_min = -M_PI;
9494
msg_panorama_info_.phi_max = M_PI;
95+
msg_panorama_info_.image_height = output_image_height_;
96+
msg_panorama_info_.image_width = output_image_width_;
9597

9698
onInitPostProcess();
9799
}

jsk_recognition_msgs/msg/PanoramaInfo.msg

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,13 @@ std_msgs/Header header
1111
string projection_model
1212

1313
#######################################################################
14-
# Field of View Parameters #
14+
# Image shape info #
15+
#######################################################################
16+
uint32 image_height
17+
uint32 image_width
18+
19+
#######################################################################
20+
# Field of View Parameters #
1521
#######################################################################
1622
float64 theta_min
1723
float64 theta_max

0 commit comments

Comments
 (0)