windows下安装 isaac sim gym (OmniIsaacGymEnvs)

本文介绍了NVIDIAIsaacSim机器人仿真工具包与OpenAIGym在强化学习中的应用,包括IsaacSim的特性如物理仿真和数据生成,以及如何在IsaacSim中安装和使用Gym进行实验,特别关注了在不同系统环境下遇到的安装问题和解决方案。

一、介绍 

Isaac Sim是NVIDIA Omniverse平台的一款机器人仿真工具包,它具备构建虚拟机器人世界和进行实验的关键功能。该工具包为研究人员和从业者提供了所需的工具和工作流程,以创建健壮、物理精确的模拟和合成数据集。Isaac Sim通过ROS/ROS2支持导航和操控应用,可以模拟来自RGB-D、激光雷达和IMU等传感器的数据,这些数据可用于多种计算机视觉技术,如领域随机化、真值标签、分割和边界框等。

此外,Isaac Sim还整合了最新的PhysX和RTX引擎进行物理仿真和图像仿真,并引入了Pixar公司开发的usd(Universal Scene Description)描述格式,以支持机器人和复杂场景的描述。在特定版本,如2022.2版本中,Isaac Sim针对仓库物流、制造业机械手、车队路线等场景进行了优化,添加了新的功能如仓库建造工具、传送带工具以及人员模拟器等,以更好地满足各种实际应用需求。

强化学习Gym是一个用于进行强化学习实验的开源库,为强化学习算法的实验验证和测试提供了一个简单方便的实验平台。

Gym库包含多种环境,如算法环境、简单文本环境、经典控制环境、Atari游戏环境、MuJoCo环境和机械控制环境等,涵盖了算法研究和开发、机器人控制、生物力学、图形和动画等多个领域。它内置了多种仿真游戏,如出租车游戏、悬崖游戏等,这些游戏所用的网格、规则、奖励各不相同,非常适合为强化学习做测试。

在Gym中,每一个环境都有一个对应的函数接口,比如“reset”、“step”等,这些接口使得与环境进行交互更为便捷。此外,Gym还提供页面渲染功能,可以可视化地查看效果。

总的来说,Gym是一个强大的工具,可以帮助研究人员和从业者更好地进行强化学习实验和

研究。如需更多关于Gym的信息,可以查阅其官方文档或相关教程。

那如何在Isaac sim里面安装 gym来开展强化学习仿真训练呢?

一个方案是使用 Isaac Gym Preview 4 环境构建 + IsaacGymEnvs

Isaac Gym - Preview Release | NVIDIA Developericon-default.png?t=N7T8https://developer.nvidia.com/isaac-gym

但是很遗憾目前Isaac Gym Preview 4只支持 Ubuntu 系统,然而我并不想在WLS中运行,或者虚拟机里面,或者还要装个双系统。那怎么办呢?

突然发现一个NVIDIA-Omniverse 下面有一个 OmniIsaacGymEnvs,Omniverse Isaac Gym Reinforcement Learning Environments for Isaac Sim,这个似乎是直接用于 Isaac sim的 Omniverse Isaac Gym,安装要求没提系统,是可以在最新的 Isaac Sim里运行。

This repository contains Reinforcement Learning examples that can be run with the latest release of Isaac Sim. RL examples are trained using PPO from rl_games library and examples are built on top of Isaac Sim's omni.isaac.core and omni.isaac.gym frameworks.

 OmniIsaacGymEnvsicon-default.png?t=N7T8https://github.com/NVIDIA-Omniverse/OmniIsaacGymEnvs

下载到本地:

git clone https://github.com/NVIDIA-Omniverse/OmniIsaacGymEnvs.git

二、安装

找到 isaac sim的python脚本文件所在目录,如笔者的在:

D:\omniverse\pkg\isaac_sim-2023.1.1\python.bat

命令行切到OmniIsaacGymEnvs下载目录,用该脚本执行安装命令:  

D:\omniverse\pkg\isaac_sim-2023.1.1\python.bat -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -e .

注意 usd-core 版本

nvidia-srl-usd 0.13.0 requires usd-core<24.00,>=21.11, which is not installed.

usd-core 安装:

D:\omniverse\pkg\isaac_sim-2023.1.1\python.bat -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple usd-core==23.11

三、运行demo

 Note: All commands should be executed from OmniIsaacGymEnvs/omniisaacgymenvs

cd omniisaacgymenvs
D:\omniverse\pkg\isaac_sim-2023.1.1\python.bat scripts/rlgames_train.py task=Cartpole

四、问题

遇到问题可以查看日志,日志目录运行时会给出

 运行时出现错误,查看日志,是下载不了 相关 usd 资源

2024-03-26 02:13:31 [199,655ms] [Info] [omni.isaac.core.physics_context.physics_context] Defining a new Physics Scene at path `/physicsScene`

2024-03-26 02:13:31 [199,869ms] [Info] [omni.isaac.core.utils.nucleus] Check /persistent/isaac/asset_root/default setting

2024-03-26 02:13:31 [199,869ms] [Info] [omni.isaac.core.utils.nucleus] Checking path: http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac

2024-03-26 02:13:31 [199,875ms] [Info] [omni.client.plugin]  Main: provider_http: Successfully created S3 provider for https://omniverse-content-production.s3-us-west-2.amazonaws.com

2024-03-26 02:13:33 [202,496ms] [Info] [omni.client.plugin]  Tick: provider_http: Using CloudFront http://dcb18d6mfegct.cloudfront.net/, List = No

2024-03-26 02:13:34 [202,804ms] [Info] [omni.isaac.core.utils.nucleus] Success: http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac

2024-03-26 02:13:34 [202,804ms] [Info] [omni.isaac.core.utils.nucleus] Checking path: http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/NVIDIA

2024-03-26 02:13:34 [202,804ms] [Info] [omni.isaac.core.utils.nucleus] Success: http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/NVIDIA

2024-03-26 02:13:34 [202,804ms] [Info] [omni.isaac.core.utils.nucleus] Assets root found at http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1

2024-03-26 02:13:34 [202,805ms] [Info] [omni.isaac.core.utils.stage] Loading Asset from path http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Robots/Cartpole/cartpole.usd

2024-03-26 02:13:36 [205,050ms] [Info] [omni.client.plugin]  HTTP Client: http: libcurl error (56): Failure when receiving data from the peer for http://dcb18d6mfegct.cloudfront.net/Assets/Isaac/2023.1.1/Isaac/Robots/Cartpole/cartpole.usd

2024-03-26 02:13:58 [227,372ms] [Info] [omni.client.plugin]  HTTP Client: http: libcurl error (56): Failure when receiving data from the peer for http://dcb18d6mfegct.cloudfront.net/Assets/Isaac/2023.1.1/Isaac/Robots/Cartpole/cartpole.usd

2024-03-26 02:14:41 [270,181ms] [Info] [omni.client.plugin]  HTTP Client: http: libcurl error (56): Failure when receiving data from the peer for http://dcb18d6mfegct.cloudfront.net/Assets/Isaac/2023.1.1/Isaac/Robots/Cartpole/cartpole.usd

2024-03-26 02:15:33 [322,194ms] [Info] [omni.client.plugin]  HTTP Client: http: libcurl error (56): Failure when receiving data from the peer for http://dcb18d6mfegct.cloudfront.net/Assets/Isaac/2023.1.1/Isaac/Robots/Cartpole/cartpole.usd

2024-03-26 02:16:34 [383,297ms] [Info] [omni.client.plugin]  HTTP Client: http: libcurl error (28): Timeout was reached for http://dcb18d6mfegct.cloudfront.net/Assets/Isaac/2023.1.1/Isaac/Robots/Cartpole/cartpole.usd

2024-03-26 02:17:36 [445,397ms] [Info] [omni.client.plugin]  HTTP Client: http: libcurl error (28): Timeout was reached for http://dcb18d6mfegct.cloudfront.net/Assets/Isaac/2023.1.1/Isaac/Robots/Cartpole/cartpole.usd

2024-03-26 02:18:41 [509,519ms] [Info] [omni.client.plugin]  HTTP Client: http: libcurl error (28): Timeout was reached for http://dcb18d6mfegct.cloudfront.net/Assets/Isaac/2023.1.1/Isaac/Robots/Cartpole/cartpole.usd

2024-03-26 02:19:48 [576,621ms] [Info] [omni.client.plugin]  HTTP Client: http: libcurl error (28): Timeout was reached for http://dcb18d6mfegct.cloudfront.net/Assets/Isaac/2023.1.1/Isaac/Robots/Cartpole/cartpole.usd

2024-03-26 02:20:39 [628,442ms] [Info] [omni.client.plugin]  HTTP Client: http: libcurl error (56): Failure when receiving data from the peer for http://dcb18d6mfegct.cloudfront.net/Assets/Isaac/2023.1.1/Isaac/Robots/Cartpole/cartpole.usd

2024-03-26 02:20:39 [628,442ms] [Info] [omni.client.plugin]  Tick: provider_http: Read failed! Error: Connection. URI='http://dcb18d6mfegct.cloudfront.net/Assets/Isaac/2023.1.1/Isaac/Robots/Cartpole/cartpole.usd': Unable to connect to server! Likely indicates a client side networking error or problem with Omniverse Cache!

2024-03-26 02:20:39 [628,446ms] [Warning] [omni.usd] Warning: in _ReportErrors at line 2890 of W:\ac88d7d902b57417\USD\pxr\usd\usd\stage.cpp -- In </World/envs/env_0/Cartpole>: Could not open asset @http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Robots/Cartpole/cartpole.usd@ for reference introduced by @anon:000001DB8E79D720:World1.usd@</World/envs/env_0/Cartpole>. (recomposing stage on stage @anon:000001DB8E79D720:World1.usd@ <000001DB933CE610>)

猜测是 urllib的问题

HTTP Client: http: libcurl error 

一个简单办法,是把资源下载下来使用,看代码:

打开  cartpole.py,替换掉里面的 _usd_path 为下载好的本地 usd 文件,再次运行就成功了,看512个agent在同时训练

后来发现一个更简单的办法,那就是换个网络就好了,服了,明明之前那个网络 也是能访问这个网站的呀.....

omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac 
 

### 在 Windows 11 系统中安装 NVIDIA Isaac Sim 的方法 #### 系统兼容性检查 在开始安装之前,需确认 Windows 11 是否满足 NVIDIA Isaac Sim 的最低系统要求。通常情况下,Isaac Sim 更适合运行于 Linux 平台(如 Ubuntu),但在 Windows 环境下可以通过 WSL2 (Windows Subsystem for Linux 2) 来实现容器化部署[^1]。 以下是具体的系统需求: - **操作系统**: 支持的 Windows 版本应为 Windows 10 或更高版本,并启用 WSL2 功能。 - **硬件支持**: GPU 需要支持 CUDA 技术,建议使用最新的 NVIDIA 显卡驱动程序并确保其与当前系统的 CUDA 工具包匹配。 - **内存和存储空间**: 至少需要 8GB RAM 和足够的磁盘空间来下载镜像文件及相关依赖库。 #### 安装步骤概述 为了成功设置 NVIDIA Isaac Sim,在 Windows 11 中主要分为以下几个方面: 1. **WSL2 设置** 启用 WSL2 是第一步也是最关键的一步。通过 PowerShell 命令行工具执行以下操作以激活此功能: ```powershell wsl --install -d ubuntu ``` 此命令会自动完成 Ubuntu 发行版的安装以及切换到 WSL2 模式的工作。 2. **NVIDIA 驱动更新** 下载最新版本的 NVIDIA Display Drivers 及对应的操作手册文档链接地址可访问官网获取更多信息。对于基于 RTX 系列显卡用户来说特别重要的是保证驱动已开启对 DirectML API 接口的支持以便更好地适配后续软件栈构建工作流程的需求。 3. **Docker Desktop with GPU Support** 安装 Docker Desktop 应用程序并将选项调整至允许利用本地物理设备作为计算资源的一部分来进行加速处理任务;同时还需要额外加载名为 `nvidia-container-toolkit` 插件组件从而让容器内部可以直接调用外部图形处理器单元的能力。 4. **拉取 Isaac Sim 容器** 使用如下指令从官方仓库克隆目标映像副本下来准备启动实例服务端口监听等工作事项安排好之后就可以正式进入下一步骤环节当中去了: ```bash docker pull nvcr.io/nvidia/isaac-sim:<version> ``` 5. **验证环境搭建成果** 创建一个新的终端窗口连接到刚才创建好的 session 当前目录路径之下尝试运行简单的 python 脚本来检验整个框架是否正常运作无误为止结束全部流程即可. ```python import carb print(carb.settings.get_settings().get("/app/version")) ``` 以上即是在 Windows 11 上面针对 NVIDIA Isaac Sim 执行完整的前期准备工作指导方案说明内容总结完毕!
评论 4
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值