修改功能包分布和整合launch
This commit is contained in:
@@ -256,10 +256,12 @@ class Sim(object):
|
||||
'br_sim_bringup '+('scan_lio_terrain.launch.py' if terrain else 'scan_lio.launch.py') if lio_navigation else
|
||||
'br_sim_bringup mid360_sim.launch.py' if localization else
|
||||
'br_sim_bringup '+('scan_terrain.launch.py' if terrain else 'scan_sim.launch.py') if navigation else
|
||||
'r2027_robot_description robocon_robot.launch.py')
|
||||
'br_sim_bringup robot_sim.launch.py')
|
||||
options = ('gui:=%s' % ('true' if gui else 'false'))
|
||||
if lio_navigation:
|
||||
options += ' sensor_profile:='+sensor_profile
|
||||
if not terrain and not split:
|
||||
options += ' with_rviz:=false'
|
||||
if split:options += ' terrain:='+('true' if terrain else 'false')
|
||||
elif localization:
|
||||
options += ' with_lio:=true sensor_profile:='+sensor_profile
|
||||
@@ -294,10 +296,11 @@ class Sim(object):
|
||||
return False, 'launch 进程提前退出 code=%s' % self.proc.returncode
|
||||
for p in proc_tree(self.proc.pid):
|
||||
self.known[p] = _comm(p)
|
||||
# The port/clock can become ready before spawn_entity finishes.
|
||||
# All callers use the robot entry: require its actual spawn success
|
||||
# before allowing a state query/reset, independently of settling.
|
||||
model_ready = 'Spawn status: SpawnEntity: Successfully spawned entity' in self.log_text()
|
||||
# The port/clock can become ready before the robot is spawned.
|
||||
# Require explicit success from either the legacy or split spawn client.
|
||||
launch_log = self.log_text()
|
||||
model_ready = ('Spawn status: SpawnEntity: Successfully spawned entity' in launch_log
|
||||
or '已生成机器人' in launch_log)
|
||||
if model_ready and port_open(port=11355) and any(v == 'gzserver' for v in self.known.values()):
|
||||
return True, 'gzserver 与模型生成均已就绪(%.1f s)' % (time.monotonic() - t0)
|
||||
return False, '在 %.0f s 内未就绪' % timeout
|
||||
|
||||
Reference in New Issue
Block a user