初始化:RMUL 2027 哨兵导航仿真工程

- Gazebo Sim (Jetty 10.6) + ROS 2 Lyrical + Nav2 全栈
- 整车模型:URDF/SDF + 减面网格(SolidWorks 装配体实测尺寸)
- 场地:RMUL 2027 官方包(2D 栅格地图 + 3D 场地模型),放在 field/
- sentry_nav C++ 包:self_filter 点云自滤 / patrol 航点巡逻
- 文档:README(含本机开发环境实测)、MID-360 接入说明

已排除:build/ install/ log/ 缓存目录,以及 115 MB 的原始高模
(仿真实际用的是 meshes/base.stl 减面版,约 25.7 万面)
This commit is contained in:
mzx committed 2026-11-14 21:18:04 +08:00
1 parent ed31ccc39f
commit f7412ec369
142 files changed
+58958 -2

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
# generated/
运行时产物与调试输出,**内容可随时删除,不影响工程**。
| 文件 | 说明 |
|---|---|
| `sentry.urdf` | 某次 xacro 展开的结果(临时) |
| `drive_trajectory.svg` | `tools/drive_demo.py` 生成的方形行驶轨迹图 |
启动脚本/调试时把日志重定向到这里,例如:
```bash
HEADLESS=1 RVIZ=0 scripts/sentry_up.sh > generated/run.log 2>&1
```
> 这个目录里的东西都不进版本库,删了下次运行会重新生成。
+26
View File
@@ -0,0 +1,26 @@
<svg xmlns="http://www.w3.org/2000/svg" width="700" height="760" viewBox="0 0 700 760">
<rect width="700" height="760" fill="#11141a"/>
<line x1="-43.1" y1="20" x2="-43.1" y2="740" stroke="#222833" stroke-width="1"/>
<text x="-43.1" y="754" fill="#556" font-size="10" text-anchor="middle">-1.0</text>
<line x1="165.9" y1="20" x2="165.9" y2="740" stroke="#222833" stroke-width="1"/>
<text x="165.9" y="754" fill="#556" font-size="10" text-anchor="middle">-0.5</text>
<line x1="374.9" y1="20" x2="374.9" y2="740" stroke="#222833" stroke-width="1"/>
<text x="374.9" y="754" fill="#556" font-size="10" text-anchor="middle">0.0</text>
<line x1="583.9" y1="20" x2="583.9" y2="740" stroke="#222833" stroke-width="1"/>
<text x="583.9" y="754" fill="#556" font-size="10" text-anchor="middle">0.5</text>
<line x1="20" y1="768.4" x2="680" y2="768.4" stroke="#222833" stroke-width="1"/>
<text x="4" y="771.4" fill="#556" font-size="10">-0.5</text>
<line x1="20" y1="559.4" x2="680" y2="559.4" stroke="#222833" stroke-width="1"/>
<text x="4" y="562.4" fill="#556" font-size="10">0.0</text>
<line x1="20" y1="350.4" x2="680" y2="350.4" stroke="#222833" stroke-width="1"/>
<text x="4" y="353.4" fill="#556" font-size="10">0.5</text>
<line x1="20" y1="141.4" x2="680" y2="141.4" stroke="#222833" stroke-width="1"/>
<text x="4" y="144.4" fill="#556" font-size="10">1.0</text>
<polyline points="384.2,574.4 384.2,574.4 384.2,574.4 384.2,574.4 384.2,574.4 384.2,574.4 384.2,574.4 384.2,574.4 384.2,574.4 384.2,574.4 384.2,574.4 384.2,574.4 384.2,574.4 384.2,574.4 384.2,574.4 384.2,574.4 384.2,574.4 384.2,574.4 384.2,574.4 384.2,574.4 384.2,574.4 384.2,574.4 384.2,574.4 384.2,574.4 384.2,574.4 384.2,574.4 384.2,574.4 392.1,574.0 400.5,573.6 408.8,573.1 417.2,572.7 425.5,572.2 433.9,571.8 442.2,571.3 450.6,570.9 458.9,570.5 467.3,570.0 475.6,569.6 483.9,569.1 492.3,568.7 500.6,568.3 509.0,567.8 517.3,567.4 525.7,566.9 534.0,566.5 542.4,566.1 550.7,565.6 559.1,565.2 567.4,564.7 575.8,564.3 584.1,563.8 592.5,563.4 600.8,563.0 609.2,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.6,562.5 609.1,554.6 608.5,546.2 608.0,537.9 607.4,529.5 606.9,521.2 606.3,512.9 605.8,504.5 605.2,496.2 604.7,487.8 604.1,479.5 603.6,471.2 603.0,462.8 602.5,454.5 601.9,446.1 601.3,437.8 600.8,429.4 600.2,421.1 599.7,412.8 599.1,404.4 598.6,396.1 598.0,387.7 597.5,379.4 596.9,371.1 596.4,362.7 595.8,354.4 595.3,346.0 594.7,337.7 594.2,329.3 593.6,321.0 593.1,312.7 592.5,304.3 592.0,296.0 591.4,287.6 590.9,279.3 590.3,270.9 589.8,262.6 589.2,254.3 588.7,245.9 588.1,237.6 587.6,229.2 587.0,220.9 586.5,212.6 585.9,204.2 585.4,195.9 584.8,187.5 584.3,179.2 583.7,170.8 583.1,162.5 582.6,154.2 582.0,145.8 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 582.0,145.4 578.3,145.7 569.9,146.4 561.6,147.0 553.3,147.7 544.9,148.3 536.6,149.0 528.3,149.7 519.9,150.3 511.6,151.0 503.3,151.7 494.9,152.3 486.6,153.0 478.3,153.6 469.9,154.3 461.6,155.0 453.3,155.6 444.9,156.3 436.6,156.9 428.3,157.6 419.9,158.3 411.6,158.9 403.3,159.6 394.9,160.3 386.6,160.9 378.3,161.6 369.9,162.2 361.6,162.9 353.3,163.6 344.9,164.2 336.6,164.9 328.2,165.5 319.9,166.2 311.6,166.9 303.2,167.5 294.9,168.2 286.6,168.9 278.2,169.5 269.9,170.2 261.6,170.8 253.2,171.5 244.9,172.2 236.6,172.8 228.2,173.5 220.0,174.0 211.7,174.7 203.3,175.4 195.0,176.0 186.7,176.7 178.3,177.3 170.0,178.0 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.4,178.4 165.7,182.1 166.5,190.4 167.3,198.7 168.0,207.1 168.8,215.4 169.6,223.7 170.3,232.0 171.1,240.4 171.9,248.7 172.6,257.0 173.4,265.3 174.2,273.7 174.9,282.0 175.7,290.3 176.5,298.6 177.2,307.0 178.0,315.3 178.8,323.6 179.5,331.9 180.3,340.3 181.1,348.6 181.8,356.9 182.6,365.2 183.4,373.6 184.2,381.9 184.9,390.2 185.7,398.5 186.5,406.9 187.2,415.2 188.0,423.5 188.8,431.8 189.5,440.2 190.3,448.5 191.1,456.8 191.8,465.1 192.6,473.5 193.4,481.8 194.1,490.1 194.9,498.4 195.7,506.8 196.4,515.1 197.2,523.4 198.0,531.7 198.7,540.1 199.5,548.4 200.3,556.7 201.0,565.0 201.8,573.4 202.6,581.7 203.3,590.0 203.7,594.6 203.7,594.6 203.7,594.6 203.7,594.6 203.7,594.6 203.7,594.6 203.7,594.6 203.7,594.6 203.7,594.6 203.7,594.6 203.7,594.6 203.7,594.6 203.7,594.6 203.7,594.6 203.7,594.6 203.7,594.6 2Line truncated
<circle cx="374.9" cy="559.4" r="5" fill="#3ddc84"/>
<text x="382.9" y="553.4" fill="#3ddc84" font-size="12">起点</text>
<circle cx="203.7" cy="594.6" r="5" fill="#ff5c5c"/>
<text x="211.7" y="608.6" fill="#ff5c5c" font-size="12">终点</text>
<line x1="203.7" y1="594.6" x2="229.6" y2="591.9" stroke="#ffd166" stroke-width="2"/>
<text x="20" y="24" fill="#8892a6" font-size="13">哨兵方形行驶轨迹(边长 1.0 m,速度 0.5 m/s,转向 0.8 rad/s)</text>
</svg>

After

Width:  |  Height:  |  Size: 7.3 KiB

+291
View File
@@ -0,0 +1,291 @@
<?xml version="1.0" ?>
<!-- =================================================================================== -->
<!-- | This document was autogenerated by xacro from src/sentry_sim/urdf/sentry.urdf.xacro | -->
<!-- | EDITING THIS FILE BY HAND IS NOT RECOMMENDED | -->
<!-- =================================================================================== -->
<!--
哨兵底盘 URDF(由 SolidWorks 装配体导出的 STL 生成)
坐标系:REP-103(X 前、Y 左、Z 上),原点在车体几何中心的地面投影。
网格:meshes/base.stl(底盘,234 万面)、meshes/wheel.stl(单轮,34.7 万面)
均由 tools/build_meshes.py 从 SW 装配体转换而来,SW 的 Y 上/Z 前/X 左
已按 rpy=(π/2,0,π/2) 旋转到 ROS 约定。
⚠️ 占位值(等机械给真实数据后替换,已用 PLACEHOLDER 标注):
- 整车质量 20 kg、质心高度 0.15 m、转动惯量按长方体估算
- 轮子质量 1.0 kg
- 雷达安装高度 0.30 m(实际位置未知)
-->
<robot name="sentry">
<!-- ========== 材质 ========== -->
<material name="dark_gray">
<color rgba="0.15 0.15 0.17 1"/>
</material>
<material name="rm_blue">
<color rgba="0.10 0.25 0.60 1"/>
</material>
<material name="rm_red">
<color rgba="0.70 0.12 0.12 1"/>
</material>
<!-- ========== 车体 ========== -->
<link name="base_link">
<visual>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<mesh filename="/home/mzxiang/Gazebo_projects/sentry_nav_dev/install/sentry_sim/share/sentry_sim/meshes/base.stl"/>
</geometry>
<material name="dark_gray"/>
</visual>
<collision>
<!-- 碰撞用简化长方体,不用 CAD 网格:物理快、不穿模 -->
<origin rpy="0 0 0" xyz="0 0 0.1375"/>
<geometry>
<box size="0.631 0.52 0.275"/>
</geometry>
</collision>
<inertial>
<!-- PLACEHOLDER:按长方体估算,质心高度取 body_h/2 -->
<origin rpy="0 0 0" xyz="0 0 0.1375"/>
<mass value="20.0"/>
<inertia ixx="0.5767083333333334" ixy="0" ixz="0" iyy="0.7896433333333334" iyz="0" izz="1.1142683333333334"/>
</inertial>
</link>
<link name="wheel_fl">
<visual>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<mesh filename="/home/mzxiang/Gazebo_projects/sentry_nav_dev/install/sentry_sim/share/sentry_sim/meshes/wheel.stl"/>
</geometry>
<material name="dark_gray"/>
</visual>
<collision>
<origin rpy="1.5708 0 0" xyz="0 0 0"/>
<geometry>
<cylinder length="0.0436" radius="0.0762"/>
</geometry>
</collision>
<inertial>
<origin rpy="0 0 0" xyz="0 0 0"/>
<mass value="1.0"/>
<inertia ixx="0.0016100233333333335" ixy="0" ixz="0" iyy="0.00290322" iyz="0" izz="0.0016100233333333335"/>
</inertial>
</link>
<joint name="wheel_fl_joint" type="revolute">
<parent link="base_link"/>
<child link="wheel_fl"/>
<origin rpy="0 0 0" xyz=" 0.193245 -0.213200 0.076673"/>
<axis xyz="0 1 0"/>
<limit effort="50" lower="-1e16" upper="1e16" velocity="50"/>
</joint>
<link name="wheel_fr">
<visual>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<mesh filename="/home/mzxiang/Gazebo_projects/sentry_nav_dev/install/sentry_sim/share/sentry_sim/meshes/wheel.stl"/>
</geometry>
<material name="dark_gray"/>
</visual>
<collision>
<origin rpy="1.5708 0 0" xyz="0 0 0"/>
<geometry>
<cylinder length="0.0436" radius="0.0762"/>
</geometry>
</collision>
<inertial>
<origin rpy="0 0 0" xyz="0 0 0"/>
<mass value="1.0"/>
<inertia ixx="0.0016100233333333335" ixy="0" ixz="0" iyy="0.00290322" iyz="0" izz="0.0016100233333333335"/>
</inertial>
</link>
<joint name="wheel_fr_joint" type="revolute">
<parent link="base_link"/>
<child link="wheel_fr"/>
<origin rpy="0 0 0" xyz=" 0.193245 0.213200 0.076673"/>
<axis xyz="0 1 0"/>
<limit effort="50" lower="-1e16" upper="1e16" velocity="50"/>
</joint>
<link name="wheel_bl">
<visual>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<mesh filename="/home/mzxiang/Gazebo_projects/sentry_nav_dev/install/sentry_sim/share/sentry_sim/meshes/wheel.stl"/>
</geometry>
<material name="dark_gray"/>
</visual>
<collision>
<origin rpy="1.5708 0 0" xyz="0 0 0"/>
<geometry>
<cylinder length="0.0436" radius="0.0762"/>
</geometry>
</collision>
<inertial>
<origin rpy="0 0 0" xyz="0 0 0"/>
<mass value="1.0"/>
<inertia ixx="0.0016100233333333335" ixy="0" ixz="0" iyy="0.00290322" iyz="0" izz="0.0016100233333333335"/>
</inertial>
</link>
<joint name="wheel_bl_joint" type="revolute">
<parent link="base_link"/>
<child link="wheel_bl"/>
<origin rpy="0 0 0" xyz="-0.139096 -0.213200 0.076196"/>
<axis xyz="0 1 0"/>
<limit effort="50" lower="-1e16" upper="1e16" velocity="50"/>
</joint>
<link name="wheel_br">
<visual>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<mesh filename="/home/mzxiang/Gazebo_projects/sentry_nav_dev/install/sentry_sim/share/sentry_sim/meshes/wheel.stl"/>
</geometry>
<material name="dark_gray"/>
</visual>
<collision>
<origin rpy="1.5708 0 0" xyz="0 0 0"/>
<geometry>
<cylinder length="0.0436" radius="0.0762"/>
</geometry>
</collision>
<inertial>
<origin rpy="0 0 0" xyz="0 0 0"/>
<mass value="1.0"/>
<inertia ixx="0.0016100233333333335" ixy="0" ixz="0" iyy="0.00290322" iyz="0" izz="0.0016100233333333335"/>
</inertial>
</link>
<joint name="wheel_br_joint" type="revolute">
<parent link="base_link"/>
<child link="wheel_br"/>
<origin rpy="0 0 0" xyz="-0.139096 0.213200 0.076196"/>
<axis xyz="0 1 0"/>
<limit effort="50" lower="-1e16" upper="1e16" velocity="50"/>
</joint>
<!-- ========== 雷达 / IMU 安装点 ========== -->
<link name="lidar_link">
<visual>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<cylinder length="0.05" radius="0.035"/>
</geometry>
<material name="rm_blue"/>
</visual>
<inertial>
<origin rpy="0 0 0" xyz="0 0 0"/>
<mass value="0.3"/>
<inertia ixx="0.00012" ixy="0" ixz="0" iyy="0.00012" iyz="0" izz="0.0002"/>
</inertial>
</link>
<joint name="lidar_joint" type="fixed">
<parent link="base_link"/>
<child link="lidar_link"/>
<origin rpy="0 0 0" xyz="-0.24 0.18 0.29"/>
</joint>
<!-- ========== 云台(由 SW 云台装配体转换,原点在安装面 + yaw 轴) ========== -->
<link name="gimbal_link">
<visual>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<mesh filename="/home/mzxiang/Gazebo_projects/sentry_nav_dev/install/sentry_sim/share/sentry_sim/meshes/gimbal.stl"/>
</geometry>
<material name="rm_red"/>
</visual>
<collision>
<!-- 碰撞用简化包络(0.456 x 0.304 x 0.382) -->
<origin rpy="0 0 0" xyz="-0.06 0.04 0.19"/>
<geometry>
<box size="0.46 0.30 0.38"/>
</geometry>
</collision>
<inertial>
<origin rpy="0 0 0" xyz="-0.06 0.04 0.19"/>
<mass value="4.0"/>
<inertia ixx="0.05" ixy="0" ixz="0" iyy="0.05" iyz="0" izz="0.05"/>
</inertial>
</link>
<joint name="gimbal_yaw_joint" type="revolute">
<parent link="base_link"/>
<child link="gimbal_link"/>
<origin rpy="0 0 0" xyz="0 0 0.275"/>
<axis xyz="0 0 1"/>
<limit effort="60" lower="-3.14159" upper="3.14159" velocity="10"/>
</joint>
<link name="imu_link"/>
<joint name="imu_joint" type="fixed">
<parent link="base_link"/>
<child link="imu_link"/>
<origin rpy="0 0 0" xyz="0 0 0.1"/>
</joint>
<!-- ========== Gazebo 扩展 ========== -->
<!-- 轮子摩擦 -->
<gazebo reference="wheel_fl">
<mu1>1.2</mu1>
<mu2>1.2</mu2>
</gazebo>
<gazebo reference="wheel_fr">
<mu1>1.2</mu1>
<mu2>1.2</mu2>
</gazebo>
<gazebo reference="wheel_bl">
<mu1>1.2</mu1>
<mu2>1.2</mu2>
</gazebo>
<gazebo reference="wheel_br">
<mu1>1.2</mu1>
<mu2>1.2</mu2>
</gazebo>
<!-- 麦轮驱动插件 -->
<gazebo>
<plugin filename="gz-sim-mecanum-drive-system" name="gz::sim::systems::MecanumDrive">
<front_left_joint>wheel_fl_joint</front_left_joint>
<front_right_joint>wheel_fr_joint</front_right_joint>
<back_left_joint>wheel_bl_joint</back_left_joint>
<back_right_joint>wheel_br_joint</back_right_joint>
<wheel_separation>0.4264</wheel_separation>
<wheelbase>0.3323</wheelbase>
<wheel_radius>0.0762</wheel_radius>
<max_linear_velocity>2.0</max_linear_velocity>
<max_angular_velocity>4.0</max_angular_velocity>
<odom_topic>/odom</odom_topic>
<odom_publish_frequency>50</odom_publish_frequency>
<frame_id>odom</frame_id>
</plugin>
</gazebo>
<!-- 2D 激光雷达(PLACEHOLDER:型号/量程按实际改;type="lidar" 走 CPU 射线,不依赖 GPU) -->
<gazebo reference="lidar_link">
<sensor name="lidar" type="lidar">
<pose>0 0 0 0 0 0</pose>
<topic>scan</topic>
<gz_frame_id>lidar_link</gz_frame_id>
<update_rate>10</update_rate>
<always_on>true</always_on>
<visualize>true</visualize>
<ray>
<scan>
<horizontal>
<samples>360</samples>
<resolution>1</resolution>
<min_angle>-3.14159265</min_angle>
<max_angle>3.14159265</max_angle>
</horizontal>
</scan>
<range>
<min>0.10</min>
<max>12.0</max>
<resolution>0.01</resolution>
</range>
<noise>
<type>gaussian</type>
<mean>0.0</mean>
<stddev>0.01</stddev>
</noise>
</ray>
</sensor>
</gazebo>
<!-- IMU -->
<gazebo reference="imu_link">
<sensor name="imu" type="imu">
<topic>imu</topic>
<gz_frame_id>imu_link</gz_frame_id>
<update_rate>100</update_rate>
<always_on>true</always_on>
</sensor>
</gazebo>
</robot>