From ae40418aafdb44b5cf2a1a77810a0b75e846a285 Mon Sep 17 00:00:00 2001 From: Jonathan Blixt Date: Sun, 6 Oct 2024 13:07:17 -0500 Subject: [PATCH] Add asset scripts --- .gitmodules | 3 +++ scripts/build_image.sh | 2 +- scripts/download_assests.sh | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100755 scripts/download_assests.sh diff --git a/.gitmodules b/.gitmodules index d0fd38a2..bb8a820b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -37,9 +37,12 @@ [submodule "src/isaac_ros/isaac_ros_dnn_inference"] path = src/isaac_ros/isaac_ros_dnn_inference url = https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_dnn_inference.git + branch = v3.1.0 [submodule "src/isaac_ros/isaac_ros_compression"] path = src/isaac_ros/isaac_ros_compression url = https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_compression.git + branch = v3.1.0 [submodule "src/isaac_ros/isaac_ros_image_segmentation"] path = src/isaac_ros/isaac_ros_image_segmentation url = https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_image_segmentation.git + branch = v3.1.0 diff --git a/scripts/build_image.sh b/scripts/build_image.sh index 1e67a023..6eadc655 100755 --- a/scripts/build_image.sh +++ b/scripts/build_image.sh @@ -1,4 +1,4 @@ - +#!/bin/bash if [ -z "${image_key}"]; then image_key="ros2_humble.realsense.deepstream.user.zed.umn.gazebo" fi diff --git a/scripts/download_assests.sh b/scripts/download_assests.sh new file mode 100755 index 00000000..1e8e2407 --- /dev/null +++ b/scripts/download_assests.sh @@ -0,0 +1,32 @@ +#!/bin/bash +NGC_ORG="nvidia" +NGC_TEAM="isaac" +PACKAGE_NAME="isaac_ros_unet" +NGC_RESOURCE="isaac_ros_unet_assets" +NGC_FILENAME="quickstart.tar.gz" +MAJOR_VERSION=3 +MINOR_VERSION=1 +VERSION_REQ_URL="https://catalog.ngc.nvidia.com/api/resources/versions?orgName=$NGC_ORG&teamName=$NGC_TEAM&name=$NGC_RESOURCE&isPublic=true&pageNumber=0&pageSize=100&sortOrder=CREATED_DATE_DESC" +AVAILABLE_VERSIONS=$(curl -s \ + -H "Accept: application/json" "$VERSION_REQ_URL") +LATEST_VERSION_ID=$(echo $AVAILABLE_VERSIONS | jq -r " + .recipeVersions[] + | .versionId as \$v + | \$v | select(test(\"^\\\\d+\\\\.\\\\d+\\\\.\\\\d+$\")) + | split(\".\") | {major: .[0]|tonumber, minor: .[1]|tonumber, patch: .[2]|tonumber} + | select(.major == $MAJOR_VERSION and .minor <= $MINOR_VERSION) + | \$v + " | sort -V | tail -n 1 +) +if [ -z "$LATEST_VERSION_ID" ]; then + echo "No corresponding version found for Isaac ROS $MAJOR_VERSION.$MINOR_VERSION" + echo "Found versions:" + echo $AVAILABLE_VERSIONS | jq -r '.recipeVersions[].versionId' +else + mkdir -p ${ISAAC_ROS_WS}/isaac_ros_assets && \ + FILE_REQ_URL="https://api.ngc.nvidia.com/v2/resources/$NGC_ORG/$NGC_TEAM/$NGC_RESOURCE/\ +versions/$LATEST_VERSION_ID/files/$NGC_FILENAME" && \ + curl -LO --request GET "${FILE_REQ_URL}" && \ + tar -xf ${NGC_FILENAME} -C ${ISAAC_ROS_WS}/isaac_ros_assets && \ + rm ${NGC_FILENAME} +fi \ No newline at end of file