Detection & Vision Messages (C++)

Perception types in horus::msg::. Include via <horus/msg/detection.hpp> and <horus/msg/vision.hpp>.

Detection Types

TypeKey FieldsUse Case
BoundingBox2Dcenter_x/y, width, height, angle2D object detection
BoundingBox3Dcenter[3], size[3], rotation[4], confidence3D object detection
Detectionbbox (BoundingBox2D), class_id, confidenceYOLO/SSD output
Detection3Dbbox (BoundingBox3D), class_id, velocity[3]3D detector output
TrackedObjecttrack_id, position[3], velocity[3], ageMOT tracker
SegmentationMaskwidth, height, num_classes, mask_typeSemantic segmentation

Vision Types

TypeKey FieldsUse Case
CameraInfowidth, height, fx/fy/cx/cy, distortion[5]Camera calibration
RegionOfInterestx/y_offset, width, height, do_rectifyImage crop region
StereoInfoleft (CameraInfo), right (CameraInfo), baselineStereo pair

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.center_x = 320.0f;  // pixels
        det.bbox.center_y = 240.0f;
        det.bbox.width = 50.0f;
        det.bbox.height = 80.0f;
        det.bbox.angle = 0.0f;
        det.class_id = 1;           // "person"
        det.confidence = 0.95f;
        det.timestamp_ns = 0;
        det_pub_->send(det);
    }

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

CameraInfo — Intrinsic Calibration

horus::msg::CameraInfo cam{};
cam.width = 640;
cam.height = 480;
cam.fx = 525.0;   // focal length x (pixels)
cam.fy = 525.0;   // focal length y
cam.cx = 320.0;   // principal point x
cam.cy = 240.0;   // principal point y
cam.distortion[0] = -0.28;  // k1
cam.distortion[1] = 0.07;   // k2
cam.distortion[2] = 0.0;    // p1
cam.distortion[3] = 0.0;    // p2
cam.distortion[4] = 0.0;    // k3

Tracking Types

TypeKey FieldsUse Case
Landmarkid, x, y, covariance[4]2D landmark
Landmark3Dx, y, z, visibility, index3D landmark (packed)
LandmarkArraynum_landmarks, confidence, bbox_*Pose estimation output
TrackingHeaderframe_count, active_tracksTracker metadata

See Also