forbidden_area
Message type: map_manager/msg/ForbiddenArea
Description
Forbidden-area definition. The robot must not enter this area.
GRW usage
GRW manages forbidden areas for the current map through /forbidden/add, /forbidden/list, /forbidden/update, and /forbidden/remove. An area has a numeric id and a boundary: the boundary must contain exactly four vertices forming an axis-aligned rectangle; other shapes fail. A successful add returns numeric area_id, and updates use id to identify the target. floor_id in the related services is an IDL compatibility field and is ignored. Forbidden-area services do not automatically create or remove virtual walls.
Field definition
Fields
| Field | Type | GRW behavior |
|---|---|---|
| id | int32 | Numeric area identifier; returned by listing and used by update. Assigned by GRW on add. |
| boundary | geometry_msgs/Polygon | Area boundary; points must be a four-vertex axis-aligned rectangle. |
Example
Use in a service
Bash
ros2 service call /forbidden/add map_manager/srv/AddForbiddenArea \
"{area: {boundary: {points: [{x: 0.0, y: 0.0}, {x: 2.0, y: 0.0}, {x: 2.0, y: 2.0}, {x: 0.0, y: 2.0}]}}}"
Construct in Python
Python
from geometry_msgs.msg import Point32, Polygon
from map_manager.msg import ForbiddenArea
area = ForbiddenArea()
area.id = 1
area.boundary = Polygon()
area.boundary.points = [
Point32(x=0.0, y=0.0, z=0.0),
Point32(x=2.0, y=0.0, z=0.0),
Point32(x=2.0, y=2.0, z=0.0),
Point32(x=0.0, y=2.0, z=0.0),
]
Related services
- AddForbiddenArea - Adds a forbidden area
- ListForbiddenAreas - Lists forbidden areas
- UpdateForbiddenArea - Updates a forbidden area
- RemoveForbiddenArea - Removes a forbidden area