diff --git a/atk.env b/atk.env index e9ea91e9..59f6b27b 100644 --- a/atk.env +++ b/atk.env @@ -1,4 +1,4 @@ ROS_DISTRO=humble -DEFAULT_APT_DEPENDENCIES=" bash vim git git-lfs python3-pip" -DEFAULT_PIP_REQUIREMENTS=" setuptools=58.2.0 " +DEFAULT_APT_DEPENDENCIES="bash vim git git-lfs python3-pip" +DEFAULT_PIP_REQUIREMENTS="" diff --git a/atk.yml b/atk.yml index 00d86986..81951255 100644 --- a/atk.yml +++ b/atk.yml @@ -36,7 +36,7 @@ services: USER_UID: "${USER_UID:-1000}" USER_GID: "${USER_GID:-1000}" APT_DEPENDENCIES: "${DEFAULT_APT_DEPENDENCIES:-}" - PIP_REQUIREMENTS: "${DEFAULT_APT_REQUIREMENTS:-}" + PIP_REQUIREMENTS: "${DEFAULT_PIP_REQUIREMENTS:-}" working_dir: "/home/${COMPOSE_PROJECT_NAME}/${COMPOSE_PROJECT_NAME}" volumes: - "./:/home/${COMPOSE_PROJECT_NAME}/${COMPOSE_PROJECT_NAME}" @@ -53,8 +53,8 @@ services: IMAGE_TAG: "22.04" USER_GROUPS: "dialout video" USER_SHELL_ADD_ONS: ". /home/${COMPOSE_PROJECT_NAME}/${COMPOSE_PROJECT_NAME}/workspace/install/setup.bash" - PIP_REQUIREMENTS: "tensorrt" - ROSDEP_METAPACKAGE: "src/common/meta/art_dev_meta/" + PIP_REQUIREMENTS: "${DEFAULT_APT_DEPENDENCIES} tensorrt" + ROSDEP_METAPACKAGE: "art_dev_meta" working_dir: "/home/${COMPOSE_PROJECT_NAME}/${COMPOSE_PROJECT_NAME}/workspace" art5: extends: dev @@ -66,10 +66,11 @@ services: args: IMAGE_BASE: "dustynv/ros" IMAGE_TAG: "humble-pytorch-l4t-r35.3.1" - ROS_INSTALL_PREFIX: /opt/ros/${ROS_DISTRO}/install - APT_DEPENDENCIES: "${DEV_APT_DEPENDENCIES}" - PIP_REQUIREMENTS: "${DEV_PIP_REQUIREMENTS}" - ROSDEP_METAPACKAGE: "src/common/meta/art_art5_meta/" + ROS_INSTALL_PREFIX: "/opt/ros/${ROS_DISTRO}/install" + APT_DEPENDENCIES: "${DEFAULT_APT_DEPENDENCIES}" + PIP_REQUIREMENTS: "${DEFAULT_PIP_REQUIREMENTS}" + ROSDEP_METAPACKAGE: "art_art5_meta" + ROSDEP_SKIP_KEYS: "python3-torchvision tf_transformations" chrono: extends: common image: "atk/${COMPOSE_PROJECT_NAME}:chrono" diff --git a/docker/art5.dockerfile b/docker/art5.dockerfile index 0207e234..3a392f73 100644 --- a/docker/art5.dockerfile +++ b/docker/art5.dockerfile @@ -6,6 +6,7 @@ INCLUDE ./docker/common/base.dockerfile # Snippets +INCLUDE ./docker/snippets/agx.dockerfile INCLUDE ./docker/snippets/rosdep.dockerfile # Will copy in other common configurations for this build diff --git a/docker/snippets/agx.dockerfile b/docker/snippets/agx.dockerfile new file mode 100644 index 00000000..8bac454c --- /dev/null +++ b/docker/snippets/agx.dockerfile @@ -0,0 +1,9 @@ +# syntax = devthefuture/dockerfile-x +# SPDX-License-Identifier: MIT +# This snippet helps with setup on agx specific systems + +# Add Isaac apt repositories +# Without this, humble packages on focal (the default ubuntu version for AGX) can't be found +RUN wget -qO - https://isaac.download.nvidia.com/isaac-ros/repos.key | apt-key add - && \ + grep -qxF 'deb https://isaac.download.nvidia.com/isaac-ros/ubuntu/main focal main' /etc/apt/sources.list || \ + echo 'deb https://isaac.download.nvidia.com/isaac-ros/ubuntu/main focal main' | tee -a /etc/apt/sources.list diff --git a/docker/snippets/rosdep.dockerfile b/docker/snippets/rosdep.dockerfile index b3539fd7..7149c922 100644 --- a/docker/snippets/rosdep.dockerfile +++ b/docker/snippets/rosdep.dockerfile @@ -12,16 +12,29 @@ RUN apt-get update && \ ARG ROS_DISTRO ARG ROS_WORKSPACE="./workspace" ARG ROSDEP_METAPACKAGE="" +ARG ROSDEP_OS_NAME="ubuntu" +ARG ROSDEP_OS_VERSION="jammy" +ARG ROSDEP_SKIP_KEYS="" ARG ROS_INSTALL_PREFIX="/opt/ros/${ROS_DISTRO}/" COPY ${ROS_WORKSPACE}/src /tmp/workspace/src RUN . ${ROS_INSTALL_PREFIX}/setup.sh && \ cd /tmp/workspace && \ apt-get update && \ - if [ -z "$ROSDEP_METAPACKAGE" ]; then \ + if [ -z "${ROSDEP_METAPACKAGE}" ]; then \ ROSDEP_FROM_PATHS="src"; \ else \ - ROSDEP_FROM_PATHS=$(colcon list --packages-up-to art_dev_meta | awk '{print $2}' | tr '\n' ' '); \ + ROSDEP_FROM_PATHS=$(colcon list --packages-up-to ${ROSDEP_METAPACKAGE} | awk '{print $2}' | tr '\n' ' '); \ fi && \ - rosdep install --from-paths $ROSDEP_FROM_PATHS --ignore-src -r -y && \ + rosdep install --from-paths ${ROSDEP_FROM_PATHS} --ignore-src -r -y --skip-keys="${ROSDEP_SKIP_KEYS}" --os=${ROSDEP_OS_NAME}:${ROSDEP_OS_VERSION} --rosdistro=${ROS_DISTRO} && \ rm -rf /tmp/workspace && \ apt-get clean && apt-get autoremove -y && rm -rf /var/lib/apt/lists/* + +# Avoid setup.py and easy_install deprecation warnings caused by colcon and setuptools +# https://github.com/colcon/colcon-core/issues/454 +ENV PYTHONWARNINGS=ignore:::setuptools.command.install,ignore:::setuptools.command.easy_install,ignore:::pkg_resources +RUN echo "Warning: Using the PYTHONWARNINGS environment variable to silence setup.py and easy_install deprecation warnings caused by colcon" + +# Fix permissions since we installed everything as root +USER ${USER} +RUN rosdep fix-permissions +USER root diff --git a/docs/design/dockerfiles.md b/docs/design/dockerfiles.md index 4b7bb9d0..216d2df7 100644 --- a/docs/design/dockerfiles.md +++ b/docs/design/dockerfiles.md @@ -170,6 +170,12 @@ the ROS workspace to run `rosdep` on. **ROSDEP_METAPACKAGE** _(Default: `""`)_: If provided, `colcon list --packages-up-to $ROSDEP_METAPACKAGE` will be run to determine the paths to run `rosdep` on (i.e. passed to `--from-paths`). If not provided, `--from-paths src` will be used. +**ROSDEP_OS_NAME** _(Default: `"ubuntu"`)_: This is passed (together with `ROSDEP_OS_VERSION`) to `rosdep` at build time. On systems where it is required to build a ros distribution from source (e.g. Humble on AGX), we need to tell `rosdep` explicitly to use the os version which corresponds to the ROS build. The `--os` is passed as follows: `--os ${ROSDEP_OS_NAME}:${ROSDEP_OS_VERSION}`. + +**ROSDEP_OS_VERSION** _(Default: `"jammy"`)_: This is passed (together with `ROSDEP_OS_NAME`) to `rosdep` at build time. On systems where it is required to build a ros distribution from source (e.g. Humble on AGX), we need to tell `rosdep` explicitly to use the os version which corresponds to the ROS build. The `--os` is passed as follows: `--os ${ROSDEP_OS_NAME}:${ROSDEP_OS_VERSION}`. + +**ROSDEP_SKIP_KEYS** _(Default: `""`)_: The keys to ignore when attempting to run `rosdep`. Some packages may require being built from source and/or are not available through rosdep, so although we still want to specify them as dependencies in the package, we'll ignore them in the build. This is passed to `rosdep` as follows: `rosdep ... --skip-keys "${ROSDEP_SKIP_KEYS}"`. + **ROS_INSTALL_PREFIX** _(Default: `/opt/ros/${ROS_DISTRO}`)_: The install prefix that ROS is installed to. This should be the folder location of the `setup.bash` file. By default, if installed through `apt` it will be `/opt/ros/${ROS_DISTRO}`. If it's pre-installed for tegra images, it's at `/opt/ros/${ROS_DISTRO}/install`. ## `docker/chrono.dockerfile` diff --git a/docs/design/ros_workspace.md b/docs/design/ros_workspace.md index a8d3b21c..51d3fa3a 100644 --- a/docs/design/ros_workspace.md +++ b/docs/design/ros_workspace.md @@ -169,6 +169,8 @@ $ paths=$(colcon list --packages-up-to art_dev_meta | awk '{print $2}' | tr '\n' In the command above, the `colcon list --packages-up-to art_dev_meta` part simply searches through the metapackage and then lists out the paths to those packages. The rest will just postprocesses the paths to fit in the `rosdep` command on the next line. +You may need to specify `--os=${OS_NAME}:${OS_VERSION}` (e.g. `--os=ubuntu:jammy`) to get `rosdep` to read the right packages. You may also want to pass `-r` to ignore packages that `rosdep` can't find and/or use `--skip-keys` to ignore packages that don't exist (like in some thirdparty packages). Please run `rosdep -h` to read more about the options. + ### Finding `` Packages The `` tag is used by both `rosdep` and `colcon` to determine which packages to install/build. Therefore, it's important to know how to find the packages that should be listed in the `` tag. diff --git a/docs/misc/vehicle_computers.md b/docs/misc/vehicle_computers.md index 28ea7cc0..b7b7e496 100644 --- a/docs/misc/vehicle_computers.md +++ b/docs/misc/vehicle_computers.md @@ -30,7 +30,7 @@ This section outlines the general setup for each vehicle computer. Each vehicle A setup script was written to automate the setup process. To run the script, run the following command: ```bash -wget -O - https://raw.githubusercontent.com/uwsbel/autonomy-research-testbed/tree/master/vehicles/setup.sh | bash +wget -O - https://raw.githubusercontent.com/uwsbel/autonomy-research-testbed/master/vehicles/setup.sh | bash ``` diff --git a/vehicles/setup.sh b/vehicles/setup.sh index 5c046568..cf0c05c9 100755 --- a/vehicles/setup.sh +++ b/vehicles/setup.sh @@ -88,7 +88,7 @@ rm -rf ~/.conda/miniconda.sh echo "Cloning autonomy-research-testbed." -git clone https://github.com/uwsbel/autonomy-research-testbed.git ~/sbel/autonomy-research-testbed +git clone https://github.com/uwsbel/autonomy-research-testbed.git ~/sbel/autonomy-research-testbed --recursive echo "source ~/sbel/autonomy-research-testbed/vehicles/bashrc" >> ~/.bashrc