BoundingBox2D
center is the box centre in pixels with rotation center.theta; sizes are in pixels.
Preview
The figure robot_msgs.viz.plot(example) draws for the example below.

Fields
| Name | Type | Default |
|---|---|---|
center | Pose2D | required |
size_x | float | required |
size_y | float | required |
Example
One instance from the package's own test catalog; the output is its real repr().
BoundingBox2D(center=Pose2D(x=60.0, y=120.0, theta=0.0), size_x=100.0, size_y=200.0)to_dict() as JSON
{
"_type": "vision/BoundingBox2D",
"center": {
"_type": "geometry/Pose2D",
"x": 60.0,
"y": 120.0,
"theta": 0.0
},
"size_x": 100.0,
"size_y": 200.0
}Long arrays are cut after 16 values and say so with “…”.
Functions
Constructors
Classmethods and staticmethods: ways to build one.
from_xyxy(x0: float, y0: float, x1: float, y1: float) -> BoundingBox2DAxis-aligned box from its top-left (x0, y0) and bottom-right (x1, y1) corners.
Methods
Return new values; messages are never mutated.
contains(x: float, y: float) -> boolWhether pixel (x, y) is inside the box (edges included), honouring center.theta.
iou(other: BoundingBox2D) -> floatIntersection over union of two axis-aligned boxes (0.0 when both are empty).
to_dict
from Msgto_dict() -> dict[str, Any]JSON-safe dict with a "_type" key; arrays keep their dtype and shape.