Detection & Vision Messages (C++)

Perception types in horus::msg::. Include via <horus/msg/detection.hpp> (or <horus/messages.hpp> for everything).

Detection Types

TypeKey FieldsUse Case
BoundingBox2Dx, y (top-left corner, pixels), width, height2D object detection
BoundingBox3Dcx/cy/cz (m), length/width/height (m), roll/pitch/yaw (radians, Euler — not a quaternion)3D object detection
Detectionbbox (BoundingBox2D), confidence, class_id, class_name[32], instance_idYOLO/SSD output
Detection3Dbbox (BoundingBox3D), confidence, class_id, class_name[32], velocity_x/y/z, instance_id3D detector output
SegmentationMaskwidth, height, num_classes, mask_typeSemantic segmentation

BoundingBox2D is axis-aligned and anchored at the top-left corner, not the center.

Vision Types — Not Available in C++

CameraInfo, RegionOfInterest and StereoInfo are not available from C++. The upstream Rust types are repr(Rust) with no guaranteed field layout, so their C ABI entry points and C++ mirrors were withdrawn — <horus/msg/vision.hpp> declares no types, and referencing them fails to compile with 'CameraInfo' is not a member of 'horus::msg'. Restoring them requires adding #[repr(C)] to the Rust types upstream; see horus_cpp/include/horus/msg/vision.hpp.

Detection Example

class Detector : public horus::Node {
public:
    Detector() : Node("detector") {
        det_pub_ = advertise<horus::msg::Detection>("detections");
    }

    void tick() override {
        // After running inference...
        horus::msg::Detection det{};
        det.bbox.x = 295.0f;        // top-left corner X (pixels)
        det.bbox.y = 200.0f;        // top-left corner Y (pixels)
        det.bbox.width = 50.0f;
        det.bbox.height = 80.0f;
        det.class_id = 1;           // "person"
        det.confidence = 0.95f;
        det.instance_id = 0;
        det_pub_->send(det);
    }

private:
    horus::Publisher<horus::msg::Detection>* det_pub_;
};

Tracking Types

TypeKey FieldsUse Case
Landmarkx, y, visibility, index2D keypoint (pose estimation)
Landmark3Dx, y, z, visibility, index3D landmark (packed)
LandmarkArraynum_landmarks, confidence, bbox_*Pose estimation output
TrackedObjectbbox, predicted_bbox, track_id (uint64), velocity_x/y, accel_x/y, age, hits, stateMOT tracker (image-space 2D)
TrackingHeadernum_tracks, frame_id (u32 frame number), timestamp_ns, total_tracks, active_tracksTracker metadata

Landmark::index and Landmark3D::index are the joint ID (0=nose, 1=left_eye, ...), not an array position.

See Also