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, -, )