We are heavily using IsaacSim(with ROS2) on the Linux machines and now we would like to use OV VR, and it requires Windows.
I’ve installed IsaacSim and I can run the application without any issues.
But we would like to use python to run our applications and we faced the issue that rclpy can not be found. Here is the log when we are trying to run standalone example by command
python.bat standalone_examples\api\omni.isaac.ros2_bridge\subscriber.py
[6.574s] Simulation App Starting
[14.266s] app ready
[14.536s] RTX ready
[14.888s] Simulation App Startup Complete
[14.910s] [ext: omni.isaac.ros2_bridge-1.10.1] startup
Traceback (most recent call last):
File "C:\Users\yuriy\AppData\Local\ov\pkg\isaac_sim-2022.2.0\standalone_examples\api\omni.isaac.ros2_bridge\subscriber.py", line 26, in <module>
import rclpy
ModuleNotFoundError: No module named 'rclpy'
Exception ignored in: <function _make_registry.<locals>._Registry.__del__ at 0x0000018C4C350CA8>
Traceback (most recent call last):
According to the comments, rclpy should be precompiled, but I’m not able to find it in the IsaacSim files
# Note that this is not the system level rclpy, but one compiled for omniverse
import rclpy
I can’t answer the question but I can offer a possible solution: compile ROS2 for Windows with Python 3.7 to use the rclpy package
The version of the NVIDIA Omniverse Python environment is 3.7. It is not possible to use the binary files of the available ROS 2 distributions (Foxy e.g.) because they are compiled with Python >= 3.8. Then, it is necessary to compile the ROS2 source using Python3.7
Despite how tedious the steps may seem, I managed to compile the distribution without major problems (on Windows 10) and use the rclpy package
Follow the instructions in Windows (source) taking into account the following:
Install Python 3.7.9 instead of the version indicated in the steps and make sure that this or any other Python 3.7 environment is the only one available in the command prompt
choco install -y python --version 3.7.9
Use the following command to identify errors in case of compilation failure
For using the compiled distribution with Isaac Sim, I had to replace the .dll files in the <path_to_isaac_sim>\exts\omni.isaac.ros2_bridge\bin folder with the compiled ones in install\bin folder. After that, and unlike Linux (according to the documentation in Isaac Sim), source the built ROS2 distribution before running Isaac Sim
Please, let me know if all goes well if you decide to follow this path :)
Yeah, I know that modifying the dll files in Isaac Sim’s omni.isaac.ros2_bridge extension (bin folder) is a questionable solution… but that’s what I found to make it work…
Btw, only replace the 26 common dlls. There are 3 others belonging to Isaac Sim
Finally, I’ve managed to make it work. And I didn’t need to replace dlls in the IsaacSim installation folder.
Here are steps to fix this(just to make it more clear):
Install Python 3.7.9 instead of the version indicated in the steps and make sure that this or any other Python 3.7 environment is the only one available in the command prompt