Fix duplicate parameter declaration in the face detector node
recognition_model was declared twice (once for the existence check, once for the recognizer), so the node raised ParameterAlreadyDeclared at start-up and never published. Declare each parameter once, and add a test that constructs the node, since nothing else exercised it. Recognition then works live: with the owner enrolled, 29 of 31 detections over 14 s were named, at detector scores around 0.9. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AFN8nRRCiDiMN7ChBpHJhs
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import pytest
|
||||
|
||||
rclpy = pytest.importorskip('rclpy')
|
||||
|
||||
|
||||
def test_the_node_constructs_with_default_parameters():
|
||||
"""Declaring a parameter twice raises at construction, and nothing else exercises the node."""
|
||||
from hermes_vision.face_detector_node import FaceDetectorNode
|
||||
rclpy.init()
|
||||
try:
|
||||
node = FaceDetectorNode()
|
||||
assert node.detector.backend in ('yunet', 'haar')
|
||||
node.destroy_node()
|
||||
finally:
|
||||
rclpy.shutdown()
|
||||
Reference in New Issue
Block a user