Skip to content

Commit 07bba12

Browse files
committed
segmentation node improvements
Signed-off-by: pepisg <pedro.gonzalez@eia.edu.co>
1 parent e7e134f commit 07bba12

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

nav2_semantic_segmentation_demo/semantic_segmentation_node/semantic_segmentation_node/segmentation_node.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import rclpy
55
from rclpy.node import Node
6+
from rclpy.qos import QoSProfile, DurabilityPolicy
67
from sensor_msgs.msg import Image
78
from vision_msgs.msg import LabelInfo, VisionClass
89
from cv_bridge import CvBridge
@@ -25,13 +26,6 @@ def __init__(self):
2526
model_path = package_share / 'models' / 'model.onnx'
2627
config_path = package_share / 'config' / 'ontology.yaml'
2728

28-
# If model doesn't exist (symlink install), try source directory
29-
if not model_path.exists():
30-
import os
31-
src_path = Path(__file__).parent.parent.parent / 'models' / 'model.onnx'
32-
if src_path.exists():
33-
model_path = src_path
34-
3529
# Load config
3630
with open(config_path, 'r') as f:
3731
config = yaml.safe_load(f)
@@ -111,7 +105,6 @@ def __init__(self):
111105
)
112106

113107
# Create LabelInfo publisher with transient local QoS
114-
from rclpy.qos import QoSProfile, DurabilityPolicy
115108
label_info_qos = QoSProfile(
116109
depth=1,
117110
durability=DurabilityPolicy.TRANSIENT_LOCAL

0 commit comments

Comments
 (0)