跳到主要内容

DangerousArea

消息类型: map_manager/msg/DangerousArea

描述

危险/限速区域定义,多边形区域,限制机器人速度

字段定义

字段

字段名类型描述
idint32过渡点唯一标识符
boundarygeometry_msgs/Polygon多边形边界(顶点列表)
speed_limitfloat32速度限制(米/秒)

使用示例

在服务中使用

Bash
# 添加限速区(正方形,限速 0.3m/s)
ros2 service call ${MM}/add_dangerous_area map_manager/srv/AddDangerousArea \
"{floor_id: '1F',
area: {
id: 1,
boundary: {
points: [
{x: 5.0, y: 5.0, z: 0.0},
{x: 8.0, y: 5.0, z: 0.0},
{x: 8.0, y: 8.0, z: 0.0},
{x: 5.0, y: 8.0, z: 0.0}
]
},
speed_limit: 0.3
}
}"

Python 中构造

Python
from map_manager.msg import DangerousArea
from geometry_msgs.msg import Polygon, Point32

area = DangerousArea()
area.id = 1
area.boundary = Polygon()
area.boundary.points = [
Point32(x=5.0, y=5.0, z=0.0),
Point32(x=8.0, y=5.0, z=0.0),
Point32(x=8.0, y=8.0, z=0.0),
Point32(x=5.0, y=8.0, z=0.0)
]
area.speed_limit = 0.3 # m/s

相关接口