首页 最新 热门 推荐

  • 首页
  • 最新
  • 热门
  • 推荐

【机器人】01 强化学习、模仿学习和运动规划 仿真平台ISAAC Lab安装与使用

  • 25-02-18 21:00
  • 2850
  • 7953
blog.csdn.net

ISAAC Lab 是 NVIDIA 提供的一个 GPU 加速的开源框架,专为简化机器人研究工作流程而设计,特别是在强化学习、模仿学习和运动规划等领域。

它基于 NVIDIA 的 ISAAC Sim 构建,结合了高精度的物理和传感器仿真,成为了从仿真到现实应用的理想选择。

本文会分享ISAAC Lab的安装和使用,通过conda和pip进行安装的,适用于windows系统,带大家规避一些坑。

目录

1、认识ISAAC Lab

2、安装ISAAC Sim

3、简单测试ISAAC Sim

4、安装ISAAC Lab

5、测试ISAAC Lab是否安装成功

6、案例:生成不同的四足机器人


1、认识ISAAC Lab

ISAAC Lab 提供了一套比较全面的工具和环境,包含了各种机器人模型、训练环境、物理仿真和传感器仿真。

  • 机器人模型 Isaac Lab 提供 16 种常用的机器人模型,包括机械手、四足动物和类人机器人,满足不同的研究需求。
  • 训练环境 提供 30 多个即用型训练环境,支持使用 RSL RL、SKRL、RL Games 和 Stable Baselines 等流行的强化学习框架进行训练,同时支持多智能体强化学习。
  • 物理仿真 支持刚体、铰接系统和可变形物体的仿真,确保机器人在与环境互动时具有真实的物理表现。
  • 传感器仿真 提供多种传感器仿真,包括 RGB 摄像头、深度摄像头、IMU、接触传感器等,帮助机器人更好地感知环境。  

代码开源地址:https://github.com/isaac-sim/IsaacLab

官方指导文档:https://isaac-sim.github.io/IsaacLab/main/source/setup/ecosystem.html

目前已经支持超过16 个机器人,如上图所示。

  • 经典机器人:Cartpole, 类人生物, 蚂蚁

  • 机械臂:UR10、Franka、Allegro、Shadow Hand

  • 四足动物: Anybotics Anymal-B, Anymal-C, Anymal-D, Unitree A1, Unitree Go1, Unitree Go2, Boston Dynamics Spot

  • 人形机器人:Unitree H1、Unitree G1

  • 四轴飞行器:Crazyflie

添加其他机器人,参考这里

2、安装ISAAC Sim

ISAAC Lab是基于NVIDIA的ISAAC Sim构建的,需要先安装Isaac Sim。

2.1、首先创建conda环境

conda create -n isaaclab python=3.10

2.2、进入isaaclab环境

conda activate isaaclab

2.3、接着安装torch 2.4.0

pip install torch==2.4.0 --index-url https://download.pytorch.org/whl/cu118

安装好后,可以检测一下能否正常导入,在终端输入python,,再输入import torch

问题:正常是会报错的:OSError:................... fbgemm.dll

分析:这是由于torch 2.4.0需要依赖fbgemm.dll库,但本地电脑没有就会报错了

解决方案:下载libomp140.x86_64.dll,然后放到C:\Windows\System32中

libomp140.x86_64.dll 下载地址

2.4、安装numpy 1.26.4

pip install numpy==1.26.4 -i https://pypi.tuna.tsinghua.edu.cn/simple

这时再检测能否正常导入torch,import torch,正常是没问题了。

2.5、更新一下pip

pip install --upgrade pip

2.6、开始安装Isaac Sim

pip install isaacsim==4.2.0.2 -i https://pypi.tuna.tsinghua.edu.cn/simple

这里我没有参考官网的,因为官方使用pypi.nvidia.com,太慢了;用清华源更快~

再安装一些依赖包

pip install isaacsim-rl isaacsim-replicator isaacsim-extscache-physics isaacsim-extscache-kit-sdk isaacsim-extscache-kit isaacsim-app -i https://pypi.tuna.tsinghua.edu.cn/simple

3、简单测试ISAAC Sim

输入下面命令,会打开一个黑色窗口的

isaacsim

首次运行 ISAAC Sim 时,将从注册表中提取所有依赖的扩展。 此过程可能需要 10 分钟以上,太慢了。  

首次运行将提示用户接受 Nvidia Omniverse 许可协议,需要输入yes

  1. By installing or using Isaac Sim, I agree to the terms of NVIDIA OMNIVERSE LICENSE AGREEMENT (EULA)
  2. in https://docs.omniverse.nvidia.com/isaacsim/latest/common/NVIDIA_Omniverse_License_Agreement.html
  3. Do you accept the EULA? (Yes/No): yes

 看到打印下面信息:

还有显卡的情况

经过漫长的等待,终于看到kit Mini这个窗口啦

4、安装ISAAC Lab

下载ISAAC Lab的代码

git clone https://github.com/isaac-sim/IsaacLab.git

然后进入IsaacLab-main目录中,能看到 isaaclab.bat文件(后续经常使用这个文件的)

默认isaaclab.bat中安装东西时太慢了,下面是我修改了源码的,下载和安装东西时更快

可以参考使用,也可以用官方默认的

  1. @echo off
  2. setlocal EnableExtensions EnableDelayedExpansion
  3. rem Copyright (c) 2022-2024, The Isaac Lab Project Developers.
  4. rem All rights reserved.
  5. rem
  6. rem SPDX-License-Identifier: BSD-3-Clause
  7. rem Configurations
  8. set "ISAACLAB_PATH=%~dp0"
  9. goto main
  10. rem Helper functions
  11. rem extract Isaac Sim directory
  12. :extract_isaacsim_path
  13. rem Use the sym-link path to Isaac Sim directory
  14. set isaac_path=%ISAACLAB_PATH%\_isaac_sim
  15. rem Check if directory exists
  16. if not exist "%isaac_path%" (
  17. rem Find the Python executable
  18. call :extract_python_exe
  19. rem retrieve the isaacsim path from the installed package
  20. set "isaac_path="
  21. for /f "delims=" %%i in ('!python_exe! -c "import isaacsim; import os; print(os.environ['ISAAC_PATH'])"') do (
  22. if not defined isaac_path (
  23. set "isaac_path=%%i"
  24. )
  25. )
  26. )
  27. rem Check if the directory exists
  28. if not exist "%isaac_path%" (
  29. echo [ERROR] Unable to find the Isaac Sim directory: %isaac_path%
  30. echo %tab%This could be due to the following reasons:
  31. echo %tab%1. Conda environment with Isaac Sim pip package is not activated.
  32. echo %tab%2. Isaac Sim directory is not available at the default path: %ISAACLAB_PATH%\_isaac_sim
  33. exit /b 1
  34. )
  35. goto :eof
  36. rem extract the python from isaacsim
  37. :extract_python_exe
  38. rem check if using conda
  39. if not "%CONDA_PREFIX%"=="" (
  40. rem use conda python
  41. set python_exe=%CONDA_PREFIX%\python.exe
  42. ) else (
  43. rem use kit python
  44. set python_exe=%ISAACLAB_PATH%\_isaac_sim\python.bat
  45. )
  46. rem check for if isaac sim was installed to system python
  47. if not exist "%python_exe%" (
  48. set "python_exe="
  49. python -m pip show isaacsim-rl > nul 2>&1
  50. if %ERRORLEVEL% equ 0 (
  51. for /f "delims=" %%i in ('where python') do (
  52. if not defined python_exe (
  53. set "python_exe=%%i"
  54. )
  55. )
  56. )
  57. )
  58. if not exist "%python_exe%" (
  59. echo [ERROR] Unable to find any Python executable at path: %python_exe%
  60. echo %tab%This could be due to the following reasons:
  61. echo %tab%1. Conda environment is not activated.
  62. echo %tab%2. Python executable is not available at the default path: %ISAACLAB_PATH%\_isaac_sim\python.bat
  63. exit /b 1
  64. )
  65. goto :eof
  66. rem extract the simulator exe from isaacsim
  67. :extract_isaacsim_exe
  68. call :extract_python_exe
  69. call !python_exe! -m pip show isaacsim-rl > nul 2>&1
  70. if errorlevel 1 (
  71. rem obtain isaacsim path
  72. call :extract_isaacsim_path
  73. rem python executable to use
  74. set isaacsim_exe=!isaac_path!\isaac-sim.bat
  75. ) else (
  76. rem if isaac sim installed from pip
  77. set isaacsim_exe=isaacsim omni.isaac.sim
  78. )
  79. rem check if there is a python path available
  80. if not exist "%isaacsim_exe%" (
  81. echo [ERROR] No isaac-sim executable found at path: %isaacsim_exe%
  82. exit /b 1
  83. )
  84. goto :eof
  85. rem check if input directory is a python extension and install the module
  86. :install_isaaclab_extension
  87. echo %ext_folder%
  88. rem retrieve the python executable
  89. call :extract_python_exe
  90. rem if the directory contains setup.py then install the python module
  91. if exist "%ext_folder%\setup.py" (
  92. echo module: %ext_folder%
  93. call !python_exe! -m pip install --editable %ext_folder% -i https://pypi.tuna.tsinghua.edu.cn/simple
  94. )
  95. goto :eof
  96. rem setup anaconda environment for Isaac Lab
  97. :setup_conda_env
  98. rem get environment name from input
  99. set env_name=%conda_env_name%
  100. rem check if conda is installed
  101. where conda >nul 2>nul
  102. if errorlevel 1 (
  103. echo [ERROR] Conda could not be found. Please install conda and try again.
  104. exit /b 1
  105. )
  106. rem check if the environment exists
  107. call conda env list | findstr /c:"%env_name%" >nul
  108. if %errorlevel% equ 0 (
  109. echo [INFO] Conda environment named '%env_name%' already exists.
  110. ) else (
  111. echo [INFO] Creating conda environment named '%env_name%'...
  112. call conda create -y --name %env_name% python=3.10
  113. )
  114. rem cache current paths for later
  115. set "cache_pythonpath=%PYTHONPATH%"
  116. set "cache_ld_library_path=%LD_LIBRARY_PATH%"
  117. rem clear any existing files
  118. echo %CONDA_PREFIX%
  119. del "%CONDA_PREFIX%\etc\conda\activate.d\setenv.bat" 2>nul
  120. del "%CONDA_PREFIX%\etc\conda\deactivate.d\unsetenv.bat" 2>nul
  121. rem activate the environment
  122. call conda activate %env_name%
  123. rem setup directories to load isaac-sim variables
  124. mkdir "%CONDA_PREFIX%\etc\conda\activate.d" 2>nul
  125. mkdir "%CONDA_PREFIX%\etc\conda\deactivate.d" 2>nul
  126. rem obtain isaacsim path
  127. call :extract_isaacsim_path
  128. if exist "%isaac_path%" (
  129. rem add variables to environment during activation
  130. (
  131. echo @echo off
  132. echo rem for isaac-sim
  133. echo set "RESOURCE_NAME=IsaacSim"
  134. echo set CARB_APP_PATH=!isaac_path!\kit
  135. echo set EXP_PATH=!isaac_path!\apps
  136. echo set ISAAC_PATH=!isaac_path!
  137. echo set PYTHONPATH=%PYTHONPATH%;!isaac_path!\site
  138. echo.
  139. echo rem for isaac-lab
  140. echo doskey isaaclab=isaaclab.bat $*
  141. ) > "%CONDA_PREFIX%\etc\conda\activate.d\env_vars.bat"
  142. (
  143. echo $env:CARB_APP_PATH="!isaac_path!\kit"
  144. echo $env:EXP_PATH="!isaac_path!\apps"
  145. echo $env:ISAAC_PATH="!isaac_path!"
  146. echo $env:PYTHONPATH="%PYTHONPATH%;!isaac_path!\site"
  147. echo $env:RESOURCE_NAME="IsaacSim"
  148. ) > "%CONDA_PREFIX%\etc\conda\activate.d\env_vars.ps1"
  149. ) else (
  150. rem assume isaac sim will be installed from pip
  151. rem add variables to environment during activation
  152. (
  153. echo @echo off
  154. echo rem for isaac-sim
  155. echo set "RESOURCE_NAME=IsaacSim"
  156. echo.
  157. echo rem for isaac-lab
  158. echo doskey isaaclab=isaaclab.bat $*
  159. ) > "%CONDA_PREFIX%\etc\conda\activate.d\env_vars.bat"
  160. (
  161. echo $env:RESOURCE_NAME="IsaacSim"
  162. ) > "%CONDA_PREFIX%\etc\conda\activate.d\env_vars.ps1"
  163. )
  164. rem reactivate the environment to load the variables
  165. call conda activate %env_name%
  166. rem remove variables from environment during deactivation
  167. (
  168. echo @echo off
  169. echo rem for isaac-sim
  170. echo set "CARB_APP_PATH="
  171. echo set "EXP_PATH="
  172. echo set "ISAAC_PATH="
  173. echo set "RESOURCE_NAME="
  174. echo.
  175. echo rem for isaac-lab
  176. echo doskey isaaclab =
  177. echo.
  178. echo rem restore paths
  179. echo set "PYTHONPATH=%cache_pythonpath%"
  180. echo set "LD_LIBRARY_PATH=%cache_ld_library_path%"
  181. ) > "%CONDA_PREFIX%\etc\conda\deactivate.d\unsetenv_vars.bat"
  182. (
  183. echo $env:RESOURCE_NAME=""
  184. echo $env:PYTHONPATH="%cache_pythonpath%"
  185. echo $env:LD_LIBRARY_PATH="%cache_pythonpath%"
  186. ) > "%CONDA_PREFIX%\etc\conda\deactivate.d\unsetenv_vars.ps1"
  187. rem install some extra dependencies
  188. echo [INFO] Installing extra dependencies (this might take a few minutes)...
  189. call conda install -c conda-forge -y importlib_metadata >nul 2>&1
  190. rem deactivate the environment
  191. call conda deactivate
  192. rem add information to the user about alias
  193. echo [INFO] Added 'isaaclab' alias to conda environment for 'isaaclab.bat' script.
  194. echo [INFO] Created conda environment named '%env_name%'.
  195. echo.
  196. echo 1. To activate the environment, run: conda activate %env_name%
  197. echo 2. To install Isaac Lab extensions, run: isaaclab -i
  198. echo 3. To perform formatting, run: isaaclab -f
  199. echo 4. To deactivate the environment, run: conda deactivate
  200. echo.
  201. goto :eof
  202. rem Update the vscode settings from template and Isaac Sim settings
  203. :update_vscode_settings
  204. echo [INFO] Setting up vscode settings...
  205. rem Retrieve the python executable
  206. call :extract_python_exe
  207. rem Path to setup_vscode.py
  208. set "setup_vscode_script=%ISAACLAB_PATH%\.vscode\tools\setup_vscode.py"
  209. rem Check if the file exists before attempting to run it
  210. if exist "%setup_vscode_script%" (
  211. call !python_exe! "%setup_vscode_script%"
  212. ) else (
  213. echo [WARNING] setup_vscode.py not found. Aborting vscode settings setup.
  214. )
  215. goto :eof
  216. rem Print the usage description
  217. :print_help
  218. echo.
  219. echo usage: %~nx0 [-h] [-i] [-f] [-p] [-s] [-v] [-d] [-c] -- Utility to manage extensions in Isaac Lab.
  220. echo.
  221. echo optional arguments:
  222. echo -h, --help Display the help content.
  223. echo -i, --install [LIB] Install the extensions inside Isaac Lab and learning frameworks as extra dependencies. Default is 'all'.
  224. echo -f, --format Run pre-commit to format the code and check lints.
  225. echo -p, --python Run the python executable (python.bat) provided by Isaac Sim.
  226. echo -s, --sim Run the simulator executable (isaac-sim.bat) provided by Isaac Sim.
  227. echo -t, --test Run all python unittest tests.
  228. echo -v, --vscode Generate the VSCode settings file from template.
  229. echo -d, --docs Build the documentation from source using sphinx.
  230. echo -c, --conda [NAME] Create the conda environment for Isaac Lab. Default name is 'isaaclab'.
  231. echo.
  232. goto :eof
  233. rem Main
  234. :main
  235. rem check argument provided
  236. if "%~1"=="" (
  237. echo [Error] No arguments provided.
  238. call :print_help
  239. exit /b 1
  240. )
  241. rem pass the arguments
  242. :loop
  243. if "%~1"=="" goto :end
  244. set "arg=%~1"
  245. rem read the key
  246. if "%arg%"=="-i" (
  247. rem install the python packages in omni.isaac.rl/source directory
  248. echo [INFO] Installing extensions inside the Isaac Lab repository...
  249. call :extract_python_exe
  250. for /d %%d in ("%ISAACLAB_PATH%\source\extensions\*") do (
  251. set ext_folder="%%d"
  252. call :install_isaaclab_extension
  253. )
  254. rem install the python packages for supported reinforcement learning frameworks
  255. echo [INFO] Installing extra requirements such as learning frameworks...
  256. if "%~2"=="" (
  257. echo [INFO] Installing all rl-frameworks.
  258. set framework_name=all
  259. ) else if "%~2"=="none" (
  260. echo [INFO] No rl-framework will be installed.
  261. set framework_name=none
  262. shift
  263. ) else (
  264. echo [INFO] Installing rl-framework: %2.
  265. set framework_name=%2
  266. shift
  267. )
  268. rem install the rl-frameworks specified
  269. call !python_exe! -m pip install -e %ISAACLAB_PATH%\source\extensions\omni.isaac.lab_tasks[!framework_name!] -i https://pypi.tuna.tsinghua.edu.cn/simple
  270. shift
  271. ) else if "%arg%"=="--install" (
  272. rem install the python packages in omni.isaac.rl/source directory
  273. echo [INFO] Installing extensions inside the Isaac Lab repository...
  274. call :extract_python_exe
  275. for /d %%d in ("%ISAACLAB_PATH%\source\extensions\*") do (
  276. set ext_folder="%%d"
  277. call :install_isaaclab_extension
  278. )
  279. rem install the python packages for supported reinforcement learning frameworks
  280. echo [INFO] Installing extra requirements such as learning frameworks...
  281. if "%~2"=="" (
  282. echo [INFO] Installing all rl-frameworks.
  283. set framework_name=all
  284. ) else if "%~2"=="none" (
  285. echo [INFO] No rl-framework will be installed.
  286. set framework_name=none
  287. shift
  288. ) else (
  289. echo [INFO] Installing rl-framework: %2.
  290. set framework_name=%2
  291. shift
  292. )
  293. rem install the rl-frameworks specified
  294. call !python_exe! -m pip install -e %ISAACLAB_PATH%\source\extensions\omni.isaac.lab_tasks[!framework_name!] -i https://pypi.tuna.tsinghua.edu.cn/simple
  295. rem update the vscode settings
  296. rem once we have a docker container, we need to disable vscode settings
  297. call :update_vscode_settings
  298. shift
  299. ) else if "%arg%"=="-c" (
  300. rem use default name if not provided
  301. if not "%~2"=="" (
  302. echo [INFO] Using conda environment name: %2
  303. set conda_env_name=%2
  304. shift
  305. ) else (
  306. echo [INFO] Using default conda environment name: isaaclab
  307. set conda_env_name=isaaclab
  308. )
  309. call :setup_conda_env %conda_env_name%
  310. shift
  311. ) else if "%arg%"=="--conda" (
  312. rem use default name if not provided
  313. if not "%~2"=="" (
  314. echo [INFO] Using conda environment name: %2
  315. set conda_env_name=%2
  316. shift
  317. ) else (
  318. echo [INFO] Using default conda environment name: isaaclab
  319. set conda_env_name=isaaclab
  320. )
  321. call :setup_conda_env %conda_env_name%
  322. shift
  323. ) else if "%arg%"=="-f" (
  324. rem reset the python path to avoid conflicts with pre-commit
  325. rem this is needed because the pre-commit hooks are installed in a separate virtual environment
  326. rem and it uses the system python to run the hooks
  327. if not "%CONDA_DEFAULT_ENV%"=="" (
  328. set cache_pythonpath=%PYTHONPATH%
  329. set PYTHONPATH=
  330. )
  331. rem run the formatter over the repository
  332. rem check if pre-commit is installed
  333. pip show pre-commit > nul 2>&1
  334. if errorlevel 1 (
  335. echo [INFO] Installing pre-commit...
  336. pip install pre-commit -i https://pypi.tuna.tsinghua.edu.cn/simple
  337. )
  338. rem always execute inside the Isaac Lab directory
  339. echo [INFO] Formatting the repository...
  340. pushd %ISAACLAB_PATH%
  341. call python -m pre_commit run --all-files
  342. popd >nul
  343. rem set the python path back to the original value
  344. if not "%CONDA_DEFAULT_ENV%"=="" (
  345. set PYTHONPATH=%cache_pythonpath%
  346. )
  347. goto :end
  348. ) else if "%arg%"=="--format" (
  349. rem reset the python path to avoid conflicts with pre-commit
  350. rem this is needed because the pre-commit hooks are installed in a separate virtual environment
  351. rem and it uses the system python to run the hooks
  352. if not "%CONDA_DEFAULT_ENV%"=="" (
  353. set cache_pythonpath=%PYTHONPATH%
  354. set PYTHONPATH=
  355. )
  356. rem run the formatter over the repository
  357. rem check if pre-commit is installed
  358. pip show pre-commit > nul 2>&1
  359. if errorlevel 1 (
  360. echo [INFO] Installing pre-commit...
  361. pip install pre-commit -i https://pypi.tuna.tsinghua.edu.cn/simple
  362. )
  363. rem always execute inside the Isaac Lab directory
  364. echo [INFO] Formatting the repository...
  365. pushd %ISAACLAB_PATH%
  366. call python -m pre_commit run --all-files
  367. popd >nul
  368. rem set the python path back to the original value
  369. if not "%CONDA_DEFAULT_ENV%"=="" (
  370. set PYTHONPATH=%cache_pythonpath%
  371. )
  372. goto :end
  373. ) else if "%arg%"=="-p" (
  374. rem run the python provided by Isaac Sim
  375. call :extract_python_exe
  376. echo [INFO] Using python from: !python_exe!
  377. REM Loop through all arguments - mimic shift
  378. set "allArgs="
  379. for %%a in (%*) do (
  380. REM Append each argument to the variable, skip the first one
  381. if defined skip (
  382. set "allArgs=!allArgs! %%a"
  383. ) else (
  384. set "skip=1"
  385. )
  386. )
  387. !python_exe! !allArgs!
  388. goto :end
  389. ) else if "%arg%"=="--python" (
  390. rem run the python provided by Isaac Sim
  391. call :extract_python_exe
  392. echo [INFO] Using python from: !python_exe!
  393. REM Loop through all arguments - mimic shift
  394. set "allArgs="
  395. for %%a in (%*) do (
  396. REM Append each argument to the variable, skip the first one
  397. if defined skip (
  398. set "allArgs=!allArgs! %%a"
  399. ) else (
  400. set "skip=1"
  401. )
  402. )
  403. !python_exe! !allArgs!
  404. goto :end
  405. ) else if "%arg%"=="-s" (
  406. rem run the simulator exe provided by isaacsim
  407. call :extract_isaacsim_exe
  408. echo [INFO] Running isaac-sim from: !isaacsim_exe!
  409. set "allArgs="
  410. for %%a in (%*) do (
  411. REM Append each argument to the variable, skip the first one
  412. if defined skip (
  413. set "allArgs=!allArgs! %%a"
  414. ) else (
  415. set "skip=1"
  416. )
  417. )
  418. !isaacsim_exe! --ext-folder %ISAACLAB_PATH%\source\extensions !allArgs1
  419. goto :end
  420. ) else if "%arg%"=="--sim" (
  421. rem run the simulator exe provided by Isaac Sim
  422. call :extract_isaacsim_exe
  423. echo [INFO] Running isaac-sim from: !isaacsim_exe!
  424. set "allArgs="
  425. for %%a in (%*) do (
  426. REM Append each argument to the variable, skip the first one
  427. if defined skip (
  428. set "allArgs=!allArgs! %%a"
  429. ) else (
  430. set "skip=1"
  431. )
  432. )
  433. !isaacsim_exe! --ext-folder %ISAACLAB_PATH%\source\extensions !allArgs1
  434. goto :end
  435. ) else if "%arg%"=="-t" (
  436. rem run the python provided by Isaac Sim
  437. call :extract_python_exe
  438. set "allArgs="
  439. for %%a in (%*) do (
  440. REM Append each argument to the variable, skip the first one
  441. if defined skip (
  442. set "allArgs=!allArgs! %%a"
  443. ) else (
  444. set "skip=1"
  445. )
  446. )
  447. !python_exe! tools\run_all_tests.py !allArgs!
  448. goto :end
  449. ) else if "%arg%"=="--test" (
  450. rem run the python provided by Isaac Sim
  451. call :extract_python_exe
  452. set "allArgs="
  453. for %%a in (%*) do (
  454. REM Append each argument to the variable, skip the first one
  455. if defined skip (
  456. set "allArgs=!allArgs! %%a"
  457. ) else (
  458. set "skip=1"
  459. )
  460. )
  461. !python_exe! tools\run_all_tests.py !allArgs!
  462. goto :end
  463. ) else if "%arg%"=="-v" (
  464. rem update the vscode settings
  465. call :update_vscode_settings
  466. shift
  467. goto :end
  468. ) else if "%arg%"=="--vscode" (
  469. rem update the vscode settings
  470. call :update_vscode_settings
  471. shift
  472. goto :end
  473. ) else if "%arg%"=="-d" (
  474. rem build the documentation
  475. echo [INFO] Building documentation...
  476. call :extract_python_exe
  477. pushd %ISAACLAB_PATH%\docs
  478. call !python_exe! -m pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
  479. call !python_exe! -m sphinx -b html -d _build\doctrees . _build\html
  480. echo [INFO] To open documentation on default browser, run:
  481. echo xdg-open "%ISAACLAB_PATH%\docs\_build\html\index.html"
  482. popd >nul
  483. shift
  484. goto :end
  485. ) else if "%arg%"=="--docs" (
  486. rem build the documentation
  487. echo [INFO] Building documentation...
  488. call :extract_python_exe
  489. pushd %ISAACLAB_PATH%\docs
  490. call !python_exe! -m pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
  491. call !python_exe! -m sphinx -b html -d _build\doctrees . _build\current
  492. echo [INFO] To open documentation on default browser, run:
  493. echo xdg-open "%ISAACLAB_PATH%\docs\_build\current\index.html"
  494. popd >nul
  495. shift
  496. goto :end
  497. ) else if "%arg%"=="-h" (
  498. call :print_help
  499. goto :end
  500. ) else if "%arg%"=="--help" (
  501. call :print_help
  502. goto :end
  503. ) else (
  504. echo Invalid argument provided: %arg%
  505. call :print_help
  506. exit /b 1
  507. )
  508. goto loop
  509. :end
  510. exit /b 0

查看 isaaclab.bat 的使用方式,输入.\isaaclab.bat --help

(isaaclab) PS D:\2024\project\IsaacLab-main>
(isaaclab) PS D:\2024\project\IsaacLab-main> .\isaaclab.bat --help

usage: isaaclab.bat [-h] [-i] [-f] [-p] [-s] [-v] [-d] [-c] -- Utility to manage extensions in Isaac Lab.

optional arguments:
    -h, --help           Display the help content.
    -i, --install [LIB]  Install the extensions inside Isaac Lab and learning frameworks as extra dependencies. Default is 'all'.
    -f, --format         Run pre-commit to format the code and check lints.
    -p, --python         Run the python executable (python.bat) provided by Isaac Sim.
    -s, --sim            Run the simulator executable (isaac-sim.bat) provided by Isaac Sim.
    -t, --test           Run all python unittest tests.
    -v, --vscode         Generate the VSCode settings file from template.
    -d, --docs           Build the documentation from source using sphinx.
    -c, --conda [NAME]   Create the conda environment for Isaac Lab. Default name is 'isaaclab'.

(isaaclab) PS D:\2024\project\IsaacLab-main>

然后安装ISAAC Lab,这里有两种方式;

方式1:默认完整版

.\isaaclab.bat --install :: or "isaaclab.bat -i"

默认情况下,这将安装所有学习框架

这个方式大概率会报错,但不影响基本使用,先不管了

  1. Building wheels for collected packages: omni-isaac-lab_tasks
  2. Building editable for omni-isaac-lab_tasks (pyproject.toml) ... done
  3. Created wheel for omni-isaac-lab_tasks: filename=omni_isaac_lab_tasks-0.10.13-0.editable-py3-none-any.whl size=3640 sha256=52d4aa52691354e4437813125cb7e91333fb9d6eaa99af4fa1b86a30daef7efe
  4. Stored in directory: C:\Users\Administrator\AppData\Local\Temp\pip-ephem-wheel-cache-5f9mh9wj\wheels\2b\14\1f\9435ad243a14599ab9b4defd2f8e13254e2e390ed93098a57f
  5. Successfully built omni-isaac-lab_tasks
  6. Installing collected packages: omni-isaac-lab_tasks
  7. Attempting uninstall: omni-isaac-lab_tasks
  8. Found existing installation: omni-isaac-lab_tasks 0.10.13
  9. Uninstalling omni-isaac-lab_tasks-0.10.13:
  10. Successfully uninstalled omni-isaac-lab_tasks-0.10.13
  11. Successfully installed omni-isaac-lab_tasks-0.10.13
  12. [INFO] Installing extra requirements such as learning frameworks...
  13. [INFO] Installing rl-framework: ::.
  14. ERROR: Exception:
  15. Traceback (most recent call last):
  16. File "D:\ProgramData\anaconda3\envs\isaaclab\lib\site-packages\pip\_vendor\packaging\requirements.py", line 36, in __init__
  17. parsed = _parse_requirement(requirement_string)
  18. File "D:\ProgramData\anaconda3\envs\isaaclab\lib\site-packages\pip\_vendor\packaging\_parser.py", line 62, in parse_requirement
  19. return _parse_requirement(Tokenizer(source, rules=DEFAULT_RULES))
  20. File "D:\ProgramData\anaconda3\envs\isaaclab\lib\site-packages\pip\_vendor\packaging\_parser.py", line 77, in _parse_requirement
  21. extras = _parse_extras(tokenizer)
  22. File "D:\ProgramData\anaconda3\envs\isaaclab\lib\site-packages\pip\_vendor\packaging\_parser.py", line 164, in _parse_extras
  23. with tokenizer.enclosing_tokens(
  24. File "D:\ProgramData\anaconda3\envs\isaaclab\lib\contextlib.py", line 142, in __exit__
  25. next(self.gen)
  26. File "D:\ProgramData\anaconda3\envs\isaaclab\lib\site-packages\pip\_vendor\packaging\_tokenizer.py", line 189, in enclosing_tokens
  27. self.raise_syntax_error(
  28. File "D:\ProgramData\anaconda3\envs\isaaclab\lib\site-packages\pip\_vendor\packaging\_tokenizer.py", line 167, in raise_syntax_error
  29. raise ParserSyntaxError(
  30. pip._vendor.packaging._tokenizer.ParserSyntaxError: Expected matching RIGHT_BRACKET for LEFT_BRACKET, after extras
  31. placeholder[::]
  32. ~^
  33. The above exception was the direct cause of the following exception:
  34. Traceback (most recent call last):
  35. File "D:\ProgramData\anaconda3\envs\isaaclab\lib\site-packages\pip\_internal\cli\base_command.py", line 105, in _run_wrapper
  36. status = _inner_run()
  37. File "D:\ProgramData\anaconda3\envs\isaaclab\lib\site-packages\pip\_internal\cli\base_command.py", line 96, in _inner_run
  38. return self.run(options, args)
  39. File "D:\ProgramData\anaconda3\envs\isaaclab\lib\site-packages\pip\_internal\cli\req_command.py", line 67, in wrapper
  40. return func(self, options, args)
  41. File "D:\ProgramData\anaconda3\envs\isaaclab\lib\site-packages\pip\_internal\commands\install.py", line 343, in run
  42. reqs = self.get_requirements(args, options, finder, session)
  43. File "D:\ProgramData\anaconda3\envs\isaaclab\lib\site-packages\pip\_internal\cli\req_command.py", line 244, in get_requirements
  44. req_to_add = install_req_from_editable(
  45. File "D:\ProgramData\anaconda3\envs\isaaclab\lib\site-packages\pip\_internal\req\constructors.py", line 235, in install_req_from_editable
  46. parts = parse_req_from_editable(editable_req)
  47. File "D:\ProgramData\anaconda3\envs\isaaclab\lib\site-packages\pip\_internal\req\constructors.py", line 204, in parse_req_from_editable
  48. name, url, extras_override = parse_editable(editable_req)
  49. File "D:\ProgramData\anaconda3\envs\isaaclab\lib\site-packages\pip\_internal\req\constructors.py", line 113, in parse_editable
  50. get_requirement("placeholder" + extras.lower()).extras,
  51. File "D:\ProgramData\anaconda3\envs\isaaclab\lib\site-packages\pip\_internal\utils\packaging.py", line 45, in get_requirement
  52. return Requirement(req_string)
  53. File "D:\ProgramData\anaconda3\envs\isaaclab\lib\site-packages\pip\_vendor\packaging\requirements.py", line 38, in __init__
  54. raise InvalidRequirement(str(e)) from e
  55. pip._vendor.packaging.requirements.InvalidRequirement: Expected matching RIGHT_BRACKET for LEFT_BRACKET, after extras
  56. placeholder[::]
  57. ~^
  58. [INFO] Setting up vscode settings...
  59. [WARN] Could not find Isaac Sim VSCode settings: D:\ProgramData\anaconda3\envs\isaaclab\Lib\site-packages\isaacsim\.vscode\settings.json.
  60. This will result in missing 'python.analysis.extraPaths' in the VSCode
  61. settings, which limits the functionality of the Python language server.
  62. However, it does not affect the functionality of the Isaac Lab project.
  63. We are working on a fix for this issue with the Isaac Sim team.
  64. Invalid argument provided: or
  65. usage: isaaclab.bat [-h] [-i] [-f] [-p] [-s] [-v] [-d] [-c] -- Utility to manage extensions in Isaac Lab.
  66. optional arguments:
  67. -h, --help Display the help content.
  68. -i, --install [LIB] Install the extensions inside Isaac Lab and learning frameworks as extra dependencies. Default is 'all'.
  69. -f, --format Run pre-commit to format the code and check lints.
  70. -p, --python Run the python executable (python.bat) provided by Isaac Sim.
  71. -s, --sim Run the simulator executable (isaac-sim.bat) provided by Isaac Sim.
  72. -t, --test Run all python unittest tests.
  73. -v, --vscode Generate the VSCode settings file from template.
  74. -d, --docs Build the documentation from source using sphinx.
  75. -c, --conda [NAME] Create the conda environment for Isaac Lab. Default name is 'isaaclab'.

方式2:精简版

.\isaaclab.bat --install rl_games :: or "isaaclab.bat -i rl_games"

只想安装特定框架,则可以将框架的名称作为参数传递。

参数值:rl_games、rsl_rl、sb3、skrl、robomimic、none

安装成功后,如下图所示的: 

​

5、测试ISAAC Lab是否安装成功

输入下面命令

.\isaaclab.bat -p source\standalone\tutorials\00_sim\create_empty.py

需要等待一会~

然后出现下面窗口,成功啦

6、案例:生成不同的四足机器人

输入下面命令

.\isaaclab.bat -p source\standalone\demos\quadrupeds.py

需要等待一会~

出现下面窗口,看到不同的四足机器人,成功啦

其他的功能也可以慢慢探索啦

分享完成~

后续会持续分析ISAAC Lab的内容,包括机器人的强化学习、模仿学习和运动规划实现仿真。

注:本文转载自blog.csdn.net的一颗小树x的文章"https://blog.csdn.net/qq_41204464/article/details/144201553"。版权归原作者所有,此博客不拥有其著作权,亦不承担相应法律责任。如有侵权,请联系我们删除。
复制链接
复制链接
相关推荐
发表评论
登录后才能发表评论和回复 注册

/ 登录

评论记录:

未查询到任何数据!
回复评论:

分类栏目

后端 (14832) 前端 (14280) 移动开发 (3760) 编程语言 (3851) Java (3904) Python (3298) 人工智能 (10119) AIGC (2810) 大数据 (3499) 数据库 (3945) 数据结构与算法 (3757) 音视频 (2669) 云原生 (3145) 云平台 (2965) 前沿技术 (2993) 开源 (2160) 小程序 (2860) 运维 (2533) 服务器 (2698) 操作系统 (2325) 硬件开发 (2492) 嵌入式 (2955) 微软技术 (2769) 软件工程 (2056) 测试 (2865) 网络空间安全 (2948) 网络与通信 (2797) 用户体验设计 (2592) 学习和成长 (2593) 搜索 (2744) 开发工具 (7108) 游戏 (2829) HarmonyOS (2935) 区块链 (2782) 数学 (3112) 3C硬件 (2759) 资讯 (2909) Android (4709) iOS (1850) 代码人生 (3043) 阅读 (2841)

热门文章

101
推荐
关于我们 隐私政策 免责声明 联系我们
Copyright © 2020-2025 蚁人论坛 (iYenn.com) All Rights Reserved.
Scroll to Top