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:
@@ -15,7 +15,7 @@ from sensor_msgs.msg import PointCloud2
|
||||
from nav_msgs.msg import Odometry
|
||||
from rclpy.qos import qos_profile_sensor_data
|
||||
|
||||
from check_omni_robot import Probe, Sim, reset_and_settle, sim_env
|
||||
from check_omni_robot import Probe, Sim, reset_and_settle, sim_env, shutdown_probe
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parents[1] /
|
||||
'src/r2027_robot_description/scripts'))
|
||||
@@ -128,11 +128,7 @@ def main():
|
||||
report['error'] = repr(exc)
|
||||
print(report['error'], flush=True)
|
||||
finally:
|
||||
if probe is not None:
|
||||
probe.send(0., 0., 0.)
|
||||
probe.destroy_node()
|
||||
if rclpy.ok():
|
||||
rclpy.shutdown()
|
||||
report['ros_cleanup_errors'] = shutdown_probe(probe)
|
||||
report['teardown'] = sim.stop()
|
||||
(out/'result.json').write_text(json.dumps(report, ensure_ascii=False, indent=2)+'\n')
|
||||
return {'PASS': 0, 'FAIL': 30, 'INVALID': 40}[report['status']]
|
||||
|
||||
Reference in New Issue
Block a user