Detection & Vision Messages (C++)
Perception types in horus::msg::. Include via <horus/msg/detection.hpp> (or <horus/messages.hpp> for everything).
Detection Types
| Type | Key Fields | Use Case |
|---|---|---|
BoundingBox2D | x, y (top-left corner, pixels), width, height | 2D object detection |
BoundingBox3D | cx/cy/cz (m), length/width/height (m), roll/pitch/yaw (radians, Euler — not a quaternion) | 3D object detection |
Detection | bbox (BoundingBox2D), confidence, class_id, class_name[32], instance_id | YOLO/SSD output |
Detection3D | bbox (BoundingBox3D), confidence, class_id, class_name[32], velocity_x/y/z, instance_id | 3D detector output |
SegmentationMask | width, height, num_classes, mask_type | Semantic 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
| Type | Key Fields | Use Case |
|---|---|---|
Landmark | x, y, visibility, index | 2D keypoint (pose estimation) |
Landmark3D | x, y, z, visibility, index | 3D landmark (packed) |
LandmarkArray | num_landmarks, confidence, bbox_* | Pose estimation output |
TrackedObject | bbox, predicted_bbox, track_id (uint64), velocity_x/y, accel_x/y, age, hits, state | MOT tracker (image-space 2D) |
TrackingHeader | num_tracks, frame_id (u32 frame number), timestamp_ns, total_tracks, active_tracks | Tracker metadata |
Landmark::index and Landmark3D::index are the joint ID (0=nose, 1=left_eye, ...), not an array position.
See Also
- Tracking & Perception Messages — full field lists for TrackedObject, LandmarkArray, SegmentationMask
- Sensor Messages — LaserScan, Imu for perception input
- TensorPool API — Image and PointCloud for raw perception data