对tools进行了整理,Xmake也改为相对路径,在线 LiDAR-IMU 定位器实现

This commit is contained in:
mzx committed 2026-11-23 14:32:42 +08:00
1 parent 0602144ac5
commit 4502296915
70 files changed
+2652 -1298

No files matched your search

+37
View File
@@ -0,0 +1,37 @@
#!/usr/bin/env python3
"""Exit successfully only after simulation clock and basic robot TF are available."""
import time
import rclpy
from rclpy.node import Node
from rclpy.parameter import Parameter
from rclpy.time import Time
from tf2_ros import Buffer, TransformListener
def main():
rclpy.init()
node = Node('wait_navigation_ready', parameter_overrides=[Parameter('use_sim_time', value=True)])
buffer = Buffer(node=node)
listener = TransformListener(buffer, node)
result = 1
try:
deadline = time.monotonic()+180
while rclpy.ok() and time.monotonic() < deadline:
rclpy.spin_once(node, timeout_sec=0.1)
if (node.get_clock().now().nanoseconds > 0
and buffer.can_transform('odom', 'base_link', Time())
and buffer.can_transform('base_link', 'lidar_link', Time())):
print('simulation clock and odom/base/lidar TF ready', flush=True)
result = 0
break
if result:
print('simulation clock/TF readiness timeout', flush=True)
finally:
_ = listener
node.destroy_node()
rclpy.shutdown()
return result
if __name__ == '__main__':
raise SystemExit(main())