ComponentBase#

Fully qualified name: isaacsim::core::includes::ComponentBase

template<class PrimType>
class ComponentBase#

Base class template for USD prim-attached components in an Application.

ComponentBase provides the foundational structure for components that are attached to USD prims within an Application. It manages the lifecycle, timing, and state of components while providing virtual interfaces for key operations like initialization, updates, and event handling.

Note

All derived components must implement the pure virtual functions

Warning

Components must be properly initialized with a valid USD prim and stage before use

Template Parameters:

PrimType – The USD prim type that this component will be attached to

Subclassed by isaacsim::sensors::physics::IsaacSensorComponentBase< PrimType >, isaacsim::sensors::physx::RangeSensorComponentBase< PrimType >

Public Functions

virtual ~ComponentBase() = default#

Virtual destructor ensuring proper cleanup of derived classes.

inline virtual void initialize(
const PrimType &prim,
pxr::UsdStageWeakPtr stage,
)#

Initializes the component with USD prim and stage references.

Sets up the component’s USD context and prepares it for execution

Parameters:
  • prim[in] The USD prim to attach this component to

  • stage[in] The USD stage containing the prim

Post:

Component is initialized with valid USD prim and stage references

Post:

mDoStart is set to true, indicating the component is ready to start

virtual void onStart() = 0#

Pure virtual function called after simulation start.

Implement this to define component behavior at simulation start

inline virtual void onStop()#

Called when simulation is stopped.

Override this to implement cleanup or state reset behavior

inline virtual void onPhysicsStep(float dt)#

Called during each physics simulation step.

Override this to implement physics-based behavior

Parameters:

dt[in] Time step size in seconds

inline virtual void onRenderEvent()#

Called for each rendered frame.

Override this to implement render-specific behavior or visual updates

virtual void tick() = 0#

Pure virtual function called every frame.

Implement this to define the component’s per-frame behavior

virtual void onComponentChange() = 0#

Pure virtual function called when the component’s prim changes.

Implement this to handle USD prim attribute or relationship changes

inline virtual void updateTimestamp(
double timeSeconds,
double dt,
int64_t timeNano,
)#

Updates the component’s internal timing information.

Maintains synchronized timing state across the component

Parameters:
  • timeSeconds[in] Current simulation time in seconds

  • dt[in] Time step size in seconds

  • timeNano[in] Current simulation time in nanoseconds

inline PrimType &getPrim()#

Retrieves the component’s USD prim.

Returns:

Reference to the component’s USD prim

inline bool getEnabled()#

Checks if the component is enabled.

Returns:

true if the component is enabled, false otherwise

inline uint64_t getSequenceNumber()#

Gets the component’s sequence number.

Returns:

The component’s sequence number

Public Members

bool mDoStart = true#

Flag indicating whether onStart should be called.

Protected Attributes

PrimType m_prim#

USD prim reference storing component settings.

pxr::UsdStageWeakPtr m_stage = nullptr#

Weak pointer to the USD stage containing the prim.

usdrt::UsdStageRefPtr m_usdrtStage = nullptr#

Runtime USD stage reference.

double m_timeSeconds = 0#

Current simulation time in seconds.

int64_t m_timeNanoSeconds = 0#

Current simulation time in nanoseconds.

double m_timeDelta = 0#

Time delta for current tick in seconds.

uint64_t m_sequenceNumber = 0#

Component sequence number for ordering/identification.

bool m_enabled = true#

Component enabled state flag.