初始化: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

+27
View File
@@ -0,0 +1,27 @@
#!/usr/bin/env python3
"""统计 /cmd_vel、/model/sentry/cmd_vel 的消息数,并观察 odom 位移。"""
import time
import rclpy
from geometry_msgs.msg import Twist
from nav_msgs.msg import Odometry
from rclpy.node import Node
rclpy.init()
node = Node('probe_cmd')
cnt = {'a': 0, 'b': 0}
last = {'odom': None}
node.create_subscription(Twist, '/cmd_vel', lambda m: cnt.__setitem__('a', cnt['a'] + 1), 10)
node.create_subscription(Twist, '/model/sentry/cmd_vel',
lambda m: cnt.__setitem__('b', cnt['b'] + 1), 10)
node.create_subscription(Odometry, '/odom', lambda m: last.__setitem__('odom', m), 10)
t0 = time.time()
while time.time() - t0 < 10:
rclpy.spin_once(node, timeout_sec=0.2)
print(f'/cmd_vel 消息数={cnt["a"]} /model/sentry/cmd_vel 消息数={cnt["b"]}')
if last['odom']:
p = last['odom'].pose.pose.position
print(f'odom=({p.x:+.3f}, {p.y:+.3f})')
node.destroy_node()
rclpy.shutdown()