- Dockerfile: L4T R32.6.1 (JetPack 4.6) base + ROS2 Humble + SLAM stack (slam_toolbox, Nav2, rplidar_ros, realsense2_camera, robot_localization) - docker-compose.yml: multi-service stack (ROS2, RPLIDAR A1M8, D435i, STM32 bridge) with device passthrough, host networking for DDS, persistent map volume - docs/pinout.md: full GPIO/I2C/UART pinout for STM32F722 bridge (USB CDC + UART fallback), RealSense D435i (USB3), RPLIDAR A1M8, udev rules - docs/power-budget.md: 10W envelope analysis with per-component breakdown, mitigation strategies (RPLIDAR gating, D435i 640p, nvpmodel modes) - scripts/setup-jetson.sh: host one-shot setup (Docker, nvidia-container-runtime, udev rules, MAXN power mode, swap) - scripts/build-and-run.sh: build/up/down/shell/slam/status helper Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
103 lines
4.2 KiB
Docker
103 lines
4.2 KiB
Docker
# Jetson Nano — ROS2 Humble dev container
|
|
# Base: JetPack 4.6 (L4T R32.6.1) + CUDA 10.2
|
|
# Arch: ARM64 (aarch64)
|
|
|
|
FROM nvcr.io/nvidia/l4t-base:r32.6.1
|
|
|
|
LABEL maintainer="sl-jetson <saltylab>"
|
|
LABEL description="ROS2 Humble + SLAM stack for Jetson Nano self-balancing robot"
|
|
LABEL jetpack="4.6"
|
|
LABEL ros_distro="humble"
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
ENV ROS_DISTRO=humble
|
|
ENV ROS_ROOT=/opt/ros/${ROS_DISTRO}
|
|
ENV PYTHONDONTWRITEBYTECODE=1
|
|
ENV PYTHONUNBUFFERED=1
|
|
|
|
# ── System deps ────────────────────────────────────────────────────────────────
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
# Build tools
|
|
build-essential cmake git wget curl \
|
|
# Python
|
|
python3-dev python3-pip python3-setuptools python3-wheel \
|
|
# Serial / I2C / SPI
|
|
i2c-tools libi2c-dev python3-smbus \
|
|
picocom minicom setserial \
|
|
# USB
|
|
usbutils libusb-1.0-0-dev \
|
|
# Misc
|
|
locales tzdata htop tmux nano \
|
|
# Networking
|
|
net-tools iputils-ping \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN locale-gen en_US.UTF-8
|
|
ENV LANG=en_US.UTF-8
|
|
|
|
# ── ROS2 Humble (from ROS2 apt repo — ARM64 build) ─────────────────────────────
|
|
# Note: official humble debs for ARM64/L4T are provided via NVIDIA Isaac ROS
|
|
# or via ros2-apt-source for 20.04 focal.
|
|
RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc \
|
|
| apt-key add - && \
|
|
echo "deb [arch=arm64] http://packages.ros.org/ros2/ubuntu focal main" \
|
|
> /etc/apt/sources.list.d/ros2.list && \
|
|
apt-get update && apt-get install -y --no-install-recommends \
|
|
ros-humble-ros-base \
|
|
ros-humble-rmw-cyclonedds-cpp \
|
|
ros-dev-tools \
|
|
python3-colcon-common-extensions \
|
|
python3-rosdep \
|
|
&& rosdep init && rosdep update \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# ── Nav / SLAM / sensor packages ──────────────────────────────────────────────
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
ros-humble-nav2-bringup \
|
|
ros-humble-slam-toolbox \
|
|
ros-humble-robot-localization \
|
|
ros-humble-rplidar-ros \
|
|
ros-humble-realsense2-camera \
|
|
ros-humble-realsense2-description \
|
|
ros-humble-tf2-tools \
|
|
ros-humble-rqt \
|
|
ros-humble-rqt-common-plugins \
|
|
ros-humble-rviz2 \
|
|
ros-humble-rosbridge-server \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# ── GPIO / serial Python libs ──────────────────────────────────────────────────
|
|
RUN pip3 install --no-cache-dir \
|
|
Jetson.GPIO \
|
|
pyserial \
|
|
smbus2 \
|
|
adafruit-blinka \
|
|
RPi.GPIO \
|
|
numpy \
|
|
scipy
|
|
|
|
# ── RealSense SDK (librealsense2 ARM64) ───────────────────────────────────────
|
|
# Pre-built for L4T — install from Jetson Hacks script or apt source
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# librealsense2 ARM64 wheel (NVIDIA-patched for L4T)
|
|
RUN pip3 install --no-cache-dir pyrealsense2
|
|
|
|
# ── Workspace setup ───────────────────────────────────────────────────────────
|
|
RUN mkdir -p /ros2_ws/src
|
|
WORKDIR /ros2_ws
|
|
|
|
# Source ROS2 in every shell
|
|
RUN echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> /root/.bashrc && \
|
|
echo "source /ros2_ws/install/local_setup.bash 2>/dev/null || true" >> /root/.bashrc && \
|
|
echo "export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp" >> /root/.bashrc
|
|
|
|
# ── Entrypoint ────────────────────────────────────────────────────────────────
|
|
COPY scripts/entrypoint.sh /entrypoint.sh
|
|
RUN chmod +x /entrypoint.sh
|
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|
|
CMD ["bash"]
|