defineInterfaceClass#

Fully qualified name: isaacsim::core::includes::defineInterfaceClass

template<typename InterfaceType, typename ...PyClassArgs>
py::class_<InterfaceType, PyClassArgs...> isaacsim::core::includes::defineInterfaceClass(
py::module &m,
const char *className,
const char *acquireFuncName,
const char *releaseFuncName = nullptr,
const char *classDocstring = nullptr,
)#

Define a pybind11 class for a Carbonite interface with acquire/release functions.

This function creates Python bindings for a Carbonite interface, including:

  • A Python class wrapping the interface

  • An acquire function to get an instance of the interface

  • An optional release function to release the interface

Unlike carb::defineInterfaceClass, this version uses std::optional<std::string> for the acquire function parameters, which generates correct Python type stubs (str | None = None instead of str = None).

// Example usage:
isaacsim::core::includes::defineInterfaceClass<IMyInterface>(
    m, "IMyInterface", "acquire_my_interface", "release_my_interface")
    .def("some_method", &IMyInterface::someMethod);

Template Parameters:
  • InterfaceType – The Carbonite interface type to wrap

  • PyClassArgs – Additional template arguments for py::class_

Parameters:
  • m – The pybind11 module to add the class to

  • className – The name of the Python class

  • acquireFuncName – The name of the acquire function in Python

  • releaseFuncName – The name of the release function (optional, can be nullptr)

  • classDocstring – Documentation string for the class (optional)

Returns:

The pybind11 class object for further method definitions