fix: detect remote SLAM bridge and clear loading state on response
This commit is contained in:
+21
-4
@@ -2462,9 +2462,12 @@ async function readRemoteVisualizationBridgeStatus(target: RemoteWorkspaceTarget
|
||||
'docker ps --format "{{.Names}}\\t{{.Status}}" 2>/dev/null || true',
|
||||
10_000,
|
||||
)
|
||||
const nav2 = output.split('\n').find((line) => line.startsWith('nav2-ros-bridge\t'))
|
||||
const autoware = output.split('\n').find((line) => line.startsWith('autoware-ros-bridge\t'))
|
||||
const lines = output.split('\n')
|
||||
const nav2 = lines.find((line) => line.startsWith('nav2-ros-bridge\t'))
|
||||
const slam = lines.find((line) => line.startsWith('slam-ros-bridge\t'))
|
||||
const autoware = lines.find((line) => line.startsWith('autoware-ros-bridge\t'))
|
||||
if (nav2) return { ok: true, running: true, stack: 'nav2' }
|
||||
if (slam) return { ok: true, running: true, stack: 'slam' }
|
||||
if (autoware) return { ok: true, running: true, stack: 'autoware' }
|
||||
return { ok: true, running: false, stack: null }
|
||||
} catch (error) {
|
||||
@@ -2472,6 +2475,18 @@ async function readRemoteVisualizationBridgeStatus(target: RemoteWorkspaceTarget
|
||||
}
|
||||
}
|
||||
|
||||
const managedVisualizationBridgeEnvKeys = new Set([
|
||||
'ROS_DOMAIN_ID',
|
||||
'ROS_LOCALHOST_ONLY',
|
||||
'FASTDDS_DEFAULT_PROFILES_FILE',
|
||||
'FASTRTPS_DEFAULT_PROFILES_FILE',
|
||||
'AUTONOMY_STUDIO_ROS_NETWORK',
|
||||
])
|
||||
|
||||
function isManagedVisualizationBridgeEnvKey(key: string): boolean {
|
||||
return managedVisualizationBridgeEnvKeys.has(key)
|
||||
}
|
||||
|
||||
async function startRemoteVisualizationBridge(
|
||||
target: RemoteWorkspaceTarget,
|
||||
stackInput?: string | null,
|
||||
@@ -2486,7 +2501,7 @@ async function startRemoteVisualizationBridge(
|
||||
const fastDdsConfigPath = await prepareRemoteRosNetworkConfig(normalized, '~/.autonomy-studio/runtime/nav2', rosNetwork, rosDomainId)
|
||||
const containerName = visualizationBridgeContainerName(stack)
|
||||
const bridgeEnvArgs = Object.entries(environmentProfile?.bridge?.env ?? {})
|
||||
.filter(([key]) => /^[A-Z_][A-Z0-9_]*$/.test(key))
|
||||
.filter(([key]) => /^[A-Z_][A-Z0-9_]*$/.test(key) && !isManagedVisualizationBridgeEnvKey(key))
|
||||
.map(([key, value]) => `-e ${quoteShellSingle(`${key}=${value}`)}`)
|
||||
.join(' ')
|
||||
let image = resolveVisualizationBridgeImage(stack, environmentProfile?.bridge, environmentProfile?.runtimeImages)
|
||||
@@ -4022,7 +4037,9 @@ async function startVisualizationBridge(
|
||||
CMD_VEL_TOPIC: '/cmd_vel',
|
||||
NAVIGATE_TO_POSE_ACTION: '/navigate_to_pose'
|
||||
} : {})
|
||||
Object.entries(bridgeEnv).forEach(([key, value]) => args.push('-e', `${key}=${value}`))
|
||||
Object.entries(bridgeEnv).forEach(([key, value]) => {
|
||||
if (!isManagedVisualizationBridgeEnvKey(key)) args.push('-e', `${key}=${value}`)
|
||||
})
|
||||
if (usesSlamBridge) {
|
||||
args.push('-e', `PORT=${bridgePort}`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user