用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/MIUAV/vibe-coding-ros2 --skill 3d-pointcloud-map命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | 3d-pointcloud-map |
| description | 3D 点云地图技能 - OctoMap、TSDF、语义点云、稠密重建 |
| argument-hint | 3D地图 OR OctoMap OR TSDF OR 点云地图 OR semantic map |
| user-invocable | true |
3D 环境地图构建
当需要以下帮助时使用此技能:
import numpy as np
class OctoMap:
def __init__(self, resolution=0.1):
self.resolution = resolution
self.max_depth = 16
self.nodes = {}
def update(self, points, pose):
"""更新 3D 点云地图"""
for point in points:
# 变换到世界坐标系
world_point = self.transform(point, pose)
# 更新体素
self.update_voxel(world_point, occupied=True)
def update_voxel(self, point, occupied=True):
"""更新体素"""
key = self.point_to_key(point)
if key not in self.nodes:
self.nodes[key] = {
'probability': 0.5,
'children': {}
}
# 递归更新
self.update_node(self.nodes[key], point, occupied)
def point_to_key(self, point):
"""点坐标转体素键"""
depth = self.max_depth
scale = self.resolution * (2 ** (self.max_depth - depth))
return (
int(point[0] / scale),
int(point[1] / scale),
int(point[2] / scale)
)
class TSDFVolume:
def __init__(self, volume_size=1.0, resolution=256):
self.resolution = resolution
self.voxel_size = volume_size / resolution
self.volume = np.zeros((resolution, resolution, resolution), dtype=np.float32)
def integrate(self, depth_image, K, T):
"""融合深度图"""
h, w = depth_image.shape
for v in range(0, h, 2):
for u in range(0, w, 2):
d = depth_image[v, u]
if d <= 0 or d > 5.0:
continue
# 反投影
x = (u - K[0, 2]) * d / K[0, 0]
y = (v - K[1, 2]) * d / K[1, 1]
z = d
# 变换到世界坐标系
point_world = T @ np.array([x, y, z, 1])
# 体积索引
ix = int(point_world[0] / self.voxel_size)
iy = int(point_world[] / .voxel_size)
iz = (point_world[] / .voxel_size)
<= ix < .resolution:
.update_tsdf(ix, iy, iz, point_world[] - z)
():
.volume[x, y, z] = np.clip(sdf / .voxel_size, -, )