I am trying to run a standalone python script that aims to open and load a USD stage and starts it running. The USD file that the script intends to open has been already worked upon and contains robot prims and some action graphs. The action graphs use Isaac ROS bridge and Semu Robotics bridge by @toni.sm to publish various information on ros topics and respective transforms. Now, whenever the USD stage is loaded from GUI, i.e., opening Isaac Sim from launcher and opening the USD file, everything runs fine. The transforms are published and I am able to control the robot via MoveIt. However, whenever I try to open and load the USD file from standalone script the MoveIt fails to connect as “Comput Graph” attribute from the Action Graph of all nodes are missing.
The script used:
from omni.isaac.kit import SimulationApp
simulation_app = SimulationApp({"headless": False})
from omni.isaac.core import World
from omni.isaac.core.utils.stage import open_stage
import os
import omni
ext_manager = omni.kit.app.get_app().get_extension_manager()
ext_manager.set_extension_enabled_immediate("omni.isaac.ros_bridge", True)
ext_manager.set_extension_enabled_immediate("semu.robotics.ros_bridge", True)
open_stage(usd_path="/path/to/usd/file.usd")
self.stage = omni.usd.get_context().get_stage()
world = World()
# world.reset()
while True:
world.step(render=True)
simulation_app.update()
I am also sharing the screenshots of a sample action graph node, where compute graph is missing when running from Standalone script.
For some reason that I need to take time to inspect, when running from a Python standalone script the extension is not being loaded.
However, including the path to the extension, before loading it, as follow works:
Hi @toni.sm thank you for your response. In my case, the semu.robotics.ros_bridge is already in isaac_sim-2022.2.1/exts folder. However, still I tried the above script by placing the extension in Kit path and including the path to the extension. However, still the issue remains same. I guess when I see the console it seems node starts (“SemuRosBridge node started” statement in below console) but problem seems to be somewhere else. See:
[Info][semu.robotics.ros_bridge] ROS1 Attribute: asyncio: False
[Info][semu.robotics.ros_bridge] ROS1 Attribute: event timeout: 5.0
2023-05-18 06:06:01 [15,809ms] [Warning] [omni.hydra.scene_delegate.plugin] Calling getBypassRenderSkelMeshProcessing for prim /World/PaintTool/Grass_Short_A_26bdf/pointInstancer.proto0_Grass_short_a_id0 that has not been populated
[Info][semu.robotics.ros_bridge] SemuRosBridge node started
[Info][semu.robotics.ros_bridge] ROS1 FollowJointTrajectory: destroying action server
[Info][semu.robotics.ros_bridge] ROS1 FollowJointTrajectory: register action /robot_controller/follow_joint_trajectory
[Info][semu.robotics.ros_bridge] ROS1 Attribute: register srv: /get_prims
[Info][semu.robotics.ros_bridge] ROS1 Attribute: register srv: /get_attributes
[Info][semu.robotics.ros_bridge] ROS1 Attribute: register srv: /get_attribute
[Info][semu.robotics.ros_bridge] ROS1 Attribute: register srv: /set_attribute
2023-05-18 06:06:23 [37,580ms] [Error] [omni.graph.core.plugin] /World/mobile_manipulator/ROS_Cameras/isaac_get_viewport_render_product_01: Assertion raised in compute - 'OgnIsaacGetViewportRenderProductInternalState' object has no attribute 'viewport'
File "/home/labuser/.local/share/ov/pkg/isaac_sim-2022.2.0/exts/omni.isaac.core_nodes/omni/isaac/core_nodes/ogn/nodes/OgnIsaacGetViewportRenderProduct.py", line 39, in compute
if db.internal_state.viewport == None:
2023-05-18 06:06:23 [37,709ms] [Error] [omni.isaac.core_nodes.impl.extension] Could not process writer attach request (True, <omni.replicator.core.scripts.writers.NodeWriter object at 0x7fb62c043c90>, '/Render/RenderProduct_omni_kit_widget_viewport_ViewportTexture_0'), Tried to create a node in a path without a graph - '/Render/PostProcess/SDGPipeline/RenderProduct_omni_kit_widget_viewport_ViewportTexture_0_NodeWriterWriter_01'
2023-05-18 06:06:23 [37,777ms] [Warning] [omni.graph.core.plugin] Node compute request is ignored because "/World/Conveyor/ConveyorBeltGraph/ConveyorNode" is not request-driven
2023-05-18 06:06:26 [39,858ms] [Warning] [omni.graph.core.plugin] Node compute request is ignored because "/World/Conveyor/ConveyorBeltGraph/ConveyorNode" is not request-driven
Hi @toni.sm now I tried to run not a custom USD file instead a sample stage from IsaacSim, i.e., carter_warehouse_navigation.usd in Samples, whose path is - omniverse://localhost/NVIDIA/Assets/Isaac/2022.2.0/Isaac/Samples/ROS/Scenario/ or omniverse://localhost/NVIDIA/Assets/Isaac/2022.2.1/Isaac/Samples/ROS/Scenario/
Even such an example is not properly running with “Compute Graph” missing. Besides the same works fine if we run the example from GUI. It fails to load the attribute “Compute Graph” from standalone script. PFB the screenshots of comparispon.
No “Compute Graph” screenshots running from standalone script:
I cannot reproduce your issue.
For example, the following code runs perfectly on Isaac Sim 2022.2.1.
from omni.isaac.kit import SimulationApp
simulation_app = SimulationApp({"headless": False})
import omni
from omni.isaac.core import World
from omni.isaac.core.utils.stage import open_stage, is_stage_loading
ext_manager = omni.kit.app.get_app().get_extension_manager()
ext_manager.set_extension_enabled_immediate("omni.isaac.ros_bridge", True)
simulation_app.update()
# load stage
open_stage(usd_path="omniverse://localhost/NVIDIA/Assets/Isaac/2022.2.1/Isaac/Samples/ROS/Scenario/carter_warehouse_navigation.usd")
# wait two frames so that stage starts loading
simulation_app.update()
simulation_app.update()
print("Loading stage...")
while is_stage_loading():
simulation_app.update()
world = World()
world.reset()
while simulation_app.is_running():
world.step(render=True)
simulation_app.close()
Can you please upload the logs of this last example?
Hi @deveshkumar21398 - It might be related to the sequence in your script. When you open the stage using open_stage, it might be overwriting the existing stage and causing the loss of the “Compute Graph” attribute from the Action Graph of all nodes. Can you try the following script and let me know if you were able to resolve the issue or not:
from omni.isaac.kit import SimulationApp
simulation_app = SimulationApp({"headless": False})
from omni.isaac.core import World
from omni.isaac.core.utils.stage import load_stage
import os
import omni
ext_manager = omni.kit.app.get_app().get_extension_manager()
ext_manager.set_extension_enabled_immediate("omni.isaac.ros_bridge", True)
ext_manager.set_extension_enabled_immediate("semu.robotics.ros_bridge", True)
load_stage(usd_path="/path/to/usd/file.usd")
self.stage = omni.usd.get_context().get_stage()
world = World()
# world.reset()
while True:
world.step(render=True)
simulation_app.update()
I tried running the above script, however, there is no such method as load_stage in the stage.py file. Therefore, it can’t import the same. Could you please check and confirm once from your end or if there is alternative way to load the stage such that it is not overwriting the stage.
Moreover, in this process I found load_stage.py, a standalone script to the load the stage. Even running the same by giving the path to any USD file, the issue persists.
Hi @rthaker@Hammad_M a gentle reminder just in case you missed on this issue. Please help us with the resolution as we are not able to execute any USD file with Omnigraph nodes using a standalone script. Any help would be appreciated. Thanks!
Hi @deveshkumar21398 - Can you try this script? if that doesn’t work then I will revert this question to devs who can help further.
from omni.isaac.core import World
from omni.usd import Usd
import os
import omni
ext_manager = omni.kit.app.get_app().get_extension_manager()
ext_manager.set_extension_enabled_immediate("omni.isaac.ros_bridge", True)
ext_manager.set_extension_enabled_immediate("semu.robotics.ros_bridge", True)
usd_path = "/path/to/usd/file.usd"
stage = Usd.Stage.Open(usd_path)
omni.usd.get_context().set_stage(stage)
world = World()
while True:
world.step(render=True)
Hi @rthaker, I have tried running your script. However, it return an error message saying set_stage is not an attribute to UsdContext. I have attached the screenshot as well. Meanwhile, I tried set_stage_live as well, however, it returned as - the method is deprecated and is recommended to not use it.
Hi @deveshkumar21398 - There is a new Isaac Sim release coming soon (Aug/sep) timeframe. Let me know if you can wait till then to try your actiongraph.
I ran the following script first, to install the extension from the extension manager
simulation_app = SimulationApp({"headless": False})
from omni.isaac.core import World
world = World()
world.reset()
while simulation_app.is_running():
world.step(render=True)
simulation_app.close()
from omni.isaac.kit import SimulationApp
simulation_app = SimulationApp({"headless": False})
import omni
from omni.isaac.core import World
ext_manager = omni.kit.app.get_app().get_extension_manager()
ext_manager.set_extension_enabled_immediate("omni.isaac.ros_bridge", True)
ext_manager.set_extension_enabled_immediate("semu.robotics.ros_bridge", True)
world = World()
world.reset()
while simulation_app.is_running():
world.step(render=True)
simulation_app.close()
The reason for this two step process is to avoid having to give a path to the extension install folder, the extension if installed via ui with a standalone app gets installed to an existing search path.