Skip to content

Commit

Permalink
Add asset scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
jmblixt3 committed Oct 6, 2024
1 parent 637cf6d commit ae40418
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion scripts/build_image.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

#!/bin/bash
if [ -z "${image_key}"]; then
image_key="ros2_humble.realsense.deepstream.user.zed.umn.gazebo"
fi
Expand Down
32 changes: 32 additions & 0 deletions scripts/download_assests.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit ae40418

Please sign in to comment.