yolo11的ros功能封装,主要有以下功能:
1、服务的方式调用识别功能,并返回识别结果(bbox、mask、keypoint等)以及识别结果图像
2、给定深度图像(和彩色图像配准后的),将返回识别出的物体的几何中心(2d平面几何中心或3d空间几何中心)对应的空间坐标
3、给定目标坐标系,将物体的几何中心点坐标自动转换到该坐标系下
根据网站安装:https://docs.ultralytics.com/zh/quickstart/#install-ultralytics
pip install open3d
sudo apt install ros-noetic-tf2-geometry-msgs ros-noetic-cv-bridge
fnii_vision_detect/MultiStreamObjects:
fnii_vision_detect/Objects[] results # 所有输入源的识别结果,目前最多只有一个,无需考虑多输入源的情况
fnii_vision_detect/Object[] objects # 识别到的每个label的结果集合
int64[] mask # 分割结果的掩膜,只有0、1,1表示该位置像素是该物体的一部分,需结合mask_height和mask_width转换为一般的图像格式( mask_height*mask_width 的多维数组)
uint32 mask_height # 掩膜图像的高
uint32 mask_width # 掩膜图像的宽
int64[] keypoints # 关键点,每两位表示一个关键点坐标(像素坐标)
int64[] bboxs # 识别框,[ux1, uy1, ux2, uy2]
string object_name # label名
float32 confidence # 置信度
geometry_msgs/Point[] centor_point # 对应几何中心点的空间坐标,目前数组长度最大为1
float64 x
float64 y
float64 z
fnii_vision_detect/Detect:
string rgb_topic # 彩色图像话题名
string target_class # 指定目标label,可不填,不填则返回所有识别到的label信息
string depth_topic # 深度图像话题名(与彩色图像配准后的),可不填,不填则物体计算空间坐标点
string depth_cam_info # 深度图像内参话题名(depth_topic填了,则此项必须填写)用于计算深度图像对应像素的空间坐标
string frame_id # 填写了depth_topic才有效,转换目标的几何中心点到该坐标系下,
可不填,不填则返回基于深度图像坐标系的几何中心点
uint8 cal_centor_method # 几何中心点计算方式:0 识别框(bbox)的中心点,1 3维空间几何中心点, 2 关键点的中点
---
fnii_vision_detect/MultiStreamObjects results #检测的结果
string err_msg # 如果检测失败,则有错误信息
bool success # 检测的结果,true成功, false失败
~detect_results_img(sensor_msgs/Image): 含识别结果的图片
~detect_results(fnii_vision_detect/MultiStreamObjects): 话题形式的识别结果
~detect(fnii_vision_detect/Detect):调用该服务进行识别
~weight:权重文件名