初始化: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:
1 parent
ed31ccc39f
commit
f7412ec369
142 files changed
+58958
-2
No files matched your search
@@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env python3
|
||||
"""检查 MID-360 3D 点云质量:点数、有效点、距离分布、可见的地面/围挡。"""
|
||||
import math
|
||||
import time
|
||||
|
||||
import rclpy
|
||||
from rclpy.node import Node
|
||||
from sensor_msgs.msg import PointCloud2
|
||||
|
||||
try:
|
||||
import sensor_msgs_py.point_cloud2 as pc2
|
||||
except ImportError:
|
||||
pc2 = None
|
||||
|
||||
rclpy.init()
|
||||
node = Node('cloud_probe')
|
||||
got = {}
|
||||
node.create_subscription(PointCloud2, '/scan/points', lambda m: got.setdefault('c', m), 10)
|
||||
t0 = time.time()
|
||||
while time.time() - t0 < 15 and 'c' not in got:
|
||||
rclpy.spin_once(node, timeout_sec=0.2)
|
||||
|
||||
m = got.get('c')
|
||||
if m is None:
|
||||
print('没收到 /scan/points')
|
||||
else:
|
||||
print(f'frame={m.header.frame_id} 尺寸={m.width}x{m.height} point_step={m.point_step}')
|
||||
if pc2 is None:
|
||||
print('(没有 sensor_msgs_py,跳过解析)')
|
||||
else:
|
||||
pts = [p for p in pc2.read_points(m, field_names=('x', 'y', 'z'), skip_nans=True)]
|
||||
fin = [p for p in pts if all(math.isfinite(v) for v in p)]
|
||||
print(f'点总数={len(pts)} 有限点={len(fin)}')
|
||||
if fin:
|
||||
rng = [math.hypot(p[0], p[1]) for p in fin]
|
||||
zs = [p[2] for p in fin]
|
||||
print(f'水平距离: {min(rng):.2f} ~ {max(rng):.2f} m')
|
||||
print(f'高度范围: {min(zs):+.2f} ~ {max(zs):+.2f} m(传感器在 0.405,地面应在 -0.405 附近)')
|
||||
import collections
|
||||
h = collections.Counter(int(r / 2) * 2 for r in rng)
|
||||
print('距离直方图(每 2m):', dict(sorted(h.items())))
|
||||
node.destroy_node()
|
||||
rclpy.shutdown()
|
||||
Reference in new issue
Block a user