8. API Reference¶
SpiriDetect: detections, the shared language of what’s out there.
Anything that finds something publishes a detection; anything that wants to know what’s out there reads detections; neither needs to know about the other.
- class SpiriDetect.BearingDetection(synq_topic, synq_base_topic=None, synq_session=<factory>, synq_authoritive=False, synq_lazy_publish=False, synq_publish=True, synq_receive=True, synq_auto_start=True, synq_check_receive_types=True, synq_auto_rehydrate_on_missing_parent_timeout=5.0, synq_mtime=-1, synq_is_deleted=False, _synq_callbacks=<factory>, _synq_last_rehydrate_time=0.0, relative_to='unknown', mount=None, pose=None, _parent_subscriber=None, _parent_pose=None, _parent_live=False, _parent_generation=0, cot_type='b-m-p-s-p-i', label=None, confidence=None, time=None, stale_after=None, course=None, speed=None, azimuth=0.0, elevation=0.0, range=None, range_accuracy=None, bearing_accuracy=None, ray=None)[source]¶
Bases:
DetectionSomething seen along a bearing from a sensor.
relative_tolinks to the sensor’s frame (FRD: x where it points), and the bearing is in that frame:azimuthto the right of its x axis,elevationabove it. Set them withset_bearing(), which sets themount: oriented along the bearing, so the detection’s own x axis is the ray, andrangemetres out along it.rayis the sensor’s place facing down the bearing, its accuracy the sensor’s, andbearing_accuracyis the cone’s half-angle. It’s there with or without a range, so a map can draw the frustum either way.poseis the thing’s place, so only with a range: there the beam’s error,range_accuracyalong it andbearing_accuracyacross it, is added to the sensor’s own accuracy, split horizontal and vertical by the beam’s elevation above the horizon. Without a rangeposeis None.- Parameters:
synq_topic (str)
synq_base_topic (str | None)
synq_session (Session | None)
synq_authoritive (bool)
synq_lazy_publish (bool)
synq_publish (bool)
synq_receive (bool)
synq_auto_start (bool)
synq_check_receive_types (bool)
synq_auto_rehydrate_on_missing_parent_timeout (float)
synq_mtime (float)
synq_is_deleted (bool)
_synq_callbacks (dict)
_synq_last_rehydrate_time (float)
relative_to (RootFrame | Link | str)
mount (Pose | None)
pose (Pose | None)
_parent_subscriber (Subscriber | None)
_parent_pose (Pose | None)
_parent_live (bool)
_parent_generation (int)
cot_type (str | None)
label (str | None)
confidence (float | None)
time (float | None)
stale_after (float | None)
course (float | None)
speed (float | None)
azimuth (float)
elevation (float)
range (float | None)
range_accuracy (float | None)
bearing_accuracy (float | None)
ray (Pose | None)
- class SpiriDetect.BoxDetection(synq_topic, synq_base_topic=None, synq_session=<factory>, synq_authoritive=False, synq_lazy_publish=False, synq_publish=True, synq_receive=True, synq_auto_start=True, synq_check_receive_types=True, synq_auto_rehydrate_on_missing_parent_timeout=5.0, synq_mtime=-1, synq_is_deleted=False, _synq_callbacks=<factory>, _synq_last_rehydrate_time=0.0, relative_to='unknown', mount=None, pose=None, _parent_subscriber=None, _parent_pose=None, _parent_live=False, _parent_generation=0, cot_type=None, label=None, confidence=None, time=None, stale_after=None, course=None, speed=None, azimuth=0.0, elevation=0.0, range=None, range_accuracy=None, bearing_accuracy=None, ray=None, box=None, angular_width=None, angular_height=None)[source]¶
Bases:
BearingDetectionA box around something in a camera’s picture: a detector’s output.
relative_tolinks to the camera. Through its lens (SpiriCamera’sCamera.intrinsics) the box’s centre is a bearing and its size an angular footprint,angular_widthbyangular_height. There’s usually no range, so nopose: a map draws a narrow frustum down theray.labelis the detector’s class andconfidenceits score. One object per tracked thing: the tracker’s id is the detection’s id, so a detector without a tracker makes a new detection per box.- Parameters:
synq_topic (str)
synq_base_topic (str | None)
synq_session (Session | None)
synq_authoritive (bool)
synq_lazy_publish (bool)
synq_publish (bool)
synq_receive (bool)
synq_auto_start (bool)
synq_check_receive_types (bool)
synq_auto_rehydrate_on_missing_parent_timeout (float)
synq_mtime (float)
synq_is_deleted (bool)
_synq_callbacks (dict)
_synq_last_rehydrate_time (float)
relative_to (RootFrame | Link | str)
mount (Pose | None)
pose (Pose | None)
_parent_subscriber (Subscriber | None)
_parent_pose (Pose | None)
_parent_live (bool)
_parent_generation (int)
cot_type (str | None)
label (str | None)
confidence (float | None)
time (float | None)
stale_after (float | None)
course (float | None)
speed (float | None)
azimuth (float)
elevation (float)
range (float | None)
range_accuracy (float | None)
bearing_accuracy (float | None)
ray (Pose | None)
box (PixelBox | None)
angular_width (float | None)
angular_height (float | None)
- class SpiriDetect.Detection(synq_topic, synq_base_topic=None, synq_session=<factory>, synq_authoritive=False, synq_lazy_publish=False, synq_publish=True, synq_receive=True, synq_auto_start=True, synq_check_receive_types=True, synq_auto_rehydrate_on_missing_parent_timeout=5.0, synq_mtime=-1, synq_is_deleted=False, _synq_callbacks=<factory>, _synq_last_rehydrate_time=0.0, relative_to='unknown', mount=None, pose=None, _parent_subscriber=None, _parent_pose=None, _parent_live=False, _parent_generation=0, cot_type=None, label=None, confidence=None, time=None, stale_after=None, course=None, speed=None)[source]¶
Bases:
PositionSomething a producer found, and where, if it knows.
poseis where the thing is, or None while that’s unknown. It is never a stand-in such as the sensor’s own place: a subclass with a partial fix (a bearing, say) keeps it in a field of its own.cot_typeis Cursor on Target’s type (a-u-G,b-m-p-s-p-i…), the vocabulary TAK and the rest of the world already speak. It sits in the object, not the key, so a detection keeps its identity when what it is becomes clearer. Producers set only the “what” part; affiliation is someone else’s decision.confidenceis the producer’s own, 0 to 1, that the thing is there and is what it says: a detector’s score, say. None means not given, which is honest for most sources (CoT carries none). It is not the position’s accuracy, which ispose.accuracy.timeis when the current state was observed, in Unix seconds: the pose tree doesn’t timestamp poses.stale_afteris how many seconds pasttimea consumer should stop believing it if nothing updates it, as CoT’s stale time; None means it holds until closed.courseandspeedare over the ground, as CoT’s track, for a thing whose motion the producer knows. Its heading, if it has one, is the pose’s orientation.- Parameters:
synq_topic (str)
synq_base_topic (str | None)
synq_session (Session | None)
synq_authoritive (bool)
synq_lazy_publish (bool)
synq_publish (bool)
synq_receive (bool)
synq_auto_start (bool)
synq_check_receive_types (bool)
synq_auto_rehydrate_on_missing_parent_timeout (float)
synq_mtime (float)
synq_is_deleted (bool)
_synq_callbacks (dict)
_synq_last_rehydrate_time (float)
relative_to (RootFrame | Link | str)
mount (Pose | None)
pose (Pose | None)
_parent_subscriber (Subscriber | None)
_parent_pose (Pose | None)
_parent_live (bool)
_parent_generation (int)
cot_type (str | None)
label (str | None)
confidence (float | None)
time (float | None)
stale_after (float | None)
course (float | None)
speed (float | None)
- class SpiriDetect.PixelBox(left, top, width, height, image_width, image_height)[source]¶
Bases:
objectA box in an image, in pixels from its top-left corner.
- SpiriDetect.beam_accuracy(distance, elevation, along, pointing)[source]¶
The 90% bounds of a spot at distance along a beam, level and plumb.
along is the error along the beam (m) and pointing the error off it (deg), which puts the spot
distance * tan(pointing)off sideways. Each is split between horizontal and vertical by the beam’s elevation (deg above the horizon; level if unknown) and summed in quadrature, asAccuracysums independent errors. A sideways error is horizontal one way and partly vertical the other, so horizontal takes all of it. Unknown errors are left out; with neither known, so is the accuracy.