Files
PX4-Autopilot/Tools/packaging/containers/px4-network.sh
T
Ramon Roche f7052b281c feat(ros2): add PX4 ROS development containers
Provide a supported Jazzy environment for SIH/Gazebo development and source builds, with pinned tooling and reproducible multi-architecture image publishing. Separate package and container assets from ROS source preparation, and keep checkout workspaces fresh through a Python CLI.

Assisted-by: Copilot:gpt-6-astra
2026-09-10 16:07:58 -07:00

18 lines
626 B
Bash

#!/bin/sh
# Shared host MAVLink routing; the calling entrypoint chooses the DDS destination.
if [ -d /opt/px4-gazebo ]; then
PX4_PREFIX=/opt/px4-gazebo
else
PX4_PREFIX=/opt/px4
fi
# Both PX4 clients require IPv4; Docker Desktop may also return an IPv6 address.
DOCKER_HOST_IP=$(getent ahostsv4 host.docker.internal 2>/dev/null | awk '/STREAM/ {print $1; exit}')
if [ -n "$DOCKER_HOST_IP" ]; then
# Replace an existing target as well, so repeated entrypoint calls are safe.
sed -i -E "s/(mavlink start -x)( -t [^ ]+)? -u/\1 -t $DOCKER_HOST_IP -u/g" \
"$PX4_PREFIX/etc/init.d-posix/px4-rc.mavlink"
fi