fix(sim): clean up interrupted runs and document usage and migration

Prevent ROS cleanup errors from skipping owned Gazebo process teardown.
Reject occupied master ports before launching nodes and stop the stack when
its GUI closes. Add --gui to the automatic LIO navigation checks.

Expand the root README and add a beginner guide covering manual goals,
automatic tests, restart troubleshooting, MID360 assumptions and staged
migration to real hardware. Preserve lifecycle and GUI validation evidence.

Validation: three navigation restart cycles, two busy-port rejection cases,
SIGINT/SIGHUP cleanup and a GUI straight-route check. Current source hashes,
Python syntax, documentation shell syntax and local links verified. Hardware
migration remains unverified; no push performed.
This commit is contained in:
2026-11-08 22:44:02 +08:00
parent 664eaa81e5
commit ca61aa63b5
21 changed files with 1022 additions and 59 deletions
+2 -3
View File
@@ -10,7 +10,7 @@ from geometry_msgs.msg import PoseStamped
from nav_msgs.msg import Path as NavPath
from rclpy.qos import QoSProfile,DurabilityPolicy,qos_profile_sensor_data
from sensor_msgs.msg import PointCloud2
from check_omni_robot import Sim,sim_env
from check_omni_robot import Sim,sim_env, shutdown_probe
from check_lio_navigation import LioNavProbe,graph_evidence
from check_mid360 import interpolate,rotate,json_value
from check_sim_lidar import points
@@ -185,8 +185,7 @@ def main():
report['cloud_snapshots']=p.snapshots;report['navigation_status']=p.navigation_status
except Exception as exc:report['error']=repr(exc);print(report['error'],flush=True)
finally:
if p is not None:p.send(0.,0.,0.);p.destroy_node()
if rclpy.ok():rclpy.shutdown()
report['ros_cleanup_errors'] = shutdown_probe(p)
report['teardown']=sim.stop();(out/'result.json').write_text(json.dumps(report,indent=2,default=json_value)+'\n')
return {'PASS':0,'FAIL':30,'INVALID':40}[report['status']]