# Install ROS 2 ($ros_version_short)
RUN add-apt-repository -y universe && \
    curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \
    echo "deb [arch=$$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $$(. /etc/os-release && echo $$UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null

RUN apt-get update && apt-get install -y \
    ros-$ros_version_short-desktop \
    ros-dev-tools \
    ros-$ros_version_short-perception \
    libpcl-dev && \
    apt-get clean && rm -rf /var/lib/apt/lists/*

RUN echo "source /opt/ros/$ros_version_short/setup.bash" >> /root/.bashrc && \
    echo "source /opt/ros/$ros_version_short/setup.zsh" >> /root/.zshrc