RangeSensorComponentBase#
Fully qualified name: isaacsim::sensors::physx::RangeSensorComponentBase
-
template<class PrimType>
class RangeSensorComponentBase : public isaacsim::core::includes::ComponentBase<PrimType># Base class which simulates a range sensor.
This template class provides the core functionality for range-based sensors, including initialization, lifecycle management, and data processing. It handles sensor transforms, visualization, and interaction with the physics simulation.
- Template Parameters:
PrimType – The USD prim type associated with this sensor component
Subclassed by isaacsim::sensors::physx::GenericSensor, isaacsim::sensors::physx::LidarSensor, isaacsim::sensors::physx::LightBeamSensor
Public Functions
-
inline RangeSensorComponentBase(omni::physx::IPhysx *physxPtr)#
Constructs a new Isaac Component.
Initializes the component with necessary interfaces and creates visualization helpers
- Parameters:
physxPtr – [in] Pointer to the PhysX interface for physics simulation
-
inline ~RangeSensorComponentBase()#
Destroys the Range Sensor Component Base object.
Cleans up visualization resources
- inline virtual void initialize( )#
Initializes various pointers and handles in the component.
Must be called after creation, can be overridden to initialize subcomponents
- Parameters:
prim – [in] The USD prim representing this sensor
stage – [in] The USD stage containing the sensor prim
-
inline virtual void onStart()#
Function that runs after start is pressed.
Initializes the component and locates the PhysX scene for sensor operations
-
inline virtual void preTick()#
Called before tick, sequential, used to get sensor transforms.
Empty base implementation that can be overridden by derived classes
-
virtual void tick() = 0#
Called every frame in parallel.
Pure virtual function that must be implemented by derived classes to perform the main sensor update during each simulation frame
-
inline virtual void onPhysicsStep()#
Called after each physics step to update sensor data.
This function is called after each physics simulation step to process and update the range sensor data based on the latest physics state
-
inline virtual void draw()#
Called after all sensors have simulated to perform any drawing related tasks.
Renders the debug visualization for both points and lines if enabled
-
inline virtual void onStop()#
Run when stop is pressed.
Clears all visualization data and ensures it’s properly rendered
-
inline virtual void onComponentChange()#
Called every time the Prim is changed.
Updates component properties from the USD prim attributes and refreshes transform-related data
- inline virtual void updateTimestamp(
- double timeSeconds,
- double dt,
- int64_t timeNano,
Updates timestamps for component.
- Parameters:
timeSeconds – [in] Current simulation time in seconds
dt – [in] Time step duration in seconds
timeNano – [in] Current simulation time in nanoseconds
-
inline bool getDrawPoints()#
Gets the draw points visualization state.
- Returns:
True if point visualization is enabled, false otherwise
-
inline bool getDrawLines()#
Gets the draw lines visualization state.
- Returns:
True if line visualization is enabled, false otherwise
-
inline std::vector<carb::Float3> &getPointCloud()#
Gets the latest point cloud data from the range sensor.
Returns a reference to the vector containing the most recent hit positions detected by the range sensor. Each point represents a detected surface in 3D space.
- Returns:
Reference to vector of 3D points representing the latest point cloud data
-
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
-
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
-
bool m_drawPoints = false#
Flag to enable/disable point visualization.
-
bool m_drawLines = false#
Flag to enable/disable line visualization.
-
std::vector<carb::Float3> m_lastHitPos#
Vector storing the most recent hit positions from the sensor.
-
float m_minRange = 0.4f#
Minimum range of the sensor in meters.
-
float m_maxRange = 100.0f#
Maximum range of the sensor in meters.
-
float m_metersPerUnit = 1.0#
Conversion factor from scene units to meters.
-
carb::tasking::ITasking *m_tasking = nullptr#
Pointer to the tasking interface.
-
std::shared_ptr<isaacsim::util::debug_draw::drawing::PrimitiveDrawingHelper> m_lineDrawing#
Helper for drawing debug lines.
-
std::shared_ptr<isaacsim::util::debug_draw::drawing::PrimitiveDrawingHelper> m_pointDrawing#
Helper for drawing debug points.
-
bool m_isParentPrimTimeSampled = false#
Flag indicating if the parent prim has time-sampled transforms.
-
bool m_firstFrame = true#
Flag indicating if this is the first frame.
-
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.