Skip to content

Commit f0cbb29

Browse files
authored
Update vision messages (#6)
* fix: Adapt vision_msgs to current master branch * fix: Replace deprecated setup tools names with dashes by underscored ones
1 parent d38dc4d commit f0cbb29

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

detection_visualizer/__init__.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,17 @@ def on_detections(self, image_msg, detections_msg):
5656
for detection in detections_msg.detections:
5757
max_class = None
5858
max_score = 0.0
59-
for hypothesis in detection.results:
59+
for result in detection.results:
60+
hypothesis = result.hypothesis
6061
if hypothesis.score > max_score:
6162
max_score = hypothesis.score
62-
max_class = hypothesis.id
63+
max_class = hypothesis.class_id
6364
if max_class is None:
6465
print("Failed to find class with highest score", file=sys.stderr)
6566
return
6667

67-
cx = detection.bbox.center.x
68-
cy = detection.bbox.center.y
68+
cx = detection.bbox.center.position.x
69+
cy = detection.bbox.center.position.y
6970
sx = detection.bbox.size_x
7071
sy = detection.bbox.size_y
7172

@@ -90,3 +91,4 @@ def main():
9091
rclpy.init()
9192
rclpy.spin(DetectionVisualizerNode())
9293
rclpy.shutdown()
94+

setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[develop]
2-
script-dir=$base/lib/detection_visualizer
2+
script_dir=$base/lib/detection_visualizer
33
[install]
4-
install-scripts=$base/lib/detection_visualizer
4+
install_scripts=$base/lib/detection_visualizer
55

0 commit comments

Comments
 (0)