用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/MIUAV/vibe-coding-ros2 --skill robot-controllers命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | robot-controllers |
| description | Webots 机器人控制器技能 - Python/C++ 控制器、电机控制、传感器读取 |
| argument-hint | Webots控制器 OR 电机控制 OR 传感器读取 |
| user-invocable | true |
用于开发 Webots 机器人控制器
当需要以下帮助时使用此技能:
from controller import Robot, Motor, Lidar
robot = Robot()
timestep = int(robot.getBasicTimeStep())
# 获取设备
motor = robot.getMotor('left wheel')
lidar = robot.getLidar('lidar')
# 主循环
while robot.step(timestep) != -1:
motor.setVelocity(1.0)
class DiffDriveController:
def __init__(self, robot):
self.left_motor = robot.getMotor('left wheel')
self.right_motor = robot.getMotor('right wheel')
def move(self, linear, angular):
v_left = linear - angular * self.wheel_separation / 2
v_right = linear + angular * self.wheel_separation / 2
self.left_motor.setVelocity(v_left)
self.right_motor.setVelocity(v_right)