Files
hermes-bot/ros/hermes_vision/test/test_node.py
T
kyleandClaude Sonnet 5.5 79920ff6bc 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
2026-10-04 23:33:21 -07:00

16 lines
459 B
Python

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()