用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/MIUAV/vibe-coding-ros2 --skill robot-sdf-modeling命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | robot-sdf-modeling |
| description | 机器人 SDF 建模技能 - SDF 模型结构、链接关节、摩擦阻尼、ROS2 gazebo_ros |
| argument-hint | SDF建模 OR sdf OR robot model OR link OR joint |
| user-invocable | true |
Gazebo SDF 模型创建
当需要以下帮助时使用此技能:
<?xml version="1.0"?>
<sdf version="1.9">
<model name="robot_name">
<!-- 静态模型 -->
<static>false</static>
<!-- 物理引擎 -->
<physics name="default_physics" type="ode">
<max_step_size>0.001</max_step_size>
<real_time_factor>1.0</real_time_factor>
<real_time_update_rate>1000</real_time_update_rate>
</physics>
<!-- 链接定义 -->
<link name="base_link">
<pose>0 0 0.1 0 0 0</pose>
<!-- 惯性 -->
<inertial>
<mass>10.0</mass>
<inertia>
<ixx>0.01</ixx>
<ixy>0</ixy>
<ixz>0</ixz>
<iyy>0.01</iyy>
<iyz>0</iyz>
<izz>0.01</izz>
</inertia>
</inertial>
<!-- 碰撞几何 -->
<collision name="base_collision">
<geometry>
<box>
<size>0.5 0.5 0.1</size>
</box>
</geometry>
<surface>
<friction>
<ode>
<mu>1.0</mu>
<mu2>1.0</mu2>
</ode>
</friction>
</surface>
</collision>
<!-- 视觉几何 -->
<visual name="base_visual">
<geometry>
<box>
<size>0.5 0.5 0.1</size>
</box>
</geometry>
<material>
<ambient>0.8 0.8 0.8 1</ambient>
</material>
</visual>
</link>
<!-- 关节定义 -->
<joint name="joint1" type="revolute">
<parent>base_link</parent>
<child>link1</child>
<axis>
<xyz>0 0 1</xyz>
<limit>
<lower>-3.14</lower>
<upper>3.14</upper>
<effort>100</effort>
<velocity>10</velocity>
</limit>
</axis>
</joint>
</model>
</sdf>
# launch/gazebo.launch.py
from launch import LaunchDescription
from launch_ros.actions import Node
from launch.actions import ExecuteProcess
def generate_launch_description():
return LaunchDescription([
# 启动 Gazebo
ExecuteProcess(
cmd=['gzserver', '-s', 'libgazebo_ros_factory.so'],
output='screen'
),
# 加载模型
Node(
package='gazebo_ros',
executable='spawn_entity',
arguments=['-entity', 'robot_name', '-file', '/path/to/model.sdf'],
output='screen'
),
# ROS2-Gazebo 桥接
Node(
package='ros_gz_bridge',
executable='parameter_bridge',
arguments=['/model/robot_name/pose@tf2_msgs/msg/TF@gz.msgs.Pose'],
output='screen'
)
])
<!-- 摩擦配置 -->
<surface>
<friction>
<ode>
<mu>0.8</mu> <!-- 静摩擦系数 -->
<mu2>0.8</mu2> <!-- 动摩擦系数 -->
<fdir1>1 0 0</fdir1> <!-- 摩擦方向 -->
<slip1>0</slip1> <!-- 滑动摩擦 -->
<slip2>0</slip2>
</ode>
</friction>
<contact>
<ode>
<kp>1e7</kp> <!-- 接触刚度 -->
<kd>1e6</kd> <!-- 接触阻尼 -->
<max_vel>0.1</max_vel>
<min_depth>0.001</min_depth>
</ode>
</contact>
</>
0
0.2