소스 정보
- 저장소
- MIUAV/vibe-coding-ros2
- 최근 소스 활동
- 2026년 4월 3일 16:37
- 감지된 SKILL.md 언어
- 중국어
- 스타
- 26
- 포크
- 2
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/MIUAV/vibe-coding-ros2 --skill 3d-object-detection명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SKILL.md 표시 중
SOC 직업 분류 기준
| name | 3d-object-detection |
| description | 3D 目标检测技能 - PointPillars、PointRCNN、LaserNet++ ROS2 部署 |
| argument-hint | 3D检测 OR PointPillars OR pointcloud OR 3D detection OR 物体检测 |
| user-invocable | true |
基于点云和图像融合的 3D 目标检测
当需要以下帮助时使用此技能:
import rclpy
from rclpy.node import Node
from sensor_msgs.msg import PointCloud2
from vision_msgs.msg import Detection3DArray
import numpy as np
import torch
from torch import nn
class PointPillarsNode(Node):
def __init__(self):
super().__init__('pointpillars_node')
self.pointcloud_sub = self.create_subscription(
PointCloud2, '/lidar_points', self.callback, 10)
self.det_pub = self.create_publisher(Detection3DArray, '/detections_3d', 10)
# 模型初始化
self.init_model()
self.declare_parameter('nms_iou_threshold', 0.5)
self.declare_parameter('score_threshold', 0.5)
def init_model(self):
# 加载 PointPillars 模型
# self.model = PointPillarsNet(...)
# self.model.load_state_dict(torch.load('pointpillars.pth'))
# self.model.cuda().eval()
pass
def callback(self, msg):
# 解析点云
points = self.parse_pointcloud(msg)
# 预处理
pillars, coords = self.create_pillars(points)
# 推理
with torch.no_grad():
boxes = self.model(pillars, coords)
# 后处理 (NMS)
detections = self.nms(boxes)
# 发布
self.publish_detections(detections)
def parse_pointcloud(self, msg):
"""解析 PointCloud2 消息"""
points = []
for i in range(0, len(msg.data), msg.point_step):
x = msg.data[i:i+4]
points.append([x[0], x[1], x[2], x[3]])
return np.array(points, dtype=np.float32)
def create_pillars(self, points):
"""创建 Pillar"""
# 简化的 Pillar 创建
pillar_features = np.random.randn(100, 32, 100) # [num_pillars, D, N]
coords = np.zeros((100, 3), dtype=np.int32)
return pillar_features, coords
def nms(self, boxes):
"""非极大值抑制"""
# 实现 NMS
return boxes
def publish_detections(self, detections):
msg = Detection3DArray()
for det in detections:
detection = Detection3D()
detection.bbox.center.position.x = det['x']
detection.bbox.center.position.y = det['y']
detection.bbox.center.position.z = det['z']
detection.bbox.size.x = det['length']
detection.bbox.size.y = det['width']
detection.bbox.size.z = det['height']
detection.bbox.center.orientation = det['orientation']
msg.detections.append(detection)
self.det_pub.publish(msg)
class PillarEncoder(nn.Module):
"""Pillar Encoder"""
def __init__(self, in_channels=9, out_channels=64):
super().__init__()
self.conv = nn.Sequential(
nn.Conv2d(in_channels, 32, 1),
nn.BatchNorm2d(32),
nn.ReLU(),
nn.Conv2d(32, out_channels, 1),
nn.BatchNorm2d(out_channels),
nn.ReLU()
)
def forward(self, pillars, coords):
# pillars: [N, D, H, W]
# coords: [N, 3]
x = self.conv(pillars)
return x
class Backbone(nn.Module):
"""SSD Backbone"""
def __init__(self, in_channels=64):
super().__init__()
self.conv = nn.Sequential(
nn.Conv2d(in_channels, 128, 3, stride=2, padding=1),
nn.BatchNorm2d(128),
nn.ReLU(),
nn.Conv2d(128, 256, 3, stride=2, padding=1),
nn.BatchNorm2d(256),
nn.ReLU(),
nn.Conv2d(256, 256, 3, stride=, padding=),
nn.BatchNorm2d(),
nn.ReLU()
)
():
.conv(x)
(nn.Module):
():
().__init__()
.cls = nn.Conv2d(in_channels, num_classes, )
.box = nn.Conv2d(in_channels, * num_classes, )
():
cls = .cls(x)
box = .box(x)
cls, box