feat: add external ROS communication toggle for local workspaces

This commit is contained in:
2026-09-16 15:35:15 +09:00
parent 76a87fc20d
commit 1d959e2c51
9 changed files with 25 additions and 8 deletions
+4 -3
View File
@@ -260,6 +260,7 @@ type RemoteWorkspaceTarget = {
type RosNetworkConfig = {
enabled?: boolean | null
allowExternal?: boolean
peer?: RemoteWorkspaceTarget | null
}
@@ -3791,7 +3792,7 @@ async function startVisualizationBridge(
const requestedRosDomainId = String(rosDomainId ?? process.env.ROS_DOMAIN_ID ?? '0').trim() || '0'
const requestedRosNetworkKey = rosNetworkEnabled(rosNetwork)
? `peer:${rosNetwork?.peer?.host?.trim() ?? ''}`
: 'local'
: rosNetwork?.allowExternal === true ? 'lan' : 'local'
const otherContainerNames = (['autoware', 'nav2', 'slam'] as VisualizationStack[])
.filter((item) => item !== stack)
.map(visualizationBridgeContainerName)
@@ -3869,7 +3870,7 @@ async function startVisualizationBridge(
'-e',
`ROS_DOMAIN_ID=${requestedRosDomainId}`,
'-e',
`ROS_LOCALHOST_ONLY=${rosNetworkEnabled(rosNetwork) ? '0' : '1'}`,
`ROS_LOCALHOST_ONLY=${rosNetworkEnabled(rosNetwork) || rosNetwork?.allowExternal === true ? '0' : '1'}`,
'-e',
`AUTONOMY_STUDIO_ROS_NETWORK=${requestedRosNetworkKey}`,
'-e',
@@ -5062,7 +5063,7 @@ async function startWorkspaceModule(
],
undefined,
{
ROS_LOCALHOST_ONLY: rosNetworkEnabled(rosNetwork) ? '0' : '1',
ROS_LOCALHOST_ONLY: rosNetworkEnabled(rosNetwork) || rosNetwork?.allowExternal === true ? '0' : '1',
...(fastDdsConfigPath ? { FASTDDS_CONFIG_PATH: fastDdsConfigPath } : {}),
},
30000