Hello.
I’m trying to write an Omnigraph node implementation that subscribes to a custom ROS message. I want the node state to reset to its initial state when the model is stopped. I have a few questions:
Isaac Sim guide describes one function (compute), which is called (probably) when a signal arrives at the execution input. What are other functions exist?
In isaac sim we use this base class for nodes that need to reset when simulation is stopped.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
import omni.usd
import carb.events
class BaseResetNode:
"""
Base class for nodes that automatically reset when stop is pressed.
"""
def __init__(self, initialize=False):
self.initialized = initialize
stage = omni.usd.get_context()
self.stage_event_sub = stage.get_stage_event_stream().create_subscription_to_pop(
self.on_stage_event, name="IsaacSimOGNCoreNodesStageEventHandler"
)
def on_stage_event(self, event: carb.events.IEvent):
if event.type == int(omni.usd.StageEventType.SIMULATION_STOP_PLAY):
self.custom_reset()
self.initialized = False
# Defined by subclass
def custom_reset(self):
pass
def reset(self):
self.stage_event_sub = None
self.initialized = None