Skip to content

Commit

Permalink
pull latest master into art-oak (#88)
Browse files Browse the repository at this point in the history
* fix (#76)

* Update vehicle_computers.md (#78)

#77 fix

* 81/bug/rosdep-dockerfile-fix (#82)

* Fix small bug in rosdep dockerfile related to hardcoded art_dev_meta line.

* Fix #2

* Added recursive flag to clone in script

* Many fixes for agx systems (#84)

* Many fixes for agx systems

* Small fixes

---------

Co-authored-by: harryzhang1018 <[email protected]>
Co-authored-by: Aaron Young <[email protected]>
  • Loading branch information
3 people authored Nov 13, 2023
1 parent 53ab694 commit 7d33467
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 14 deletions.
4 changes: 2 additions & 2 deletions atk.env
Original file line number Diff line number Diff line change
@@ -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=""
15 changes: 8 additions & 7 deletions atk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -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
Expand All @@ -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"
Expand Down
1 change: 1 addition & 0 deletions docker/art5.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions docker/snippets/agx.dockerfile
Original file line number Diff line number Diff line change
@@ -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
19 changes: 16 additions & 3 deletions docker/snippets/rosdep.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 6 additions & 0 deletions docs/design/dockerfiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
2 changes: 2 additions & 0 deletions docs/design/ros_workspace.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<exec_depend>` Packages

The `<exec_depend>` 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 `<exec_depend>` tag.
Expand Down
2 changes: 1 addition & 1 deletion docs/misc/vehicle_computers.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

```

Expand Down
2 changes: 1 addition & 1 deletion vehicles/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 7d33467

Please sign in to comment.