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:
@@ -13,7 +13,7 @@ import time
|
||||
import numpy as np
|
||||
import rclpy
|
||||
from nav_msgs.msg import Odometry
|
||||
from check_omni_robot import Sim,sim_env
|
||||
from check_omni_robot import Sim,sim_env, shutdown_probe
|
||||
from check_mid360 import SensorProbe,phase,interpolate,rotate,json_value
|
||||
|
||||
IMU_OFFSET=np.array([.011,.02329,.25588])
|
||||
@@ -122,8 +122,7 @@ def main():
|
||||
result['status']='INVALID';result['error']=repr(exc);print(result['error'],flush=True)
|
||||
if p is not None:result['estimates']=p.estimates
|
||||
finally:
|
||||
if p is not None:p.send(0.,0.,0.);p.destroy_node()
|
||||
if rclpy.ok():rclpy.shutdown()
|
||||
result['ros_cleanup_errors'] = shutdown_probe(p)
|
||||
result['teardown']=sim.stop()
|
||||
(out/'result.json').write_text(json.dumps(result,indent=2,default=json_value)+'\n')
|
||||
return {'PASS':0,'FAIL':30,'INVALID':40}[result['status']]
|
||||
|
||||
Reference in New Issue
Block a user