PhysicsEntity#

Fully qualified name: isaacsim::physics::entities::PhysicsEntity

class PhysicsEntity#

Base wrapper over a batch of simulated physics prims exposed through the tensor API.

Binds a set of USD prim paths to a physics engine entity view and exposes named data buffers (positions, velocities, masses, …) as batched arrays. All methods that accept an indices parameter operate only on the prims at those positions; when indices is omitted, all wrapped prims are processed.

The set of valid buffer names depends on the entity kind and the physics engine backing it.

Note

The wrapped prims must be part of a started simulation for data access to succeed.

Subclassed by isaacsim::physics::entities::ArticulationEntity, isaacsim::physics::entities::RigidBodyEntity

Public Functions

PhysicsEntity(
const std::string &engine,
const std::string &entity,
const std::variant<std::string, std::vector<std::string>> &paths,
)#

Construct a physics entity wrapper for one or more USD prim paths.

Parameters:
  • engine – [in] Name of the physics engine that simulates the prims.

  • entity – [in] Kind of physics entity to create (e.g. "rigid-body", "articulation").

  • paths – [in] Single path string or list of path strings. May include regular expressions.

Throws:

std::runtime_error – if the entity cannot be created for the given engine and paths.

~PhysicsEntity() = default#
size_t numPrims() const noexcept#

Return the number of wrapped prims.

Returns:

Count of prims managed by this entity.

array::Array getData(
const std::string &name,
const std::optional<array::Array> &indices = std::nullopt,
)#

Read a named data buffer for the selected prims.

Parameters:
  • name – [in] Name of the data buffer to read.

  • indices – [in] Indices of prims to process (shape (N,)). If omitted, all wrapped prims are processed.

Throws:

std::runtime_error – if the buffer name is not supported by the entity.

Returns:

Buffer contents, with the leading dimension matching the number of selected prims.

void setData(
const std::string &name,
const array::Array &data,
const std::optional<array::Array> &indices = std::nullopt,
)#

Write a named data buffer for the selected prims.

Parameters:
  • name – [in] Name of the data buffer to write.

  • data – [in] New buffer contents, with the leading dimension matching the number of selected prims.

  • indices – [in] Indices of prims to process (shape (N,)). If omitted, all wrapped prims are processed.

Throws:

std::runtime_error – if the buffer name is not supported by the entity.

std::vector<array::Array> getMultiData(
const std::string &name,
const std::optional<array::Array> &indices = std::nullopt,
)#

Read a named data buffer that is composed of several arrays for the selected prims.

Parameters:
  • name – [in] Name of the data buffer to read.

  • indices – [in] Indices of prims to process (shape (N,)). If omitted, all wrapped prims are processed.

Throws:

std::runtime_error – if the buffer name is not supported by the entity.

Returns:

Ordered list of buffer components.

void setMultiData(
const std::string &name,
const std::vector<array::Array> &data,
const std::optional<array::Array> &indices = std::nullopt,
)#

Write a named data buffer that is composed of several arrays for the selected prims.

Parameters:
  • name – [in] Name of the data buffer to write.

  • data – [in] Ordered list of buffer components to write.

  • indices – [in] Indices of prims to process (shape (N,)). If omitted, all wrapped prims are processed.

Throws:

std::runtime_error – if the buffer name is not supported by the entity.

Protected Attributes

std::shared_ptr<isaacsim::physics::tensors::EntityView> m_entityView#

View of the wrapped prims held by the physics engine.