Skip to content

Commit df7271f

Browse files
committed
Place descriptor ros node works
1 parent ae74262 commit df7271f

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

extra/ouroboros_ros/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ project(ouroboros_ros)
33

44
find_package(catkin REQUIRED COMPONENTS
55
rospy
6+
dynamic_reconfigure
7+
)
8+
9+
generate_dynamic_reconfigure_options(
10+
cfg/PlaceDescriptorDebugging.cfg
611
)
712

813
catkin_package(

extra/ouroboros_ros/nodes/place_matching_example.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env python3
12
import rospy
23

34
from dynamic_reconfigure.server import Server
@@ -7,7 +8,7 @@
78
import numpy as np
89

910
from ouroboros import VlcDb, SparkImage
10-
from ouroboros_salad import get_salad_model
11+
from ouroboros_salad.salad_model import get_salad_model
1112
from ouroboros_ros.cfg import PlaceDescriptorDebuggingConfig
1213

1314

@@ -62,17 +63,19 @@ def image_cb(self, msg):
6263
embedding = self.embedding_model(image)
6364

6465
image_matches, similarities = self.vlc_db.query_embeddings_max_time(
65-
embedding, 1, msg.header.stamp.to_nsec() - self.lc_lockout
66+
embedding, 1, msg.header.stamp.to_nsec() - self.lc_lockout * 1e9
6667
)
6768

6869
self.vlc_db.update_embedding(uid, embedding)
6970

70-
if similarities[0] < self.place_match_threshold:
71-
image_match = None
71+
if len(similarities) == 0 or similarities[0] < self.place_match_threshold:
72+
right = None
7273
else:
73-
image_match = image_matches[0]
74+
right = image_matches[0].image.rgb
7475

75-
display_image_pair(current_image, image_match)
76+
left = current_image.image.rgb
77+
78+
display_image_pair(left, right)
7679

7780

7881
if __name__ == "__main__":

0 commit comments

Comments
 (0)