5.7.2 Isaac Sim 仿真导航
⚠️运行环境说明:
Isaac Sim运行在 GPU 服务器,Isaac ROS 运行在部署于 GPU 服务器的 Docker 容器(isaac-ros-dev)。
官方教程:Isaac ROS 官方示例
Isaac ROS Occupancy Grid Localizer 简介
该案例借助 Isaac ROS Occupancy Grid Localizer 实现地图本地化(定位),使用标准 Nav2 进行导航。
Occupancy Grid Localizer 是一个基于已知栅格地图和激光传感器数据来实现 2D 定位的模块,最终输出机器人在地图中的位姿。
Isaac ROS Occupancy Grid Localizer 定位器设计:
该定位器有两个主要节点:
- Occupancy Grid Localizer Node:NVIDIA 提供的占用栅格定位器(将激光雷达数据匹配到地图)
- Laser Scanto FlatScan Node:将平面2D/3D 激光雷达数据转换成 Issac ROS 内部标准格式
仿真流程
准备工作
下载离线资源
登录AI服务器,下载issac-ros-vslam案例配套的资源包:
NGC_ORG="nvidia"
NGC_TEAM="isaac"
PACKAGE_NAME="isaac_ros_occupancy_grid_localizer"
NGC_RESOURCE="isaac_ros_occupancy_grid_localizer_assets"
NGC_FILENAME="quickstart.tar.gz"
MAJOR_VERSION=3
MINOR_VERSION=2
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
安装/编译 Isaac ROS Occupancy Grid Localizer
进入 issac-ros-dev,安装/编译 issac-ros-visual-slam 包。
- 安装预编译包:
sudo apt-get update
sudo apt-get install -y ros-humble-isaac-ros-occupancy-grid-localizer
- 源码编译:
cd ${ISAAC_ROS_WS}/src
git clone -b release-3.2 https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_map_localization.git isaac_ros_map_localization
sudo apt-get update
rosdep update && rosdep install --from-paths ${ISAAC_ROS_WS}/src/isaac_ros_map_localization/isaac_ros_occupancy_grid_localizer --ignore-src -y
cd ${ISAAC_ROS_WS}
colcon build --symlink-install --packages-up-to isaac_ros_occupancy_grid_localizer --base-paths ${ISAAC_ROS_WS}/src/isaac_ros_map_localization/isaac_ros_occupancy_grid_localizer
source install/setup.bash