소스 정보
- 저장소
- MIUAV/vibe-coding-ros2
- 최근 소스 활동
- 2026년 5월 4일 10:47
- 감지된 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 vln명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SKILL.md 표시 중
| name | vln |
| description | 视觉语言导航 Vision-Language Navigation 技能 - VLN 自然语言导航、HF-RCN/R罗汉导航智能体 |
| argument-hint | VLN OR 视觉语言导航 OR vision language navigation OR 语言导航 OR 具身智能导航 |
| user-invocable | true |
基于自然语言指令在未知环境中进行视觉导航的具身智能技能
当需要以下帮助时使用此技能:
自然语言指令 + 起始视角 → → → 目标位置
"Go past the kitchen and turn left at the blue sofa"
↓ ↓
视觉观测 到达成功
| 指标 | 含义 |
|---|---|
| Success Rate (SR) | 是否到达目标位置 |
| Success Rate weighted by Path Length (SPL) | 考虑路径效率的成功率 |
| NDW | 成功导航的距离加权分数 |
| CLS | 按指令分句的逐句成功率 |
| 数据集 | 类型 | 特点 |
|---|---|---|
| R2R | 室内视觉导航 | Matterport3D Gibson |
| RxR | 室内导航(多语言) | Hindi/English/Tagalog |
| RoomNav | 室内语义导航 | GeoChat |
| VDOT | 开放世界视觉导航 | 野外环境 |
# r2r_agent.py
class R2REnv:
def __init__(self, dataset_path):
# R2R 数据集格式
# instrucion: 自然语言指令
# path: 专家轨迹 [viewpoints]
# start_pose: 起始位置 (scanId, viewpointId, heading, pitch)
# goal_viewpoint: 目标视角
import numpy as np
def encode_observation(image, heading, feature_dim=2048):
"""标准 R2R 观测编码"""
# ResNet/Matterport3D ResNet pretrained features
# 或使用 CLIP ViT encoding
return obs_encoding
# 两类动作空间
ACTION_TYPES = {
'discrete': # {Forward, Left, Right, Stop}
'continuous': # 32个离散视角 + Stop
}
class NavigationPolicy(nn.Module):
def forward(self, obs, history_emb):
# 输入: 当前图像特征 + 历史上下文
# 输出: 动作对数几率或连续旋转+停止
logits = self.action_head(history_emb)
return logits
文本编码器(BERT/CLIP)
↓
历史指令上下文(LSTM/Transformer)
↓
双层视觉编码器(全景图 → 视角注意)
↓
动作预测头(Cross-Entropy / 模仿学习)
# agents/vln/hf_rcn/model.py
class HF_RCN(nn.Module):
def __init__(self, vision_dim=2048, hidden_dim=512):
self.text_encoder = ClipEncoder()
self.panorama_encoder = PanoramaAttention(vision_dim, hidden_dim)
self.history_gru = nn.GRU(hidden_dim, hidden_dim, batch_first=True)
self.action_head = nn.Linear(hidden_dim, 4) # {F,L,R,Stop}
def forward(self, obs_images, instruction_tokens, history=None):
# obs_images: 全景图像列表 [batch, 36, C, H, W]
# instruction_tokens: [batch, seq_len]
text_feat = self.text_encoder(instruction_tokens)
vis_feat = self.panorama_encoder(obs_images)
combined = torch.cat([text_feat, vis_feat], dim=-1)
if history is not None:
combined = combined + history
logits = self.action_head(combined)
return logits
# configs/vln/r2r_hf_rcn.yaml
training:
optimizer: AdamW
learning_rate: 1e-4
batch_size: 24
epochs: 200
scheduler: StepLR(step_size=50, gamma=0.5)
loss: CrossEntropyLoss # 或 SeqKD(知识蒸馏)
auxiliary:
angular_loss: 0.1 # 预测视角方向辅助损失
stopping_loss: 0.05
# rclpy VLN 执行节点
class VLNNavigator(Node):
def __init__(self):
super().__init__('vln_navigator')
self.model = load_hf_rcn_model()
self.cmd_pub = self.create_publisher(Twist, '/nav_cmd', 10)
self.image_sub = self.create_subscription(
Image, '/camera', self.on_image, 10)
def on_image(self, msg):
# 1. 编码当前观测
obs = self.preprocess(msg)
# 2. 推理动作
action = self.model.predict(obs, self.instruction_emb)
# 3. 转换为 ROS2 Twist
cmd = self.action_to_twist(action)
self.cmd_pub.publish(cmd)
# 使用预训练 CLIP 替代 Matterport3D ResNet
class CLIPVLN(nn.Module):
def __init__(self):
self.clip, _ = load("ViT-L/14@336px", device='cuda')
self.projection = nn.Linear(768, 512)
def encode_observation(self, image):
with torch.no_grad():
feat = self.clip.encode_image(image)
return self.projection(feat)
# RxR → R2R 迁移
# RxR(多语言更长指令)→ R2R(英文短指令)
def adapt_instruction(instruction):
# 提取关键导航意图
keywords = extract_nav_keywords(instruction)
return " ".join(keywords) # 英文短指令
解决方案:使用预计算特征 + 全视角缓存
# 预计算所有视角特征(36个方向)
VIEWPOINT_CACHE = {}
def get_panorama_features(scan_id, viewpoint_id):
key = f"{scan_id}_{viewpoint_id}"
if key not in VIEWPOINT_CACHE:
images = capture_36_direction(scan_id, viewpoint_id)
VIEWPOINT_CACHE[key] = model.encode_batch(images)
return VIEWPOINT_CACHE[key]
解决方案:使用 Transformer cross-attention 或 GRU+LSTM
解决方案:
SOC 직업 분류 기준